Using msysgit in Cygwin
Cygwin sucks. Badly. Particularly on Windows 7, where it’s plagued by the infamous rebaseall bug. As if that weren’t enough cygwin’s git port is terribly slow, and so rather frustrating to use.
Luckily, msysgit offers a fast, well-supported, drop-in replacement version of git for Windows, complete with a nice, clean installer, that fits much better into the Windows ecosystem.
But, alas, it’s not without it’s issues, and so here I’m trying to collect what little tidbits I’m learning as I make the transition.
Using Pageant as your ssh-agent
Set the environment variable GIT_SSH to:
"<path to putty>\plink.exe"
And include the quotes! This is related to an issue in git-svn that I’ll mention later.
Merge Tools
You need to grab the entire folder and drop it into
\libexec\git-core if you want any of the mergetools to work. These weren't in my 1.7.7 installed folder, which I suspect is a bug. Later or earlier versions may address this. To use kdiff3 as a mergetool, run:
git config --global mergetool.kdiff3.path <path to kdiff3.exe> git config --global merge.tool kdiff3
Git-SVN Gotchas
There’s a bug in git-svn with mergeinfo that can bite you in any version past 1.6.5.7. To get around it, download the 1.6.5.7 tag from here.
Grab git-svn.perl, and replace your copy of git-svn in:
<program files>\Git\libexec\git-core
But note! This version of git-svn has a bug in it where GIT_SSH has to have quotes around it, lest things go all pear-shaped.
Lingering Issues
If you’re using a cygwin shell (like rxvt), git won’t honour the pager settings, as it can never figure out that it’s running in an interactive terminal. Naturally you can just pipe to your favourite pager by hand, but it’s tricky to get back into that habit.
Mandatory Update
Wow, it’s been a shockingly long time since I’ve posted an update here… seems like I probably should, particularly since I’m now paying for a hosting service to run this damn thing. Might as well actually make it worth my while.
Which brings me to the first major change, largely transparent to anyone strange enough to still be reading this thing, which is that about a month and a half ago, or so, I finally moved my public websites off to Linode. Why Linode? Mainly because, for a modest fee, I get what amounts to a naked Linux box with IPv4 and IPv6 connectivity, upon which I can run basically anything, and so it really just becomes another server in my arsenal, which is rather handy. With it I’m hosting both this blog and my mom’s business website, all more or less highly available, and not victim to the whims of the power company servicing my house.
As a bonus, the upstream on my Linode kicks the ass of the upstream I get at home, so performance should be much quicker for anyone still visiting this place.
Next up, we have another reason why I haven’t posted things here in a while: I’ve got me a Google+ account, and have been moving a lot of my public communications there. Of course, for updates that are directly relevant to my software projects and so forth, I’d rather post them here, so this blog will live on, as rarely updated as it is.
I’ve also been moving more and more of my actual software over to GitHub. The migration is slow, and I’m still struggling to decide which projects I want to move (I’ve got plenty of old Software Projects that I could move, I just can’t decide if it’s worth the trouble), but so far I’ve been damn happy with the results when it comes to NetHackDS, so it makes sense to migrate other projects which make sense (such as the inexplicably popular savsender).
So, there we go, mandatory post complete. Maybe I’ll even author another mandatory post some time in the future. Stay tuned!
User Mode Linux As Cheap App Container
As anyone running Linux knows, one of the biggest challenges for a Linux user involves trying to run new software on an older distribution. Many Linux applications (particularly Gnome and KDE apps) have enormous dependencies, and as applications move forward, they come to depend on newer versions of those dependencies. The result is that, on, say, an older Ubuntu installation, running the latest version of your favorite application likely involves compiling and manually installing a dozen or more dependent libraries. It is, to say the least, a huge pain in the ass.
In my particular case, my primary server is running an older flavour of Ubuntu, hosting my MythTV backend software, Apache, Deluge, Calibre, and a few other applications. And recently I decided I wanted to upgrade a few of these applications… enter dependency hell. It quickly became obvious my plan simply wasn’t feasible.
Now, I could’ve just given up, but I was bored, and I like fiddling around with things, and so the first thing that came to mind was a virtual machine of some description, running the latest version of Debian. The most obvious solution was to install VirtualBox, and I briefly considered it, but vbox is a bit of a pain to manage remotely, and it certainly imposes a bit of a load on the host system. Meanwhile, I knew I only wanted to run Debian on this thing, so a full-blown virtualization solution seemed like overkill. And that’s when I recalled a neat little project called User Mode Linux.
UML is an intriguing project. It takes the Linux kernel, and by compiling it to its own architecture, turns the kernel into a standalone executable program. Hand it a disk image containing a root filesystem, and the thing boots up as a nested Linux instance. Voila! Instant, lightweight virtual machine. But how to get the root filesystem populated? Enter Debootstrap.
Debootstrap is beyond cool. Give it an architecture and a distribution server, and it’ll download and install the base components for a Debian-based operating system right into a directory of your choice. So to build a UML disk image, you just need to:
dd if=/dev/zero of=uml.img bs=1 count=1 seek=10G mkfs.ext3 uml.img mount uml.img /mnt -o loop debootstrap debootstrap --arch i386 sid *mnt http:*/http.us.debian.org/debian/
And voila! The system is populated. Now you just need a few tweaks:
- Edit /etc/passwd and blank out the root password (make sure to reset it later!)
- Modify /etc/udev/links.conf to add the UML block devices (see below).
- Add /dev/ubd0 as the root filesystem in fstab.
- Modify inittab, remove the existing VT definitions, and add one as follows: “c0:1235:respawn:/sbin/getty 38400 tty0 linux”
And then unmount the image and boot up as follows (assuming your linux kernel is in the current directory):
./linux mem=64M ubd0s=uml.img eth0=tuntap,,,ip.of.your.vm
And you should be in your VM! Finally, set up the system locale properly (again, see below), and that’s it, you’re ready to install whatever applications you want to run! At minimum, I’d recommend installing openssh-server. Once set up, you can run the image headless with:
./linux mem=64M ubd0s=uml.img eth0=tuntap,,,ip.of.your.vm con=null &
(Note, there are other options for con… you can hook it up to a pty, making it accessible from screen or similar tools. You can attach it to a Linux VT, or a serial port. You can even make it available over telnet.)
Of course, eventually you might want some swap on the thing. Fortunately, that’s just a matter of creating a new disk image, adding:
ubd1=swap.img
to the kernel command-line, and then doing a mkswap and swapon from the image itself (plus the necessary changes to fstab to add the swap on boot).
This configuration has enormous benefits. First and foremost, it allows you to run select, bleeding edge software without having to modify the host system, which is really very nice. Second, because you end up bootstrapping a minimum system by hand, the guest OS ends up very lightweight, so you can run the VM with a minimum of resources. Third, this setup, being very similar to a BSD jail, allows you to sandbox away software that you’d like to isolate from the core system.
Of course, there are solutions which will provide better performance (KVM, XEN, etc). But UML is very simple and straightforward, and for software that isn’t performance sensitive, provides a very nice option.
udev
Just append these links to /etc/udev/links.conf:
M ubd0 b 98 0 M ubd1 b 98 16 M ubd2 b 98 32 M ubd3 b 98 48 M ubd4 b 98 64 M ubd5 b 98 80 M ubd6 b 98 96 M ubd7 b 98 112
locales
apt-get install locales vi /etc/locale.gen - Uncomment "en_US.UTF-8 UTF-8" locale-gen update-locale LANG="en_US.UTF-8"
Hacking the Playbook - Redux
Well, I know I said I was gonna write some posts on the Playbook as I begin developing for it. Unfortunately, there are a number of things which have deeply turned me off of the prospect…
Incomplete APIs
Yes, I understand the device isn’t ready yet. I understand the simulators are in beta, and the SDKs are being completed. But the startling omissions in the current APIs make me seriously wonder about the device and the BB developers:
- No text box control. There’s a text field, but no multi-line control. So much for a note taking application or anything similar.
- No date picker. Seriously. Wow.
- No localization support. This is supposed to be an enterprise-level device, and it doesn’t have a localization API yet??
- No rotation support. Just… unbelievable. This is a tablet, ffs. How can they not have landscape/portrait mode available? Hell, apparently no one has even seen a sample Blackberry app that does portrait mode.
- No webkit engine API. They’re “working on it”, apparently. The device is supposed to be out in a month. I mean, really…
Meanwhile, the simulator doesn’t support things like:
- The camera API
- The multimedia API (you know, the thing that, to quote, is supposed to “differentiate” this device from others on the market).
It’s really quite stunning to me, and makes me wonder what other omissions there are in the application stack.
App World Application Blackholed
I applied for App World three weeks ago. And nothing. Apparently my application is being “reviewed”. Well, I ain’t spending time writing code if I’m not even sure I’ll be able to submit the thing.
Ridiculous App World Fees
Yes, the current submission fees have been waived, but it’ll be $20 per submission to App World once the promotion is over. That means every failed submission, every update, is gonna cost $20. It’s ridiculous.
Unprofessional Webinars
The webinars BB posted were, frankly, terrible. The BB consultant running them is brutal, the material is superficial at best, his delivery is moronic, repetative, and frankly, boring… they’re just bad. Meanwhile, they’re full of glaring holes, bad examples, and don’t get me started on the marketspeak.
Meanwhile, every other question seems to highlight another gap in the SDK or simulator… the number of times I heard “we’re still working on a story for that” was impressive, to say the least.
In Conclusion
Everything I’ve seen suggests this device is half-baked at best. Incomplete APIs, crappy presentations, an application process that seems to have stalled out on me, and a fee structure that seems designed to turn away smaller developers… for a $500 device, it really doesn’t seem to be worth the aggravation.