cryptosystem.org

Archive for the ‘Coding’ Category

Browser History Searching

with one comment

Britt ran into me today while I was hacking around on a toy program of mine. Basically, I’d gotten fed up with having 5000 Firefox tabs open at once, with no proper way to search through my history or bookmarks, so I decided there needed to be a better way. I started playing with Gecko# and got a bit caught up in getting something half-usable out. Since the last thing the world needs is another web browser, I’ll probably just polish it off some more and put up the source to help out (or possibly confuse!) anyone else who wants to do some Gecko# hacking beyond a 5 minute browser. I did finally discover the old Mac app I was doubtlessly inspired by, TrailBlazer.

Anyway, onto the main reason for abandoning it, my conversation with Britt made me realize that even beyond the silliness of trying to create another browser, I was also reinventing the wheel in numerous other ways. It would probably be much easier to hack the functionality I’m looking for onto Beagle. Guess I’ll need to set up an inotify-enabled kernel.

Speaking of which, I need to do quite a bit of kernel hacking in less than a month anyway, with 3-4 large kernel modification projects ahead of me. Thankfully, due to my inability to read a syllabus, I finished all my projects for another course two weeks ahead of time, so I won’t have that looming over my head.

Written by ryanfb

April 5th, 2005 at 1:50 pm

Posted in Coding, Mono

Colorization Using Optimization

with 4 comments

With everyone talking about the Colorization Using Optimization technology, I thought people without access to MATLAB might enjoy a usable program that employs it.

The MATLAB MCR (installs the shared libraries you need to run compiled MATLAB programs) for Windows is huge, so I made it into a torrent:

Download torrent [83.26MB]
View torrent stats
Torrent Statistics

Windows build:

Download the compiled build here: colorize-win32.zip [1.55MB]

Then:

  1. Download and run the MATLAB R7SP1 MCR Installer from the torrent.
  2. Open up a command window, navigate to where you’ve extracted the executable and CTF file, and run “colorize.exe infile.bmp infile_marked.bmp outfile.bmp”
  3. Wait a while, because this build uses the “exact” solver, it’s rather slow.

If Windows complains that CTF is not a registered file type and it can’t find the proper program, you may need to reboot. You can use the example bitmaps from the source zip linked on the original website if you want to see what input should look like.

Linux build:

Download the compiled build here: colorize-linux.tar.bz2 [3.6MB]

You don’t need the MCR for this build, all the required libraries should be included.

  1. Put /path/to/colorize-linux/sharedobj on your LD_LIBRARY_PATH with export or setenv. (example: export LD_LIBRARY_PATH= /home/blah/colorize-linux/sharedobj:$LD_LIBRARY_PATH)
  2. Run “./colorize infile.bmp infile_marked.bmp outfile.bmp”

Written by ryanfb

March 19th, 2005 at 5:11 am

Posted in Coding

Kernel development with qemu

without comments

I was doing some kernel development, and I was getting a little tired of rebooting my laptop into the new kernel after each build. Having heard about qemu, I decided to give it a go. I found a sample script for building a disk image to boot qemu off of, but it didn’t seem to work. For example, the uuencoded information in that script produces output that makes gunzip complain that it’s invalid. So I decided to roll my own disk image with the following commands:

dd if=/dev/zero of=diskimage.img bs=1M count=512
losetup /dev/loop0 diskimage.img
mke2fs /dev/loop0
mkdir mounted
mount /dev/loop0 mounted
debootstrap sid mounted/ http://ftp.us.debian.org/debian/

You should now have a nice base Debian install to diskimage.img. Clean up your mounts with:

umount mounted
losetup -d /dev/loop0

Then you can launch qemu with a command like:

qemu -hda diskimage.img -kernel /path/to/bzImage -append 
  "root=/dev/hda sb=0x220,5,1,5 
  ide1=noprobe ide2=noprobe ide3=noprobe ide4=noprobe ide5=noprobe"

Ta-da! Once you’re done, make sure you shutdown with “shutdown -h now” before closing out qemu, or you’ll probably have to mount the image to loopback again and e2fsck it manually. You can also mount the image any time you’d like with “mount -o loop diskimage.img mounted” and muck about in the filesystem, or even act like you’re on it locally by using the chroot command after you’ve mounted it. If you get an error like:

Kernel panic: VFS: Unable to mount root fs on unknown-block(0,0)

when you try to boot, make sure you have ext2 support built in to your kernel, also set CONFIG_IDE, CONFIG_BLK_DEV_IDE, and CONFIG_BLK_DEV_IDEDISK to be built in as well.

Written by ryanfb

March 10th, 2005 at 2:16 am

Posted in Coding, Linux