Root Cron to run Python

I was having some issues with a cron job I created as root using crontab -e the entry was: */15 * * * * /path/to/file.py After ripping my hair out overnight (Troubleshooting tips): tail /var/log/cron (checks if it is running) add a line to your crontab: MAILTO=”you@domain.com” – will email you debugging info Here’s the[…]

MySQL on FreeBSD 10

# pkg install mysql56-server # echo ‘mysql_enable=”YES”‘>>/etc/rc.conf # service mysql_server start # mysql -u root mysql> SET PASSWORD FOR ‘root’@’localhost’ = PASSWORD(‘rootpwd’); mysql> SET PASSWORD FOR ‘root’@’host_name’ = PASSWORD(‘rootpwd’); # mysql -u root mysql> SET PASSWORD FOR ”@’localhost’ = PASSWORD(‘anonpwd’); mysql> SET PASSWORD FOR ”@’host_name’ = PASSWORD(‘anonpwd’); mysql> CREATE USER ‘colin’@’localhost’ IDENTIFIED BY ‘SuperPassword!’; mysql>[…]

Debugging Python and Ruby

Both Command Line based debuggers are very similar. Python: http://docs.python.org/2/library/pdb.html : # python -m pdb debugfile.py Once in: b (line #) – sets breakpoint s – step into n – next c – continue r – run til return Ruby: http://www.tutorialspoint.com/ruby/ruby_debugger.htm : # ruby -r debug debugfile.rb Once in: b (line #) – sets breakpoint[…]

READ:

Developing RESTful Web APIs with Python, Flask and MongoDB from Nicola Iarocci http://tomayko.com/writings/rest-to-my-wife __ Ryan Tomayko Disclaimer: After receiving a number of reasonable complaints about the gender-oriented nature of this article from people I respect very much, I’ve decided to take it down for good. While the dialog was never intended as commentary on the[…]

Convert m4a to mp3 (or any FFMPEG conversion – Modify accordingly)

root@colinbsd2:/usr/home/colin # cat /mnt/ipod/iPod_Control/Music/m4aTomp3sh #!/bin/sh if [ -z $1 ];then echo Give target directory; exit 0;fi find “$1” -depth -name ‘*’| while read file ; do directory=$(dirname “$file”) oldfilename=$(basename “$file”) newfilename=$(basename “${file%.[Mm][4][Aa]}”) if [ “$oldfilename” != “$newfilename” ]; then ffmpeg -i “$directory/$oldfilename” -ab 320k “$directory/$newfilename.mp3”

FreeBSD Rename iPod_Control MP3 Files

Install Wine: root@colinbsd2:/home/colin# pkg install i386-wine Download: http://www.mp3tag.de/en/download.html Unpack the exe: (quickest way I have is 7-zip in M$) Run the program: root@colinbsd2:/home/colin# cd mp3tag root@colinbsd2:/home/colin# wine Mp3tag.exe (In the gui) Select iPod_Control/Music Subdir F5 (refresh), select file Alt+1

iPod on FreeBSD

[colin@superBSD] /usr/home/colin# mkdir -p /mnt/ipod [colin@superBSD] /usr/home/colin# mount -t msdosfs -o large /dev/da0s1 /mnt/ipod [colin@superBSD] /usr/home/colin# pkg install gtkpod Edit -> Repository Options -> Add New iPod (top right) point it at /mnt/ipod Hit OK Hit Load iPod (top left)