Feed on
Posts
Comments

Twitter…

My friend Sean says it best here

To Recap:
If you want to know what’s going on with me, it’s best to follow this link: My Twitter Stream.

Auto twitter SMS on/off

So I’ve spent a little more time thinking about this and have decided this utility would be better as a server utility that sits out in the cloud and monitors for my computer activity. If it doesn’t see activity for some set period it notifies twitter to re-enable SMS messages.
This takes care of any issues with me shutting down or closing my laptop/computer before my notifier can get its message out.

I’m thinking a python script, called by cron that checks for an indication that I’m active on my computer, if it doesn’t see the indication after some number of tries it turns SMS notifications on. That part seems pretty solid, what should I use on the laptop to signal my presence? If this was a Windows machine I’d be off and running but I’ve recently switched to a Mac and I don’t know the platform very well. Instant messenger sounds like something to tap into as it already has the concept of active/idle built into it, but I’m using Adium and it seems like Adium plug-ins are written in Objective-C which is totally foreign to me.

I think it’s time for some googling…

I just started twittering and have found that getting alerts on my phone is great, just not when I’m also at the computer.
So being a good geek I thought I’d automate the process of turning mobile alerts on or off based on my laptop status.

So far I’ve scraped the HTTP headers and post variables so I know how to login and turn updates on or off. Next I need to package up a small utility to automatically decide when to send the commands.

Convert m4a to mp3

I’ve been moving a bunch of my brothers music out of iTunes for him so he can use it with portable players besides iPod. Unfortunately he encoded a lot of his cd’s in .m4a format. I found a decent utility for converting to mp3 (and other formats) http://www.bonkenc.org/

Unfortunately when you point Bonk at a directory full of m4a’s it crashes on certain files for some reason (encoding issues probably.) After the crash you need to setup all of your settings and add the files again, which is really time consuming and annoying.

To make this easier I whipped up a short python script that calls Bonk for you on each file, if it runs into a bad file it will rename the file for you so you don’t try to process it again.

Here’s the python code:

import os
import pprint
import subprocess
curDir = os.getcwd() # The current directory. This should contain your .m4a files
pathToBonk = "C:\\Program Files\\BonkEnc\\becmd.exe" #Where the becmd.exe file lives
problemFiles = [] #A list of files that failed conversion
#
for item in os.listdir(curDir):
	if item.upper().endswith('.M4A'):
		fullPath = os.path.join(curDir,item)
		cmd = '"%s" -e LAME -d "%s" "%s"' #The command to convert a single file
		cmd = cmd % (pathToBonk, curDir, fullPath)
		val = subprocess.call(cmd)
		if val == 0: #Successfull conversion, delete the original
			os.remove(fullPath)
		else:
			problemFiles.append(fullPath)
			print 'Problem converting %s' % item
			os.rename(fullPath, fullPath + ".BAD")
print 'These files had problems converting and have been renamed with .BAD extensions:'
pprint.pprint(problemFiles)

NOTES: This will delete the .m4a file after converting it. If you want to keep your old files for some reason make sure to run this on a copy of your files. IE in a different directory.

Hello loyal reader(s),

Our time in Arizona is coming to an end, for those that don’t yet know I’ve accepted a really awesome position with a really awesome company in San Francisco (more about that in another post). Because of that Jody and I are up and leaving AZ. Unfortunately for us that means it’s time to sell our beautiful house :(

This is a great opportunity to get an excellent house in southern Scottsdale, right by Old Town and next door to the new SkySong technology park. This a great area to invest in, I wish I could keep this house and live in San Francisco, but that doesn’t work financially.

To view pictures and virtual tours follow this link: http://www.1720north75thplace.com/

Here are some stats on the house itself:

3 bedroom 2 bath
1506 sq ft.
Upgraded Kitchen Features Center Island, Breakfast Bar, Large Walk-In Pantry And Newer Oven/Range/Dishwasher/Disposal/Pot Rack!
Large 24 Inch Tile With Custom Tile Border In Kitchen, Living Room, And Dining Room!
Spacious Rooms With Lots Of Natural Light! Custom Accent Paint! Ceiling Fans! Security System!
Nice Size Master With Walk-In Closet!
Remodeled Bathrooms With Newer Sinks And Cabinets!
Large Private Backyard (Block Fence)With Extended Covered Patio and Mature Landscaping!
Great For Entertaining! Close To Shopping, Restaurants,Fitness Center, And Walking Distance To El Dorado Park And Aquatic Center!

Oh and don’t forget the Meyer Lemon tree in the front yard. This guy produces Lemons the size of my head! and they’re delicous, as far as lemons go anyway.

Here’s where it is google map

I can’t friggen wait!

Someone’s building a human size version of the old board game mousetrap:

Note: The above picture is a giant nose picker, not mousetrap

And robots. Hopefully robotic dogs too, I love those.

Check em out.

spider.jpg

Running multiple Firefoxi

I’ve been getting intermittent slowdowns and occasional lockups of my firefox browser. I suspect it’s from JS heavy pages/applications leaking memory somewhere but I wasn’t sure which pages to blame, and didn’t want to spend alot of time investigating.

Typically I have 3 different browser windows open each with their own batch of tabs:

  1. Personal browser including mail, calendar, rss feeds etc.
  2. Work Browser including work wiki’s, blogs, project management tools, documentation, java applets, applications, etc
  3. Utility browser which has blog posts to read, videos to watch, links emailed to me etc. Basically anything that doesn’t belong to the other two.

The problem with this setup is that instability on any of the browser windows affects them all, causing lost work or time reloading the relevant pages.

Luckily there’s a solution to this. Firefox has the concept of user profiles which were designed for multiple users on the same machine (family/shared computers etc). You need to create multiple profiles. To get the profile manager running run this from a command line:

"C:Program FilesMozilla Firefoxfirefox.exe" --profilemanager

Once the manager starts up you can create yourself a couple of different profiles.
Then create shortcuts for each of your profiles on your desktop that look like this:

Target = "C:Program FilesMozilla Firefoxfirefox.exe" --P Google -no-remote
Target = "C:Program FilesMozilla Firefoxfirefox.exe" --P Default -no-remote

Start FF with those shortcuts and you’ll have two completely separate windows. Now if one of the Windows is misbehaving you can kill it and not worry about the other one. Cool.

More info about the FF command line params can be found here.

NoirSects.com

I wanted to let everyone know about a new website I’ve created called NoirSects.com

NoirSects

The site features noir style photographs of insects. The first 3 pictures up there are mine, but the site is open to all interested photographers. To get your photos shown on noirsects.com all you need to do is join the flickr group and add your photos to the group. They’ll show up automatically on the webpage.

Thanks to Lucas J. Shuman for creating fjs a Javascript library for displaying flickr photos. Open source is great, I can go from thinking about something like NoirSects.com to having a working version in very short time, thanks to people who publish their code for re-use.

Here’s a nice little function I’ve written to report the number of duplicates in a python list.

from sets import Set
#
def countDuplicatesInList(dupedList):
   uniqueSet = Set(item for item in dupedList)
   return [(item, dupedList.count(item)) for item in uniqueSet]
#
lst = ['I1','I2','I1','I3','I4','I4','I7','I7','I7','I7','I7']
print countDuplicatesInList(lst)

The Set datatype is an unordered set that doesn’t allow duplicates, so the first line in the function adds each item in the original list to the Set. The set automatically throws out duplicates so we end up with a unique list.
The next line creates a tuple of the unique item name and its count in the original list.

The output of the function will look like this:

[('I1', 2), ('I3', 1), ('I2', 1), ('I4', 2), ('I7', 5)]

« Newer Posts - Older Posts »