Here's the camera taking images of the evening sky. I stopped it when it got so dark that it was taking nearly 4 seconds of exposure per shot.
Here's the movie made at 25 fps with 900 photos at 5 second intervals.
Scott Kirkwood's Personal Blog Programming, Python, Brazil, Google
sudo aptitude install graphicsmagickThen you'll need to downloaded and compile from source mpeg2encode to that it can do the conversion to mpeg (this doesn't come included with GraphicsMagick because of some licensing issues).
Finally to do the conversion you need to go to a directory that has all your photos and execute:mkdir -p ~/tmp cd ~/tmp wget http://www.mpeg.org/pub_ftp/mpeg/mssg/mpeg2vidcodec_v12.tar.gz tar xvf mpeg2vidcodec_v12.tar.gz cd mpeg2 make sudo cp src/mpeg2enc/mpeg2encode /usr/local/bin/ sudo cp src/mpeg2dec/mpeg2decode /usr/local/bin/ cd .. rm -rf mpeg2 rm mpeg2vidcodec_v12.tar.gz
This will convert all the jpg images in the directory to 640x480 and create a new file called movie.mpeg (-monitor is to output the progress).gm convert -size 640x480 -resize 640x480 -monitor *.jpg movie.mpeg


sudo␣grubWorse, it's even picky about spaces, you need to put a space (shown above as '␣') or you'll get an error message, you've got to be kidding me. If you forget the sudo, it gives you useless error message instead of mentioning that running as root is probably a good idea.
find␣/boot/grub/stage1
root␣(hd0,1)
setup␣(hd0)
restore my goddamn boot menu!It should just figure out the rest, possibly asking a question if there's any doubt.




#!/usr/bin/env python
import socket
import struct
import sys
def wake_on_lan(macaddress):
""" Switches on remote computers using WOL. """
# Check macaddress format and try to compensate.
if len(macaddress) == 12:
pass
elif len(macaddress) == 12 + 5:
sep = macaddress[2]
macaddress = macaddress.replace(sep, '')
else:
raise ValueError('Incorrect MAC address format')
# Pad the synchronization stream.
data = ''.join(['FFFFFFFFFFFF', macaddress * 20])
send_data = ''
# Split up the hex values and pack.
for i in range(0, len(data), 2):
send_data = ''.join([send_data,
struct.pack('B', int(data[i: i + 2], 16))])
# Broadcast it to the LAN.
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
sock.sendto(send_data, ('255.255.255.255', 7))
sock.close()
if __name__ == '__main__':
machines = {
'hera' : '01-23-45-67-89-AB',
'zeus' : 'CD:EF:01:12:45:67',
}
machine = 'scott'
if len(sys.argv) > 1:
machine = sys.argv[1].strip()
wake_on_lan(machines[machine])
