Working Ninja
2016-09-06T07:51:45
#!/usr/bin/env python

import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django
django.setup()

from app.models import Class

# Your scripting here.

Sources:
https://docs.djangoproject.com/en/1.10/intro/tutorial02/#playing-with-the-api
https://docs.djangoproject.com/en/1.10/topics/settings/#on-the-server-mod-wsgi

READ MORE

2015-12-05T17:32:59

I needed to create a slew of objects for a project I was working on. Lots of tedious and error prone work. But wait, I'm using a computer. Automation to the rescue!

I wrote my script by first importing what I needed from Django (User and the Appointment model for …

READ MORE

2015-10-13T07:38:08

This script will find (including subdirectories) and convert all m4a files to mp3.

find -name "*.m4a" -exec ~/m4atomp3 {} \;

m4atomp3:

#!/bin/bash
m4afile=$@
avconv -i "$m4afile" -ab 320k "${m4afile/.m4a/.mp3}"

Remember to chmod +x m4atomp3.

READ MORE