Carl the Zealot

February 8, 2009

My super-awesome mutt configuration

Filed under: News — Carl Myers @ 2:05 pm

One of the things I really miss about my old job is we had a default mutt configuration available for folks to use as a starting point which was really awesome. Additionally, we had a custom build of “muttng”, mutt “next generation”, a now long-dead fork of mutt which contains lots of super-hot extra features. I decided it was time to make my mutt “whole again”, so what follows are the steps for getting an awesome mutt configuration on Debian Linux.

So first off, I thought I would have to apply all these crazy patches and things, and build my own mutt package. Gladly, this is not the case. Most of the muttng patches have now been applied to the original mutt source. Also, to my joyful surprise, most (if not all) of the patches that weren’t merged in are available in Debian by installing the “mutt-patched” in addition to (or instead of) “mutt”. This includes the much-loved “sidebar patch”, among others.

After I got that figured out, I got to just muck with my .muttrc file. The docs I referenced are available here and the wiki is here. Now for your configuring pleasure, here is an “anonymized” version of my configuration, I hope it has some helpful ideas for you seasoned mutt users out there.

February 7, 2009

Using the iPhone G3 to listen to music under Debian Linux

Filed under: News — Carl Myers @ 2:36 am

Greetings all, I have once again found myself wishing someone else had written up this mini-hell I had to go through just to use my shiny new toy the way I want to, so once again I have written it up for posterity. I did use a mac to jailbreak my iPhone G3, but everything else I detail here I was able to do using my home wifi network, and my Debian desktop. Please enjoy, and feel free to email me if you have any questions or comments!

Now because there is a lot of out-of-date and incorrect info out there, and it was a major point of contention for me, let me just throw some stats out there: This is an 16 GB iPhone G3 (black) running firmware 2.2 (5G77) on the AT&T 2.9 network. The exact model is MB704LL. I am running Debian unstable and updated today, February 7th. I used gtkpod 0.99.12-3 and libgpod-common 0.7.0-0.1, and gnupod-tools 0.99.7-2. My kernel version (which shouldn’t matter much) is 2.6.26 (custom built from Debian patched kernel source), arch is x86_64.

Step One: It’s a Jail Break!

This is the only step in the process where I wimped out. I tried to find a Linux jailbreak solution, but most of them involved downloading some strange source code from “some dude” (not sourceforge) and building and running it, so instead I went ahead and fetched QuickPwn. It worked great. Another mac option (which appears to support some more advanced options like modifying the image you are going to upload) is Pwnage Tool. I followed the easy directions there and like a charm, my iPhone now has a pineapple shown on startup, and I was able to run Cydia (an iPhone GUI frontend to APT, my favorite package manager!) and install openSSH, perl, and all sorts of other goodies.

NOTE: do *not* try to move your home directoy. Don’t be fooled, my friends, it looks like BSD, smells like BSD, has a broken “ps” which doesn’t work with my favorite flags “-auxwwwfg” like BSD….but it is NOT BSD, it is “crazy apple OS land”. “chsh -s” does not work to change your shell, but you CAN do it by editing /etc/passwd AND /etc/master.password (the shadow file). You CANNOT edit these files to change the mobile user’s home directory, it is hardcoded out the wazoo in all of the apps. It should already be on the largest partition on the device, and if it isn’t, feel free to move it and create a symlink, but do NOT try to actually change the home directory via other methods. While we are at it, make sure your “local” directory where all the apt stuff goes is on the big partition – I think mine went there by default but I don’t remember – I think it goes to /private/var/local (and /var is symlinked to /private/var). Wow, that was a long rant…

Step 1.5: Installing Perl on an iPhone

I wanted to write some perl scripts to do some nifty tasks – one example is, I wanted to run a script like “xkcd.pl 534″ and it would use LWP::UserAgent to fetch that comic from xkcd.com and grep for the alt text, and print it out, since it isn’t possible to see it from mobile Safari. Unfortunately, perl was not in the default repository, but fortunately, I found one that had it. Super huge kudos to the fellow at Coredev for sharing his work – I was not too excited about the idea of trying to build perl myself, on my iPhone.

Step 2: Mount your iPhone

Immediately after jailbreaking your iPhone, you should change the “root” and “mobile” user passwords. I believe the default root password is “alpine”, at least it was on my version.

You probably want to set your iPhone to take a static IP address on your network so you can SSH to it. Some routers let you do this via the wireless router’s GUI, others you just manually pick one and tell the iPhone “use this static address”. I assume a user reading this can figure this part out, or google it, this part of the process was not hard to find guides for.

Once you can ssh into your iPhone, we are ready to set up “sshfs”. Have you ever asked yourself “geez, what *can’t* you do with SSH?” Well, the answer isn’t “mount a remote filesystem”, I can tell you that much. Run the following:

# apt-get install sshfs

SSHFS runs in the userspace, which means you don’t need to use sudo to mount things over SSH. This is good. It does mean, however, that some setup is required. You must add your user to the “fuse” group:

# adduser cmyers fuse

Obviously, substitute your username for “cmyers”. Now here is the tricky part – you must must must log out and back in for this to take effect. you cannot use the same terminal to continue. If you did this in a screen session, in fact, your whole damned screen session, and any windows you subsequently create, will still be using the out of date group list. Use your window manager to start a completely fresh terminal window for this – or hell, even switch to a virtual terminal and log in fresh (Ctrl + Alt + F[1-6]). If you get an error like this:

$ sshfs mobile@10.0.1.150:/var/mobile /media/iphone
mobile@10.0.1.150's password:
fuse: failed to open /dev/fuse: Permission denied

Then that means you failed to get a “sufficiently new” terminal. Also, pop this and make sure it looks right:

$ ls -lsa /dev/fuse
0 crw-rw---- 1 root fuse 10, 229 2009-01-31 09:52 /dev/fuse
$

Note that the “fuse” group has both read and write permissions to /dev/fuse.

Ok, assuming you heeded the bolded advice above (the amount of explanation in my blog is directly proportional to how much time I wasted figuring out that part – so be thankful you don’t have to muck with it!), you should now be ready to mount your iPhone.

The way most iPhone apps in Linux expect your mount to work, you actually mount “/var/mobile/Media” – which is where the iTunes DB and music goes, rather than mounting the home directory itsself (/var/mobile). To do this, run:

$ sudo mkdir /media/iphone
$ sudo chown cmyers:cmyers /media/iphone
$ sshfs mobile@10.0.1.150:/var/mobile/Media /media/iphone

Obviously, replace the IP address, and “cmyers”, with the appropriate equiavlents. Note also that the actual sshfs command runs as you – after that initial setup, you can mount and unmount the iphone without sudo – joy and hoorah!

Step 3: Teach your iPhone who’s the boss – it ain’t Apple.

It turns out that in the 2.2 update (or maybe 2.1?) Apple decided to change the iTunes DB format quite a bit, including checksumming and crap that is part of the (un)”FairPlay” DRM crap. If you are curious about the details, this is all explained here: Marcan’s Blog. Long story short, you need to tell your iPhone “please, sir, use the old version of the DB”.

Yes, that’s right. Apple added all these extra, super-annoying, redonkulous security measures, but let the configuration option to control whether they are enforced or not in plain-text XML on the device. Apparently, they don’t want to actually stop people from using their jailbroken iPhones with third party apps that can read and write the iTunes DB, just piss them off as much as possible in the process. As the blog explains, simply open the file:

vim /System/Library/Lockdown/Checkpoint.xml

Erm, you did install vim on your iphone, right? I feel sick if I ever use a *nix system which doesn’t have vim on it =) Anyways, edit that file, search for “DBVersion”, and change the value on the line below it to “2″ (instead of, probably, “4″). Now reboot your phone. ( I had a sadface @ rebooting a *nix machine )

Step 4: Exercise super cow powers!

You can fetch down everything you need (I think I got ‘em all…) by running this on your Debian box:

# apt-get install gtkpod gtkpod-aac gnupod-tools

Next go ahead and start up gtkpod. You will have to go to “repository options”, and “add new repository/iPod”. Trust me, you want to get “Music Library” all set up the way you like, THEN copy it to your ipod. Editing directly on the iPod is bad times, I lost some playlists that way. Put in the mount you used (I used “/media/iphone”), and for Model select Touch -> “16GB Touch (black) (xA627)”. Turns out the iTouch and the iPhone 3G are almost identical.

At this point, go ahead and hit “check ipod files”, or try to drag over a playlist or something, and hit “save”. You should see it copy to the iPhone, then say something like “updating DB”. If this works, you are golden, but I think most people will still have one more problem to overcome.

Step 5: Getting the “Firewire Id” (wtf, Apple, it doesn’t have a firewire port!!!)

Apparently, the newer hardware (or firmware, or something) needs some sort of hardware ID to write the DB in a way the iPhone can recognize. Without this step, you may get an error popup along the lines of “Couldn’t find the iPod firewire ID” from gtkpod when it tries to write the iTunes DB, or your iPhone may simply report it has no music on it, when it clearly does according to the storage usage info. To fix this, you follow the info on this wik, under the “determining the Firewire GUID” section. Basically, you must connect your iPhone USING USB, but you don’t have to mount it (because that won’t work), then do the following:

# lsusb -v | less

Note this should be run as root. Search for “iSerial”, and find the one that belongs to the “Apple” device (you don’t have more than one Apple device, do ya?). Record ONLY THE FIRST 16 CHARACTERS of this string, it should look like hex (0 through 9, a through f). Next, edit the “Sysinfo” file (or create it, if it doesn’t exist). Now I have seen different guides claim this file exists at two different paths. One was “/var/mobile/Media/iTunes_Control/Device”, and another was “/var/mobile/Media/iPod_Control/Device”. Chances are, one of these directories will already exist and the other one won’t, so use that. For me, it was “/var/mobile/Media/iTunes_Control/Device”.

$ vim /var/mobile/Media/iTunes_Control/Device/SysInfo

Now add the following to it:

FirewireGuid: 0xFFFFFFFFFFFFFFFF

Where the 16 Fs are replaced with your GUID (doubt it matters, but mine had lowercase alphas in it). Some restarting of various programs (force-quit the ipod app on your device, close out gtkpod and reload it), and you should be able to transfer playlists now. Works like a charm for me.

See, wasn’t that easy? =|

Props

I couldn’t have done this without the generous assistance of the “teuf” on irc.freenode.net#gtkpod, All of the libgpod devs, all the folks that contributed to the jailbreaking efforts, and many helpful forum posts on the Ubuntu forums, about both gtkpod and sshfs.

What do you tell your kids when they ask “what happens when you die?”

Filed under: Free Thought, Me, comic — Carl Myers @ 1:19 am

I wrote this post a long time ago, but forgot to publish it. Better late than never, huh?

This is a topic I have spent an extra long time thinking about, one which was recently brought up by Jeph Jacques in his strip Questionable Content (which I enjoy very much). Jeph posed the question in this strip:

…I wouldn’t want to make up a bunch of stuff about an afterlife or use some religion’s version of things, since I don’t believe in that myself, but I also wouldn’t want to completely horrify my kid by being all “oh there is just nothing. You cease to be aware and that is it.” I know that concept freaked me out nearly as bad as the concept of hell when I was little. I guess “make up something comforting” is the lesser of the two evils, but still…

Atheist/nonreligious parents, what do you tell YOUR kids? I am curious to know!

I am not a parent, and I’m not sure if I will ever be one, but I have spent an awful lot of time thinking about this very question. I am a big believer in Douglas Hofstadter’s take on intelligence and sentience as presented in Godel, Escher, Bach and I am a Strange Loop

Specifically, intelligence and sentience and everything about us that makes us who we are – the “spark” that so many people attribute to souls, lives exclusively in our brains, and in the physical world. It requires no metaphysical explanation. He goes on to suggest that if that is true, there is no reason why parts of us couldn’t live in *other* people’s brains also. He talks about the bond developed by close family, especially husband and wife, how they finish each other’s sentences, know each other “better than they know themselves”, and when the worst happens, often remark “it is like I lost a part of myself”.

The point I am finally about to reach is, if sentience is just a “strange loop”, a complicated feedback system in our brains which causes us to feel and experience life as we do, anyone we make contact with over the course of our lives carries with them a “granular copy” of that pattern. The more time we spend with them, the more detailed the copy. When I die, I will live on not just in the memories, but in the active mind of those I cared about, and who cared about me. That is something I could tell my children without being disingenuous or depressing.

I discuss this from the perspective of love and relationships in a recent blog.

January 29, 2009

Why this is a bad time for a software design job hunt, and how to overcome it

Filed under: News — Tags: , , — Carl Myers @ 4:11 am

So recently people have been saying “this is such a bad time to be looking for a job” all the time – and I agree with them. In the software design biz, however, I think it is not for the reason most people assume.

As someone who was recently responsible for interviewing people and participating in making hiring decisions, I can say that in my experience, the problem is not only a lack of jobs. Sure, many companies are scaling back hiring a little, and scrutinizing new hires more closely to ensure they are of the highest quality, but that is just a effect, not a cause.

The cause of this, that job seekers should realize, is many of the job seekers out there are seeking a job because they were “the first to go”. Nobody is going to lay off a highly valuable employee right now (I would hope!). Rather, people who were on shaky ground to begin with are the people now looking for work, and there is a real deluge of them to sort through.

Thus, to get hired in this environment, when the hiring managers and interviewers know most of the candidates out there are in this position, you have to prove you aren’t one of the “bad apples”. How does one do that? There are a couple ways. Mostly, it is a lack of warning signs, but there are also lots of affirmative traits as well.

First off, your resume should have certain attributes. Be specific, don’t just throw out an alphabet buzz-word soup, but put everything down that is relevant. It isn’t necessary to list HTML or “Microsoft Excel” or “Internet Explorer”, or for that matter, even something like “AJAX” unless you are a super rocket scientist at it or something. What programmer can’t figure out how to use Microsoft Excel? Everything that is listed on your resume, you should be able to answer the question “Why is X relevant?” with an interesting, well-thought-out answer that includes a specific example of your experience with that item.

Another important thing about your resume is it should include that experience. You don’t want your resume too long, but as much as will fit, you want a specific project or example of each of the types of experience you have. If you put down C++, you had better list a project where you used C++ and are able to talk about what it involved, and how you were instrumental in its success.

A resume lacking in experience, or dripping with buzz words and alphabet soup, sends up a huge warning flag. Beyond the resume, however, there are lots of other warning flags recruiters look for. For example, any programming job is going to expect you to answer some questions, write some code, or somehow demonstrate your skill set. Do not shrink away from this. Always think carefully about your answer, but try to think out loud as well so they can see your thought process. If you don’t know, admit you don’t know, then try to “get partial credit” by working through it anyways, or taking a different approach. Don’t be a defeatist, don’t give up, and don’t demonstrate you are not confident in your abilities. If you really are so under-confident that you can’t at least act confident, you aren’t right for the role anyways.

Also, be thorough. Ask for more details when appropriate. The difference between a “strong coder” and a “rock star” is largely in the details. Instead of making certain assumptions, question them – or better yet, say “I am making this assumption, but if I didn’t, it would have the following effect on the answer”. Discuss alternatives and why you make the decisions you make. Remember, coding isn’t about knowing everything, it’s about knowing what you need to learn and apply the tools necessary to get the job done, quickly.

Finally, if they ask, and possibly even if they don’t ask, don’t be afraid to talk about why you left your other job (that is, assuming you aren’t one of the “bad apples” I previously mentioned). Talk about the success you had at that job, and why you decided to move on. If the only thing you can say is “I hated it there” or “they weren’t happy with my performance”, that’s going to send up a big red flag, and I often asked that question for that very reason. Examples of really excellent answers I have gotten include “I wanted to have a larger impact”, “I wanted a change of pace but there was nowhere else to go at that company”, “I didn’t like the direction the company was going in”, or even “I didn’t feel my growth was recognized” (which is a nice way to say “I didn’t feel my compensation was fair given my experience”).

« Newer Posts

Powered by WordPress