Jonathan Keane
blog
Musings and discoveries while navigating life. Mostly python, perl, sql, R, linux, os x, linguistics, cooking, bread, and food.
About Me
18 July 2011
SqueezeBox Server and playlists with non latin characters
When I first ran into this problem I did find the bug report which included a patch for fixing this problem. I assumed that if it really was as simple as changing two lines of code it would be put into a release shortly enough. After a few releases I got annoyed enough that I decided to see if the patch works. Turns out it does. Why hasn't this been fixed in the release yet?
15 May 2011
XBMC+AirPlay
I just configured my ubuntu based XBMC box to be an airplay recipient using PascalW's Airplayer. Unfortunately, it works with video and picture streaming, but it is easy to setup (just follow the instructions in the package), and just works.
Next step: getting shairport to work. Update: It's simpler than I thought. I now have shairport working, now to daemonize: something like this should work.
Next step: getting shairport to work. Update: It's simpler than I thought. I now have shairport working, now to daemonize: something like this should work.
07 March 2011
Towards a less thought, robust backup solution
As everyone knows, backups are critical. Unfortunately, robust backup solutions often require ongoing thought to be sustained. Apple's TimeMachine revolutionized no thought backups and it's relatively easy to use an existing ubuntu server/desktop system with free space to act as a timecapsule (see the many tutorials on the web). This allows my macbook (or any other mac for that matter) to backup to my server at home whenever I'm on the local network. Unfortunately it's not very robust, there is a single backup in a single location. It's difficult to take snapshots of this backup and copy them elsewhere because it is saved as a sparse disk image. There is simply no way to get a non-OS X system to manipulate these images (hdiutils which mounts sparse disk images isn't released back to the BSD community). TimeMachine: no thought – check; robust – not really.
CrashPlan is a service similar to services like Carbonite. They charge to store your backups on their server, but they will provide you with the infrastructure to backup to local drives, as well as remote computers. The interface is not quite as nice as TimeMachine, but so far it seems to replace most of the functionality. CrashPlan: no thought – check; robust – for money.
CrashPlan is a service similar to services like Carbonite. They charge to store your backups on their server, but they will provide you with the infrastructure to backup to local drives, as well as remote computers. The interface is not quite as nice as TimeMachine, but so far it seems to replace most of the functionality. CrashPlan: no thought – check; robust – for money.
11 December 2010
Using ffmpeg to divide a video into many clips.
Although this seems ludicrously obvious now, a few months ago I was completely unable to come up with a good solution for automatically separating one video into many different clips. After a while I finally stumbled on something suggesting ffmpeg as a solution. And come to find out it's actually relatively easy:
ffmpeg -ss xx.xxx -t xx.xxx -i /foo/bar.in.mpg -sameq /foo/bar.out.mpg
In order to then automate this I wrote a short python script that also used rpy2 to grab data on what times I needed video from out of my data in R. Then I just used something like the following to extract 1.6 seconds around each point of time in the list times that I had grabbed from R
for time in times:
filename = '/foo/bar.in.mpg'
dur = "00:00:01.600"
secs = str(datetime.timedelta(milliseconds=(time-800)))
cmd = ''.join(['ffmpeg -ss ',secs,' -t ',dur,' -i ',filename,' -sameq ','/foo/bar.out.mpg'])
os.system(cmd)
I've seen other places suggest to use the -vcodec copy -acodec copy options, however this made the clip begin not where I had specified after -ss, but rather at the closest key frame. Using -sameq does take longer and is lossy because the clip is reencoded, but it starts the clip exactly where you specify it.
Although I used python and R, this could have been accomplished entirely within R, or with any other data source and scripting language. Something similar can be done to extract still images. The ffmpeg documentation is a great resource.
07 December 2010
Local type with MacTeX 2010 (TeX Live 2010 as well?)
I just upgraded to MacTeX 2010 and had some trouble with previously installed type files in my private tree. Using MacTeX 2009 everything was installed appropriately in my local tree (~/Library/texmf) as well as the privately generated ~/.texlive2009 (cf the TeX Live 2010 documentation). I thought all I would need to do is rename the second directory to ~/.texlive2010, and keep the texmf in the library the same. This, however didn't work.
I took the long way and reinstalled Minion Pro (easy with my script) as well as a few other local fonts. (With a detour through subversion hell: move, recursively delete .svn files, revert to old version, move back, commit) This then generated a new folder: ~/Library/texlive/2010 which seems to be the new home for privately generated files (although this doesn't seem to be documented for either the TeX Live or MacTeX).
On further investigation it seems that the ~/Library/texlive/2010 directory is now where map files as well as local font files go:
kpsewhich pdftex.map returned ~/Library/texlive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map
Almost all of this digging was done very cursorily, but since I didn't see any documentation (other than some for MkIV ConTeXt) I wanted to get this out here. What's not clear is if .texlive2010 has any purpose for MacTeX 2010.
I took the long way and reinstalled Minion Pro (easy with my script) as well as a few other local fonts. (With a detour through subversion hell: move, recursively delete .svn files, revert to old version, move back, commit) This then generated a new folder: ~/Library/texlive/2010 which seems to be the new home for privately generated files (although this doesn't seem to be documented for either the TeX Live or MacTeX).
On further investigation it seems that the ~/Library/texlive/2010 directory is now where map files as well as local font files go:
kpsewhich pdftex.map returned ~/Library/texlive/2010/texmf-var/fonts/map/pdftex/updmap/pdftex.map
Almost all of this digging was done very cursorily, but since I didn't see any documentation (other than some for MkIV ConTeXt) I wanted to get this out here. What's not clear is if .texlive2010 has any purpose for MacTeX 2010.
28 May 2006
Portuguese Sweet Bread
![](http://photos1.blogger.com/blogger/7829/3010/200/Portuguese%20Sweet%20Bread_MG_5633.jpg)
I bought all of the ingredients to make this bread when I made cinnamon buns, but just now got around to making it. It's surprisingly tasty.
19 May 2006
Hmm I wonder.
I stumbled across this aritcle on the register today (and to think i wanted to delete it from my rss feeds). It makes one start askign what if questions.
http://www.theregister.co.uk/2006/05/19/pasemi_apple/
http://www.theregister.co.uk/2006/05/19/pasemi_apple/
Rosemary Pugliese
![](http://photos1.blogger.com/blogger/7829/3010/200/Bread2_MG_5611.jpg)
I think that I've found one of the more perfect breads I've made so far. Last week I had some mashed potatoes leftover from a dinner so I decided to make some tasty potato rosemary bread, having about 10 oz of biga leftover I decided to also make some pugliese. Which gave me the crazy idea: what about rosemary pugliese. I made it for the second time today and I'm just waiting to crack one open and see if it tastes as good as my initial loaf.
Subscribe to:
Posts (Atom)