I was looking for a way to play my music collection (which is primarily ogg and flac) from anywhere, preferably with some sort of automatic transcoding feature. In the past I’ve just mounted my music collection via sshfs (more about that here) and then played music with some heavyweight app like Amarok. This is fine, but flac files are too large to be streamed realistically.
So – along came Ampache – an open-source PHP app that is just CHOCK full of features. Just crazy. It’s got a responsive AJAX interface, creates many different types of playlists, can transcode on the fly to other formats / bitrates and was fairly easy to install. It’s just awesome, and pretty much any music player can read an Ampache stream.
THEN I discovered Ampache Mobile (google code page) - a FOSS Palm Pre app that hooks into your Ampache instance via XML-RPC. Amazing! I get flac/ogg files transcoded to 96kbps MP3 streams on-the-fly, allowing me to listen to all my music anywhere I have a Sprint network connection. The app is beautiful, functional, and has made my Pre even more indispensible than it was before.
If you’ve got a Pre and a home server with even moderate upload speed, GET THIS WORKING. Now.
Edit: Corrected Ampache Mobile link. Thanks, bjgeiser!
fuse over ssh rocks, as we all know. It allows you to mount remote filesystems anywhere you reach with SCP or SSH. But wait – there’s more!
Run commands on the filesystems of hosts you don’t control
I needed to use rsync on a host I don’t control (godaddy, in this case). So I used fuse to remotely mount the godaddy filesystem and then used rsync to do a local copy.
sshfs -C godaddyuser at godaddyhostname.org:/var/... ~/godaddy/ rsync -auvz --delete-excluded ~/godaddy/ ~/godaddy-copy/
I also created a git repo on that remote godaddy fuse mount – I feel naked without source control.
cd ~/godaddy/ && git init
just like working directly on the machine – except slower because of the network overhead.
I’ve been using google chromium more and more for work because it’s so FREAKING fast compared to Firefox. . . if it had Adblock Plus and firebug I’d probably abandon firefox altogether. . . So for work-related sites, chromium is a clear winner because it lets me work faster. For personal browsing, I find the web almost intolerable without adblock plus – so firefox wins there.
Anyway: a really nice benefit of Chromium’s incognito browsing is that it has a separate set of cookies than your main Chromium window (of course, that’s the point) – allowing you to log in to the same site twice with different credentials. This is handy when you’re developing a site that does different things depending on who you are. It appears that all incognito windows share the same cookies, though, so you can’t log into the same site as three different users in three different incognito windows (at least not that I’ve found, yet).
One can probably do similar things in firefox via profiles or an extension or two. I like that it’s built-in and easily accessible in Chromium, though.
“Why I use the GPL” by Zed Shaw
An interesting read that I think is spot-on.
I don’t see any statement that clearly says “this rant is mainly because I chose the wrong license for Mongrel”, but beyond that his points about the GPL fostering contributions is 100% correct.
I dunno. I tend to choose the “default license” of the language / framework I’m building in: maybe I’ll need to rethink that.
Oh, ssh. How I love thee.
So I wanted to log in to wordpress blog with a login page NOT behind an HTTPS connection from an “insecure” network – in this case, it was the MBTA’s commuter rail wifi.
SSH supports SOCKS proxy connections and makes this STUPIDLY simple:
ssh -C -D 8000 name-of-your-proxy-ssh-server.com
“-C” turns on compression, “-D 8000″ makes the SOCKS proxy connection on localhost’s port 8000.
Then you need to set your local firefox to use “localhost”, port 8000 as a SOCKS proxy. And bang! You’re proxying securely over an insecure network.
Yeah, yeah, the best solution would be to have the target wordpress use SSL, but not every blog can have a dedicated IP.
Say you’d like to find out the IP addresses of lines in your apache access.log (or any log file with a similar format, really) that contain “Googlebot”:
grep 'Googlebot' access.log | cut -d' ' -f1 | sort | uniq
which finds the lines via grep, uses cut to extract the first field (space delimited), sorts the IP addresses and then uniqifies them.
Dirt simple, stupidly powerful.
No sir, I don’t like it. Not at all.
The default mod_passenger “this app wouldn’t start” page includes an external CSS file:
http://www.modrails.com/error_pages/1.0/…
which is odd, considering there’s a bunch of inline CSS. I guess it’s to include the images. . . but it also amounts to disclosing something unintentionally. Yuck.
I made an interesting discovery the other day between how “count” and “length” function with an ActiveRecord model, one that can be exploited effectively to speed up an app, as long as you understand the consequences.
- Invoking “count” on an array (or dependent relationship) will always hit the database, and do something similar to select count(id) as count_all from contacts every time you invoke it.
- Invoking “length” on an array (or dependent relationship) will only hit the database once. If the relationship has already been populated (say by :include-ing the dependent objects in your Model.find method), the database won’t get hit at all.
So – if you’re OK not getting a count that’s 100% accurate at the time of method invocation, “length” will do the right thing and run the necessary SQL statement the first time it’s run. Otherwise, it’ll give you the array count, which may be out of sync with the database.
This can have significant performance benefits if you’re iterating through many records and emitting counts of dependent objects. :include-ing the dependent objects and using “length” decreased the SQL expense of a page view 40 fold in one case.
Once again, it’s good to know your tools.
