Saturday, August 8, 2009

E-reader on the Mac

You know, when you search "mac+lit" on Google, the top results tell you that you can't read those files unless you convert them. BULLCRAP I say. You just need to get Stanza.

Tuesday, July 7, 2009

Steps

* Chunk by DOC tag
* Strip DOCHDR data
* convert to plaintext

Saturday, July 4, 2009

Compacting VirtualBox image - Ubuntu edition

It is well documented among the VirtualBox community that 'dd' is not enough to zero out a disk image for compacting. The preferred tool to do so is 'zerofree'. Now, the issue is that it requires the disk to be mounted as readonly. This is fine and dandy, except when you only have one partition to work with. My workaround is to use the Ubuntu minimal CD. The steps necessary are:

* Before booting the minimal CD, make sure you've got zerofree installed
'sudo aptitude install zerofree'
* Boot the minimal image.
* Enter recovery mode.
* In the language selection screen, select "Go Back" instead of picking a language.
* Start a new shell.
* Make a mountpoint, e.g.
'mkdir /mnt/r'
* Mount the disk image,
'mount -n -o ro -t ext2 /dev/sda1 /mnt/r'
* Copy zerofree and the necessary libraries to the tmpfs:
'cp /mnt/r/usr/sbin/zerofree /bin/; cp /mnt/r/lib/libext2fs.so.2 /lib/; cp /mnt/r/lib/libcom_err.so.2 /lib/'
* Run zerofree
'zerofree /dev/sda1'
* Profit!

XMonad compositing

Enabling compositing in XMonad is easy.

Setting an image as the background is a little bit more difficult. Normal methods like 'qiv' will not work with compositing. Fortunately there's 'hsetroot'. One donwside though is that it does not let you set an offset for the image. This is annoying when your virtual screen is taller than the image's resolution, as I found out when using it on my dual-display machine. I have yet to find a good solution for that.

Thursday, July 2, 2009

Installing Ubuntu in VirtualBox

These steps are for OSX Leopard as a host, Ubuntu Jaunty (9.04) netinstall.

* Don't use the default network adapter. Use the Intel one instead.
* I set the partition manually to just have one big partition, ext2. No swap partition was set up because a) I have enough memory allocated, b) I can always set up a swapfile, c) having a swap partition increases the disk image file size,
* gksu, make, and linux-headers-generic are required to install guest additions.
* The video driver was giving me problems. Installing the guest additions with xserver-xorg-video-vesa alone did not work for me. I've narrowed it down to either xserver-xorg-video-vmware, xserver-xorg-video-fbdev, linux-headers-virtual, or a combination thereof. Afterwards I've removed all but xserver-xorg-video-fbdev and things are still working.
* localepurge and debfoster are your friends when minimizing the disk image size.

.xsession and XRandR

Note to self: check spelling of lines in the .xsession file.
xrandr --output VGA --mode 1280z1024
is not
xrandr --output VGA --mode 1280x1024

Sixty Symbols

http://www.sixtysymbols.com/

Monday, June 22, 2009

Non-Drowsy Reactine

"Warning: may cause drowsiness".

FUCKING LIARS.

Sunday, June 21, 2009

Jailbreaking to 3.0

If you're going to install a jailbroken 3.0 OS on the iPhone/iPod Touch, remember to first install the vanilla version. If you have the .ipsw for it from another one of your machines, place it in "~/Library/iTunes/iPod Software Updates/".

Once the device has been upgraded to vanilla 3.0, you can upgrade it to the jailbroken 3.0 with redsn0w.

Wednesday, June 17, 2009

Yay for DSLReports

To enable pinging of a ST780 from WAN:

* Telnet into the router.
> :service system ifadd name=PING_RESPONDER group=wan
> saveall
> exit

Tuesday, June 16, 2009

Green Screen

If your HBC backups don't load, change your cIOS38 to rev 13a (not 13b), and use a loader that can apply the 002 error fix, such as USBLoader GX.

Sunday, June 14, 2009

SpeedTouch 780 - Firmware Upgrade

Ok, so Google is completely unhelpful for this. I ended up finding the German SpeedTouch forum, which has a pretty complete list of firmwares.

Lessons learned: SpeedTouch 780WL is NOT SpeedTouch 780 DXT. If you have a firmware that says 7.4.4.7 or similar, DO NOT USE IT. It will not brick your router, but you will have to use the Bootp method to downgrade the firmware to a compatible version, because otherwise it will stay stuck at the factory settings with no chance of letting you log in.

If you did make the mistake of installing the wrong firmware, don't panic! What you will need to do to fix it is the following:
* Get the firmware upgrader (you probably already have it, since you installed the wrong firmware).
* Get the correct firmware! For my router it was ST780_SIP_62T2_bant-r.zip because it has a BANT-R board.
* Unzip it, keep it at a handy location.
Shut off the power to the router. With a pen or toothpick, push down the wee little reset button on the right side of the back panel (near the VoIP ports), keep it pressed, and at the same time turn on the power again. Hold the reset button until the front LEDs change from one red to one green and a flashing orange (some models may have alternating red/green flashing LEDs. Either way, you should be able to notice when the change happend).
* Start the firmware upgrader. It will scan your network for the router. If it doesn't detect it, close the upgrader, and restart it. I had to try several times before it worked for me.
* Select the appropriate firmware. You may have to check a box acknowledging that you are downgrading the firmware before you can hit next. Do the upgrade.
* If it fails, run it again. The process seems to have a tendency to break if you as much as breathe on the router, so 2-3 tries may be necessary. Don't give up too quickly.
* Once it finished upgrading, the router will be set to factory defaults. Go to the setup page, configure everything, and off you go.

Note to self: For future upgrades, the settings are VPI 0.35, PPPoE, user@host / pass.

Saturday, June 13, 2009

Merging IM accounts

I'd been toying with the idea of collecting all my IM accounts and routing them through an always-on server. Something like bitlbee, with an IM client on one end, not IRC. Jabber is *almost* what I want - I can run a server (e.g. Openfire) at home just fine, and it supports all transports. The donwside is, though, than I cannot use multiple transports of the same type on one jabber account, e.g. have two MSN or AIM accounts linked to my jabber login. It will also disconnect me when I close my client. So back to good ok' bitlbee it is, I guess.

Friday, June 12, 2009

Tomcat on OSX

Forget about using macports. It wants to get xercesj 2.9.1, but apache only serves up to 2.9.0. Instead, I followed the instructions listed here.

Thursday, June 11, 2009

Jon Lajoie

I giggled.

Sunburn!

Yesterday I had a beer with N and S. It was a gorgeous day, with enough sunshine that we ended up just lounging outside and basking in the sun. Well, it seemed like a good idea at the time. Now I'm a lobster. At least I was wearing my hat.

Homebrew on the Wii

Since I did not have Zelda: Twilight Princess, and I do not like modchips, I had never gotten around to installing homebrew on my Wii. Last month I got around to do that, however, thanks to the bannerbomb exploit. It did not go too smooth, however. The Homebrew Channel installed fine, but bootmii and DVDx did not, and I could not install any .wad files. It turned out to be due to a missing cIOS. Some sleuthing turned up a package that let me fix that. I also ended up trying a bunch of homebrew apps, and this is the setup I ended up with:

System 4.0u
HBC
Ultimate USB loader 7.1 (based on Waninkoko's 1.5 loader)
Wad manager
Homebrew browser
Mplayer
bootmii as boot2, loading HBC by default

The USB loader is a blessing. I ended up loading all my games onto a USB disk. It's nice not having to get up to swap disks, and it's great for when we're visiting the family, because we only need to pack the usb hard drive instead of 2 dozen dvd boxes.

One problem, though, is that Wiiconnect24 sometimes crashes the games, so I had to turn it off. No big problem there, huh? Well, no, except that with Wiiconnect24 off, turning off the Wii also means turning off power to the USB ports, and thus preventing the wiimotes and the balance board from recharging. Not to mention that I cannot have the usb disk plugged in and charge both peripherals at the same time, because there's only 2 ports. I wonder if a powered USB hub will let me charge the devices.

Cleanign up my Ubuntu package list

After testing it on the Ubuntu Parallels VM, I decided to remove all Gnome-related packages from old cicada. I'm using slim instead of gdm, wpasupplicant instead of network applet, and of course xmonad. The login manager still defaults to 1204x768, but I suspect that's because the laptop screen only supports up to 1280x768, but it tries to maintain the external monitor aspect ratio. In any case, I managed to get both screens to work at the same time. The trick was to toggle it before grub booted, and voilá, 2 screens. I found a new coolness about xmonad, too - the 2nd monitor will display the last workspace seen, AND xmobar will tell me which desktops each screen is displaying. I'd still like to figure out how to automatically set the resolution for both screens on bootup, but for now I'm a happy camper with xrandr. For those with a more mouse-oriented mind, there's arandr.

Oh, and did I mention that wpasupplicant is much more reliable than network applet (not to mention wifi-radar, which sucked so hard it could pull a golfball through a garden hose)?

I found out that xmonad will keep the background that slim uses. That works nicely on my VM where the screen resolution stays the same, but on poor cicada it has a tendency to maintain the image at the old resolution and tile it. Bleh. I figure though that I just need to find a nice image for tiling (which slim also supports), and Bob's your uncle.

Installing FreeBSD on Parallels: Corrections

Use pcm0 for the mouse driver


That should say use psm0.

The 5GB installation size is probably due to fragmentation on the image. Not much I can do about it - Parallels Tools offers disk compression on Windows, but not on FreeBSD. I did save some space by taking a snapshot of the powered-off machine so that Parallels does not have to store the RAM contents.

I got rid of everything Gnome, including `gdm'. I've tried `slim', a shiny and minimalistic alternative. Barfed on me, gave up and decided to stick with startx. I found out though that xorg does not like the .xsession file. Linking .xinitrc to it did the trick though.

Saturday, April 4, 2009

Jailbreaking

Having recently purchased an iPod Touch 2g, I figured I'd go ahead an jailbreak it. Being on a mac, that was a little bit more difficult than normal, particularly since I was running the 2.2 firmware. But following the steps here I managed to get that done all right. Some particular notes:

* The rslite tool didn't recognize my macports copy of libusb - I had to make a symlink for the required file.
* I also found that I did not need to run DFU mode on my macbook running OSX 10.5.6. This was odd, but probably just a side-effect of me running other development tools. I'm not going to count this gift horse's teeth.

One thing I'm still peeved about is the weak antenna on the Touch, it would be nice to have a way to boost its power, particularly when dealing with medium-range networks.

Wednesday, March 11, 2009

Installing FreeBSD on Parallels

To get networking to work, don't use ipv6.

Xorg settings: Use pcm0 for the mouse driver, sysmouse won't work with the trackpad. Use the default keyboard model (not macbook) vesa for the video card driver. Fullscreen mode is 1280x800

xmonad: Works fine, remember to get xmonad-contrib. xmobar works, but won't be able to get cpu/mem/etc info from /proc. Haven't tried dzen2 yet.

I wonder if I can get a smaller image size if I use a different disk partition. ~5GB for a minimalistic install seems a bit much.

Monday, March 9, 2009

VMWare vs Parallels - It's not about the speed

There's plenty of VMWare vs. Parallels comparisons, but none yet that covers the most important thing for me in a virtual machine: How much of a pain in the neck is it to install something that's not Windows, onto a non-default VM? In my case, Parallels wins that one.

Thursday, March 5, 2009

Screen resolution

GDM doesn't like to play nice with /etc/X11/xorg.conf . It insists on using a different resolution, which is annoying when one doesn't want to use the Gnome control center. Enter xrandr:
xrandr --output VGA --mode 1280x1024
Now all I have to figure out is how to re-enable the laptop screen with the external monitor plugged in.

xmonad mystery mending

I had been baffled because on the machines where I had set up xmonad I could not get the alleged exit keystrokes (Mod+shift+Q) to work. Turns out, it was a remnant from when I had experimented with using xmonad instead of Metacity in Gnome. Changing the main method in ~/.xmonad/xmonad.hs from gnomeConfig to defaultConfig fixed that.

Wednesday, February 25, 2009

Memories fom yore

The man who counted was the first book that really got me interested in math. Great reading material for young and adults alike.

Tuesday, February 24, 2009

Safari 4 tweaks

Disable `Google Suggests':
defaults write com.apple.Safari \
DebugSafari4IncludeGoogleSuggest -bool NO
Also, Safari 4 breaks the GrowlMail bundle. Oh well.

Installing Opera from tarball without sudo priviledges

The online documentation in the Opera KB says to use
--prefix= to install everything to .
. That however is not enough I find, as the script won't create the necessary directories. Hobo solution: Check the error log from the install script and create them by hand.

PS: If you use Gnome (or at the very least gnome-terminal), don't forget to change the default browser in gnome-control-center (I tried the gconftool way first, but no dice).

Safari 4: First impressions

The tab bar has been moved to the top of the address bar. While this is space-saving in that it is now merged with the title bar, I see one major inconvenience with it: The `new tab' button is awfully close to the top right screen corner when Safari is maximized, and if you have that corner active it's rather annoying.

They certainly took a page out of the Firefox book with listing the top used sites first when you type into the address bar. I am not so happy, however, that Safari first lists the page title, then the actual address (and that one is grayed out so it's hard to see).

Rendering of new pages seems to work nicely so far. I'll have to fiddle around more to see what breaks and what doesn't.

It seems to be a bit more resource-greedy on startup, but not by a large margin, and I'd have to see how it behaves on the long term to really compare things.

Wednesday, February 18, 2009

Magenta DOES exist

It seems that it is necessary to help with the damage control.

Tuesday, February 3, 2009

Beginner instructions for OpenNLP

  • Build the tools, as per the readme.
  • Download the models and save them to
    [opennlpdir]/opennlp.models/[language]/[modeldir]/[model]
  • Make sure your classpath is set, e.g. before your run the tools, go to your opennlp dir and type
    CLASSPATH=`pwd`/output/opennlp-tools-1.4.3.jar:`pwd`/lib/maxent-2.5.2.jar:`pwd`/opennlp/lib/trove.jar:`pwd`opennlp/lib/jwnl-1.3.3.jar/
  • Now you can continue with the examples in the readme.

Script debugging

fork: Resource temporarily unavailable

Forget the top Google answers. Instead, check that your script doesn't go into an infinite recursion.