XMC now on github

November 29th, 2009

In an effort to get all my projects out in to the wild, I’ve pushed the XMC project out to github to mirror CSH’s local git repository server.

For those of you who don’t know what XMC is: Xen Management Console. About a year ago I began setting up a Xen “cluster” for CSH to use. With about 10 physical machines we needed a way to manage Xen and the VMs on them. We set up the hardware to be as dumb as possible by having them all PXE boot a nicely modified version of Gentoo that myself and Dan W. put together. These machines keep no state and have read-only root filesystems. Storage is on another system and shared via AoE (ATA over Ethernet) and a custom python server I wrote to manage the A0E exports. DNS/DHCP and are handled by another machine which is CSH’s central DNS/DHCP system as not to replicate services.

XMC allows for some fun things like drag and drop live migrations, basic load balancing when booting new VMs, and basic access permissions to allow users to boot/reboot/shutdown their own VMs.

The project was my first large scale working with Xen and python, so the code isn’t the prettiest you’ve ever seen. I hacked a lot of thing to “just work” and never had time to clean most of it up. Since I was concerned with making it work quickly I wrote some of the worst Javascript I have in a long time. I did use my jscore library, though, so that makes me a little happier.

At the moment the project is pretty dead and barely running due to hardware failures this past summer. Also, since I’ve moved on from school there seems to be some enterprising new CSH members who want to replace the system (hardware and all). Because of this I figure this project is probably dead, but maybe it’ll come in handy to someone, somewhere.

XMC on github

MailWrangler Source Code on github

November 12th, 2009

I’ve received a number of requests for the source code of MailWrangler over the past year. Recently I finally spent the time to prepare and post it to github. Sadly I was unable to actually import it from SVN due to the repository being corrupted and not having a complete backup. I simply imported my most recent checkout of the code in to git, and pushed that. Not my first choice, but it works.

I’ve licensed MailWrangler under the Apache 2.0 License. It’s a little more restrictive of a license than my other projects, but it is also much more “popular” of a project than my others. I have no idea if anyone will really care — but hey, maybe someone will. I don’t have much intention to personally do much with the project going forward (a big part of me just letting it out in to the wild). I’m more than willing to accept patches and merge forks back in to the project and keep the code on github up to date from others. I suppose it could be a decent alternative gmail “client” for those of us with developer licenses.

The thing to note about the current state of the code is that it doesn’t really work. I wrote it for the first SDK released by Apple and never updated it. An update at some point broke some parts of it, namely being able to add an account. If anyone fixes it I’ll be glad to patch up my copy of it for others.

Enjoy.

http://github.com/adinardi/mailwrangler

A DHCP Server in PHP, why not?

September 9th, 2009

Over this past long Labor Day weekend I decided to attempt something just plain silly: write a DHCP server in PHP. You may be asking yourself what would ever make me think doing such a thing in PHP would be a good idea? I’ll tell you: why not? Also, when it comes to languages which run on a server — well PHP is the best I’ve got. I know enough Python, C/C++, Ruby, Java, Obj-C, blah, blah to be dangerous — but PHP and Javascript are my tried and true loves. So I figured why not. And then the question of why a DHCP server? There was an idea on Computer Science House last year to do a project to write a DHCP server which better fits the way we want to use our network (and the project never really went anywhere). I wanted to see if in a weekend I could do more then they did in weeks / months.

The objective for the weekend was to get a server which could accept, decode, process and respond to DHCP requests on the network. My first goal wasn’t to build a robust server — really it was to learn something new and see if it could be reasonably done. After pretty much two days of solid work (Saturday and Sunday) I had a working server. It assigns the same IP to every machine that requests an IP — but I was able to get a PHP program to handle sockets and UDP packet parsing to read and write DHCP packets correctly. That was arguably the hard part. The rest is just standard application logic.

The code is available on GitHub here: http://github.com/adinardi/phpdhcp.

What’s the plan for the future? I’m thinking of at least wrapping up the packet parsing class and have that available as a library for people to use. I don’t think it’s worth my time to finish the rest of the server. Being that I’ve already graduated and this is a critical service — there’s a good chance I won’t have the time to support it when they need it. As such it probably isn’t the best idea to actually put it in to production use there. Of course, if there are people interested in seeing this project completed — by all means let me know. I had planned on making the DHCP server part have a plug in system of changing the storage system backing the server so that it could run off a database and do things that the normal ISC DHCP server can’t be configured to do. When there’s no strict config (just an API that calls your storage system and asks for the info for some MAC address)  you can make your system return whatever IP / config that makes sense for you.

CSH was interested in a system where you could have statically and dynamically assigned IPs in the same pool. We’re running out of IPs so if we can have static assignments and dynamic mixed you can conserve space by not having to segment the network arbitrarily.

I think I need to get back to doing crazy things with javascript. Did you know there’s an implementation of the javascript runtime in javascript? Yeah.

Development on a Mac: Textmate + bundles

July 30th, 2009

With the start of my new job I finally got a Mac to use at work. I’ve been using one at home for going on two years, so it’s nice to finally use an OS I like at work. With this comes the need to use a good editor for development.

At home I’ve used an array of IDEs and editors, never finding one I’ve really liked besides the old standard of VIM. I’ve used VIM for much of my development for years, so I’m pretty proficient. At the same time, it just doesn’t fit in well with OS X. I’ve used Textmate a bit before, but never really for long or on a large project. That was about to change.

Most of the developers at the company use Eclipse. I personally find it slow and buggy — and so do some of the other developers. I decided to download Textmate and give it a good, solid roll. I quickly got up to speed on the shortcuts and was able to get things done without cursing at my editor constantly. There were, though, shortcomings from the setup the other developers had come up with over time for Eclipse. Myself and another new developer put together a nice array of additional bundles to Textmate which made it complete for us to get our work done, at Mac speed.

  • Synchronize remote directory [rsync+ssh]
    • Forget trying to keep track of files you’ve edited to upload or using a separate sftp app for your project. This bundle allows you to set up a remote location to push files changes and full project synchronization to. It uses rsync and ssh so you’re looking at needing a remote unix machine with both set up and functional. Also, it uses SSH keys since I don’t believe it has a way to request a ssh password.
  • TM-Ctags (I’ve forked a fork and upgraded it a bit)
    • This will enable you to search for class, function, and other definitions in your project. When you update from source control or add code you need to update the index. Once that’s done you can search based on current text under the cursor, arbitrary search, or even code completion based on the indexed code.
  • Ack in Project
    • The built in find in project in Textmate is slow. This bundle uses ack to search much faster and also display results in a more reasonable fashion. It’s not perfect, but it is an improvement. I have some thoughts on upgrades I might make in the coming weeks.

That’s the short list for the moment. We’re finding new bundles to add all the time to make things better. Also, we’ve got a list of features we’d like to have and I’m doing what I can do find / upgrade / create bundles and plugins which fit our needs. Over time I’ll update this list with new additions.

My Trip to CA Visualized

June 11th, 2009

So last week I made the journey from Pittsburgh, PA to Foster City, CA via car. I’ve made this drive two other times, though the destinations were Mountain View and Sunnyvale. This time I ran the Instamapper GPS tracking app on my iPhone most of the way. This yielded 3,642 data points along the way with longitude, latitude, speed, heading, altitude, and a time stamp.

The guy who rode with me, Scott, decided it would be fun to try and visualize this data with Google Street View to “watch” the trip without us ever having to actually record it. After a couple of days of processing, downloading, and building the end result was this video he posted to YouTube: http://www.youtube.com/watch?v=b2d-VAAyB9c.

Coming soon: pretty graphs of the data. Need to have day where I can actually sit down and work it out. There’s way too much involved in moving. Way too much. Like a day spent in the DMV (but hey, I’m a CA resident now!).

Another GitHub project: CSH’s Drink Machine code

April 18th, 2009

So the ecosystem is now complete. Until now we had CSH’s Drink code partially online. I’ve corrected this by moving from SVN to GitHub what I believe is the last bit of Drink’s code, the Java software running on the TINI boards in the machines themselves. For reference here’s all the GitHub projects:

TINI Hardware Code: http://github.com/adinardi/csh-drink-tini
Drink Server:  http://github.com/danw/drink
Touchscreens: http://github.com/adinardi/csh-drink-touchscreens
Old Javascript Touchscreens: http://github.com/adinardi/csh-js-touchscreen

I think that covers it. The TINI code and the Touchscreens are licensed MIT, and the server is GPL at the moment due to libraries being used. Documentation is kinda light, which will possibly change as I get time once classes end. Someone needs to make sure someone else can maintain this stuff once we’re gone, right?

Chances are better it’ll just get replaced. That TINI code is the oldest stuff here, dating back to 2005. We’ve replaced everything else since then. The server has been written twice since then. Yeah, CSHers get bored.

MailWrangler inquiries and update

March 9th, 2009

So lately I’ve been getting contacted a lot about MailWrangler. I have no idea why all of a sudden there’s renewed interest from users and journalists. I haven’t had time to respond to most people, sadly, but I’ll address some things here for everyone.

First off, chances are good I’ll never release MailWrangler. Originally the app was supposed to be my little entrance into iPhone development. I needed something simple to get acquainted with design, development, and distribution of iPhone apps. It was basically my “Hello, World” app. Of course, as the story goes, Apple rejected my app after taking way too long to review. By this point I’m already getting ready to head back to school where my time was only going to get harder to put into an app.

I’m not really mad at Apple, nor do I want to really make this a big deal. Its their App Store and they can make any rules they want. We knew the iPhone was a pretty closed system when we bought them and developers knew the App Store was going to be a pretty controlled place. We can’t say we didn’t see this coming; it’s Apple.

So where does that leave me? I don’t have much motivation to update MailWrangler to the latest SDK version (right now it compiles but won’t run… something changed) so I can’t even resubmit it. The app was just a little thing I threw together in a weekend, nothing big or special. Although I think it would be useful to have, even I don’t need it more than once every so often — the built-in mail app works well enough for my needs. Also, because of my issues with the App Store, it’s hard to put in effort on something that could just be rejected again. There’s plenty of stories out there and more all the time of people continuing to be rejected or ignored by Apple’s review process. It just isn’t worth my time to keep dealing with it.

Short story? I probably won’t be getting around to doing anything with MailWrangler again for a while. While I bet there’s a good chance I could get it approved eventually, it just isn’t worth my time right now (I’d rather spend it finishing out school so I can graduate in May, and enjoying those last months of college). And although I could release it via Cydia or other similar system — there’s a significantly smaller audience and I would still need to update the app to even work. Then there’s support and maintenance. Again, for me right now it isn’t worth it.

I think I’ll stick to web applications.

GitHub, JSCore & Touchscreens

January 22nd, 2009

So a couple of weeks ago I decided to finally get some of my code out to the world. I’ve recently gotten pretty excited about using git for version control. Of course, GitHub is *awesome* so I posted my code there. You can take a look at: github.com/adinardi.

Two of my projects are available under the MIT license. First is the javascript library I’ve been working on for a while. It’s pretty basic, but includes all the good stuff like event handling, async requests, basic table generation & management, and a js bootstrapper. I plan on doing work on it here and there. The conventions I use in it are a bit of a mix of things I’ve done in the past and on first look can be pretty strange. I’d like to do an article on it at some point and why I did what I did with it.

The other project is the previous incarnation of the CSH touchscreen software. We were running opera 8 on some old touchscreens and this javascript was running on them. It’s not really useful to anyone except in an academic sense. I wrote most of it in about two nights or so in the Spring of 2008. I’d like to think it has a *decent* design and implementation. It isn’t some of my best work, but definitely ranks up there. It uses the JSCore library.

Now I just need to go back through more of my code I have around and get some more out there. I’ve worked on a lot of things — little of which most people can see. That’s what happens when you do a lot of work for companies — most people will never see it, and I’ll never see it again. *sigh*

Oh Solaris!

January 20th, 2009

So since we CSH sys admins are getting rid of old stuff we’ve got laying around (anyone want a Sun E3000 server?) I grabbed one of the Sun Netra T1 150’s we had. It’s a nice little machine (1U of solid metal) with a 440Mhz UltraSPARC-IIi processor and 1 Gig of RAM. So I figured what the hell, let’s install Solaris on this thing, it is a SPARC!

Now you have to understand, this thing only had the following connections to the world:

  • 2x Serial Console ports
  • 2x Ethernet (10/100)
  • External SCSI
  • 120v Power
  • 2x SCSI hard drives

Yeah. Makes it a little hard to get anything installed. I ended up first trying to do a network install of Solaris 10 from a Ubuntu linux machine I have. An evening of failure later and I still can’t get the Netra to net boot. I had done this before, by the way. I set up a “Jumpstart” server for CSH before to install these Netras years ago when we got them. It was running Solaris 10 since Solaris has nice tools for setting up a net install server. 

I said to myself, “Self, why the hell don’t you just use a Solaris machine to install this other solaris machine!?” Realize though, CSH has gotten rid of most of it’s Solaris machines — since it’s arcane and a general pain to administer compared to Linux or even FreeBSD. So I picked Tonka, the CSH web server, to give this a quick test from. I ran the server setup script and in about 10 minutes I had my netra net installing from it. It was late and the version of Solaris that the disk image on Tonka was of was a few years old so I decided to kill it and try again the next day with a newer image.

So today I said to myself, “Self, don’t risk doing something stupid on Tonka, install Solaris 10 x86 on a VM and net install from that on to the Netra.” I wasn’t going to argue with myself so that’s what I did. It took me all afternoon to install Solaris since apparently VirtualBox on my Windows7 machine (it has a lot of RAM) and my Linux desktop machine didn’t want to actually do bridged networking or actually run the solaris install. Enough wasted time, and I just did the install on my MacBook Pro (4 gigs of RAM is nice for VMs). I set up a net install server on the VM and installed the Netra.

So now I have a Netra running Solaris 10 with an amazing 9+4 gigs of disk space. I’m still deciding what to do with it. Right now, I’m generally just figuring out how to actually set up a Solaris machine from scratch. I know enough to generally administrate Solaris when I have to, but it would be good to know more.

I might get around to posting some more of my Solaris explorations down the road. Since this thing has ZFS I might look in to an external SCSI caddy and use it as a backup server. It’s a thought.

Differences between the Midwest and Bay Area for startups

January 2nd, 2009

I found this post (http://leavingcorporate.com/2008/12/30/i-have-a-startup-midwest-vs-bay-area/) interesting. It’s two conversations about this guy and his startup. One with someone in the Bay Area and one with someone in the Midwest. There’s reasons I’m planning on heading out to the Bay Area. This is definitely one.