d8d

Wheel of Friends

September 9th, 2008

This is something I produced last year, as a part of the Open Publishing Lab so unfortunately the source isn’t available as of yet, but it’s still worth nothing.

The below is a visualization of the results of a social networking game we ran at a festival last May. Hit the link for all the details, but the gist of the game is people trade barcode stickers with people who share at least one interest out of a pool of 8 or so. Those people who connect are scanned in via a normal scanner, an application rips the barcodes and stuffs them into a database. Once those links in the database are made, it’s a bit hard to visualize it all. This is where my part came in: visualising all the people via a wheel.

The wheel was created in PHP, using a little trig, and a lot of tweaking. The output can accomdate a virtually unlimited amount of people and links. Plus, it’s pretty to look at. The wheel has gotten a lot of mileage (no pun intended) on a lot of the promotional material for the OPL.

Asus EEE PC 901

August 7th, 2008

I had originally started this blog trying to avoid the senseless posts about your personal life that very few people care about, and yet here I am, blogging about my recent purchases. Nevertheless, I recently bought an EEE PC, one of the originators of the UMPC/netbook market to replace my Gateway laptop, which despite being relatively new, has not held up well at all. After finding out how much it would cost to repair it, I figure I’d just bite the bullet and go for the EEE.

So far, after a rough start on the software side of things, I’m pretty happy with the device. It is quite speedy; time from boot to usable is very fast, and once you’re able to get GNOME running on it (which in true Linux fashion, requires editing text files) it becomes a lot more handy than the built-in “simple” interface. The built-in software is pretty extensive, including teaching applications, and closed-source apps like Skype instead of Ekiga, with out of the box working video conferencing. From a quick test, the audio quality is quite high, and the webcam is decent for being a tiny 1.3 megapixel affair.

My only major issue is with the touchpad: there is a quite noticeable delay on movement, and getting it to register at all requires you to use your whole finger, rather than the tip. Apparently this is easily fixable on Windows, but I’m unable to find an equivalent fix for the built-in Xandros system.

Otherwise, the screen is an 8.9 inch LCD running at 1024×600. Although I haven’t done the calculations, it looks like a higher DPI than your average screen. The keyboard is tiny, and definitely takes adjusting to; I type with 3 or 4 fingers per hand but have managed to become pretty fast typing this way (in fact this post has been written on the EEE).

In the 901 series, they’ve elected to change the casing, from a nice matte plastic that’s easy to handle and carry, to a generic glossy surface that everyone seems to be doing these days. it attracts fingerprints, and personally, I think is rather ugly looking. Seems like such a pointless change, and it’s too bad they had to change it right before the model I purchased.

Overall, anyone else considering the EEE or other similar devices would do a great service to themselves by checking one out in stores before. In the case of the EEE specificially, unless you’re planning to use it as is, be prepared to spend a lot of time tweaking. Even installing XP requires some post-install tweaking in order to reduce wear and tear on the drive. I don’t expect to get much use out of this for the remainder of the summer, but carrying this around once I’m back to college in the fall should be quite nice.

Site Updates

July 30th, 2008

After a couple of years of letting my resume fall into disarray, I’ve finally updated it with all the projects I’ve been apart of these past couple of years. I’m getting ready to hopefully graduate college this year, so if anyone actually reading this has any connections that may be looking, please do let me know!

autoftp.py

July 26th, 2008

This has been something that’s been sitting on my PC for a while, and has actually been used pretty often unlike every other script I’ve ever published. In its most basic form, it’s a Python script that connects to an FTP address, and compares two directories. It will then upload any new files that are on the client to the FTP server.

The usefulness of the script for me occurs when I run it on my Windows Mobile phone, running PythonCE. The Python script is set up to filter out only .jpg files. This end effect is, when combined with the built-in camera, and a data connection, one can easily upload images from their camera phone to their website.

# Copyright (c) 2008, Mike Rubits
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#     * Redistributions of source code must retain the above copyright
#       notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#       notice, this list of conditions and the following disclaimer in the
#       documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY Mike Rubits "AS IS" AND ANY
# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL Mike Rubits BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import os, re
from ftplib import FTP
import time

# CONFIGURATION
if os.name is "ce":
   picPath = "/My Documents/My Pictures/"
else:
   picPath = "."

ftpAddress = "ftp.example.com"
ftpUsername = "Username"
ftpPassword = "Password"
ftpPasv = False
ftpPath = "/httpdocs/photos"

# END CONFIGURATION

def ParseRemoteFiles(line):
   match = re.search("(\w+)\.jpg",line)
   if match is None:
      return None
   else:
      remoteListing.append( match.group() )
      return None

# Find Local Files
remoteListing = list()
localListing = os.listdir(picPath)

#Find Remote Files
ftp = FTP(ftpAddress)
print ftp.login(ftpUsername,ftpPassword)
print ftp.cwd(ftpPath)
ftp.set_pasv(ftpPasv)
print ftp.retrlines('LIST',ParseRemoteFiles)

newFiles = 0
filesToUpload = list()
for localFile in localListing:
   f = localFile in remoteListing
   if f is False:
      newFiles = newFiles + 1
      print "found new image " + localFile
      filesToUpload.append(localFile)

print "found " + str(newFiles) + " new images to upload"

progress = 0
for uploadFile in filesToUpload:
   file = open(picPath + uploadFile,'rb')
   progress = progress + 1
   print "uploading img (" + str(progress) + "/" + str(newFiles) + ")"
   print ftp.storbinary("STOR " + uploadFile, file)

XML Gallery

July 24th, 2008

I’ve recently been starting to use Git as an SCM, and despite the fact it’s an utter pain to use (131 uniquely named binaries, but that’s something best left for other places to discuss) I’ve put up one of my recent projects that I spent a little time on: my efforts to create a flat-file based photo gallery.

Sure, it’s probably not as relevant today as it was 5 years ago with services like Flickr and Photobucket used just about everywhere, however there’s still something to be said for self-hosting.

The application itself is pretty simple. Point it at your photo directory, and when visited in the browser, will generate an XML index of the directory. The XSLT transforms it into XHTML, which is viewed by your browser. As far as I know, taking this approach for a photo gallery is pretty unique, and makes templating a snap. It has potential, just needs to be finished.

Right now, it all basically “works” although I don’t have a sample to show. It is really quite hideous at the moment, and is missing a few things. I’m also not entirely happy with the format of the XML. It’s more public for the sake of getting it out there, rather than for public consumption.

Without further ado, you can view the source on the web in Gitweb, hosted by l3ib, a front for one of many IRC channels I frequent (I created the front page, if anyone actually cares). The code itself has no license at the moment, but the final version will likely be BSD licensed if I ever get that far. Enjoy!

SMS Notification for Pidgin

July 5th, 2008

After a couple hours of figuring out Perl, Pidgin’s API, and a host of other tiny annoyances, I’ve thrown together a little Perl plugin that should work on Pidgin and Finch. It’s extremely simple: when you receive a message while marked as away, it will send an email via sendmail to a specific address. As almost all cell providers have some sort of SMS to email gateway, this gives you the effect of having all messages, regardless of protocol, forwarded to your phone while you’re away. You can’t respond, however something like WebPidgin could come in handy (although I personally just SSH in and reattach screen)

Code attached below. This version, at least, is licensed under the WTFPL. I may revisit this one day and make it a lot easier to use. (Note: I’m not a Perl coder at all, so this may not be pretty, but then again, what Perl IS pretty?)

use Purple;

%PLUGIN_INFO = (
perl_api_version => 2,
name => "SMS Notify",
version => "0.1",
summary => "Dispatches an email, generally to a phone, when a message is received while away.",
description => "None",
author => "Mike Rubits <sponge\@d8d.org>",
url => "http://d8d.org",
load => "plugin_load",
unload => "plugin_unload",
);

sub plugin_init {
return %PLUGIN_INFO;
}

sub plugin_load {
$plugin = shift;
$data = "";
$conversation_handle = Purple::Conversations::get_handle();
Purple::Signal::connect($conversation_handle, "received-im-msg", $plugin, \&im_received, $data);
Purple::Debug::info("smsnotify", "SMS Notify Loaded\n");
}

sub plugin_unload {
Purple::Debug::info("smsnotify", "SMS Notify Unloaded\n");
}

sub im_received {
my ($account, $sender, $message, $conv, $flags) = @_;
$message =~ s/<[^<>]+>//g;
my $status = $account->get_active_status();
my $statusName = $status->get_name();
if ($statusName eq “Away”) {
my $sendmail = “/usr/sbin/sendmail -t”;
my $to = “To: email\@address.com\n”;
my $from = “From: pidgin\@address.com\n”;
open(SENDMAIL, “|$sendmail”) or Purple::Debug::info(”smsnotify”, “Cannot open sendmail\n”);
print SENDMAIL $to;
print SENDMAIL $from;
print “\n\n”;
print SENDMAIL $message;
close(SENDMAIL);
}
}

Panoramic Photography

July 2nd, 2008

I’ve finally gotten around and uploaded some of my old panorama shots in the Other section. In addition to a few standard panoramas, I’ve also created a 360 degree Quicktime VR version of one of the photos, and two shots that were rendered via the PC version of Quake Wars, and converted into Flash panoramas. Check them out if you’re into looking at other people’s photographs!

Downtime

June 6th, 2008

It appears I’m back after quite a bit of downtime due to a massive transformer fire in the datacenter where d8d is hosted. Hopefully all is well now, and we’re back for good.

Form validation on the web

May 20th, 2008

I’ll preface this post by first saying I don’t know if something like this has been attempted before, but it sounds like a good idea to me at this time. One of the gotchas about web development is that often several different languages are put into use, especially when you compare the client and the server. On the server you have languages like PHP, Java, Ruby, Python, the list goes on. On the client side, unless you’re doing something crazy you’re pretty much restricted to JavaScript. Read the rest of this entry »

Blog is go!

May 20th, 2008

Welcome to the new d8d blog. While there’s nothing to see yet, hopefully sometime in the future there will be ranting and raving about various technologies and stuff I’ve been working on. Until then, an obligatory intro post!