Archive for the ‘experiments’ Category

Access -> MySQL

Friday, October 23rd, 2009

Long, long ago I hacked together a Java app that imports the freedb CD info files from my local drive to an MS Access database. The CD ripper application I use creates a local freedb with a file for each CD I rip (all of them). So importing from that freedb to a database seemed a natural thing to do.

Access was all that I had access (heh) to, and it had a “music collection” database template, so with slight modification to the template that’s what I used.

Well now, I no longer have access (heh) to Access, Access is a PITA, and I already have MySQL available on my home server, so I figured it was time to finally migrate.

I found a handy application called Navicat (fully functional trial), that will import directly from the Access .MDB file to a MySQL database.

While Navicat mostly worked, I was not quite done. The import did not properly get the auto_increment attribute on the tables’ ‘id’ column. Also, the Access database tables had spaces in their names which is kind of a drag. Fortunately both were easily solved by exporting from MySQL to text using mysqldump, editing the .sql file that resulted, and then reimporting to MySQL from the .sql file.

Sure it’s a ridiculous thing nobody in their right mind will ever have to do, but I’m not in my right mind.

TwitPic upload hack

Tuesday, January 13th, 2009

Some Twitter users have been using TwitPic to link photos to tweets. I, on the other hand, have been using Flickr and Snipr. It’s a PITA, so I’m giving TwitPic a whirl. Sadly, Digsby, does not support TwitPic, and I’m not installing yet another app.

TwitPic has an API, so I rolled my own simple uploader with cygwin and curl. There’s no doubt in my mind that I’ve reinvented the wheel here…

Standard disclaimer applies: this is quick n’ dirty(tm):

#!/bin/bash

# curl executable.  I'm a PC.
CURL=C:/cygwin/bin/curl

# The upload script that will accept the data
UPLOAD_URL=http://twitpic.com/api/uploadAndPost

# Snag stuff off the command line
TWITTER_USER=$1
TWITTER_PW=$2
PHOTO=`cygpath -m "$3"`
TWEET_MSG=$4

# Prompt for message if it's not given
if [ "$TWEET_MSG" = "" ]; then
   read -p "Tweet msg: " TWEET_MSG
fi

# Go
echo Uploading...
$CURL \
  --form username=$TWITTER_USER \
  --form password=$TWITTER_PW \
  --form media=@"$PHOTO" \
  --form message="$TWEET_MSG" $UPLOAD_URL

# Wait for user to read result message
echo
read -p "Press <enter> to continue" bogus

Create a desktop shortcut with uid and password:

C:\cygwin\bin\sh.exe ~/twitpic.sh --userid-- --password--

Now just drag and drop the photo onto the desktop shortcut.

Some things you do just because you can

Friday, October 24th, 2008

Need another Sonos controller?

Hack together openlink, perl, sonosweb and iphone sonos:

I had to go through Perl dependency hell (Perl really is an abomination) to get sonosweb working on the linkstation, but it works pretty well now.

Throw in a little DD-WRT and ssh and you can really mess with your S.O. by changing the music at home from the office.

Now I need to write up how I got through the seven circles of dependency hell before I forget. It took more than a quarter to Charon.

Random text post

Friday, April 20th, 2007

Here’s some random text for The Google to index:

I thought, “sldfkjdlkjd wwerrrjrjs ttlljjjgllkkttj sldfe sdfw?” But naturally, fjwjejrb jboegj and wllejrbbbjelti3! So instead I wnne85gnns dlfkjwrng yot!

Shortly thereafter, wnern6xioa hgqqp38ng alasjtq8p6 sgklgfnqp lanffsan ouq dlfn sda gqpq dnfgga. But still, there is the matter of akl e7a z fngfn lqn fqi ore.

“IuthlzJKSf hnaa jasdj tjla5!” I said. “A hafaljsda nfqo ietyalf hld sh q5a.”

No, that will never work. Aj awfahqeol q89 ahlfqp3984 bdfalkf.

Wijit Gadget

Tuesday, April 10th, 2007

Or is that gadget wijit? Anyway, there’s an official one now, so I turned off the old, experimental one.

Get the new one here: add to google

A TiVo post

Wednesday, April 4th, 2007

This is a post about TiVo. “TiVo” is a favorite search term at Lijit, so I’m writing a post about it so TiVo will come up in my search results.

You can see what’s currently recorded on my TiVo in the sidebar on the right.

tivo logo

Lijit Wijit Gadget

Thursday, March 22nd, 2007

A few weeks ago I quit using My Yahoo! and began using Google Personalized Home instead. Call me old school; I still like that kind of portal page.

Google Home is just a collection of “Gadgets”, and it turns out it’s pretty easy to write one. So I converted the Lijit Wijit into a Gadget; the Lijit Wijit Gadget.

So if you use Google Home and want to add MrBalky search to your page, just add to google home.

It’s really just a test. Look for a better Lijit Wijit Gadget, coming soon from your good friends at Lijit Networks.