Fast and easy bluetooth management on Ubuntu

I wanted to connect the conveniently svelte Apple wireless keyboard and mouse to my Ubuntu media server. I don’t often have issues connecting peripherals to my Ubuntu systems these days, so I naively assumed this would be a walk in park. Well, it could have been, but I did not find the royal road on my first attempt. Here’s the right way.
Continue reading

Posted in Apple, Desktop | Tagged , , | Leave a comment

Spruce up your desktop with the National Geographic Photo of the Day

[Update, 2011-02-24] Reader Jason Coombs kindly made the necessary changes to get this working on Windows 7! Now I might be shamed into getting it working for Mac OS X as well :-) His changes are here. I’ve updated my script linked below as well. I’ll add some nicer instructions for Windows users soon .[/Update]

I love checking the National Geographic Photo of the Day page to see what wonderful slice of nature or mankind some intrepid soul has captured and shared. Often a wallpaper-sized image download is provided. I wanted to automate the process of checking the page for a wallpaper link, downloading the file, putting it somewhere appropriate, and setting it as my background. The result is this script, which does all that and even:

  • Verifies you have at least 25% free disk space before continuing
  • Renames the image to the title shown on the page
  • Creates a dir to hold these images if it doesn’t exist

Continue reading

Posted in Desktop, Programming, Python | 6 Comments

Apple’s plans for the enterprise

I don’t follow Apple very closely most of the time, but these facts I learned in close proximity recently struck me as pointing to an interesting possibility:

  • Apple has a giant datacenter with no clear publicly released purpose. It’s one big server farm and it’s online now.
  • Apple has a cloud OS patent. It’s most focused on the administration of such an OS with cloud-based, network-booted capabilities. The hardware platform isn’t specified, but they applied for this back in 2006, before the iPhone was released and well before iPad rumors took flight.
  • Apple is quietly and quickly moving into the enterprise space. Not through the server route, or even necessarily through MacBooks and iMacs, but through revolutionary alternative devices such as the iPad.

Perhaps Apple plans to release their own cloud-provided OS, enterprise-branded and customized. Securely connected to their sprawling new datacenter, Apple could provide businesses of all sizes with a productivity-enhancing and compliance-increasing platform that corporate users, IT teams, and management might all manage to get behind. There might be team-specific apps that are developed in-house or generated from a series of general template applications that provide commonly-needed functionality. From knowledge workers’ daily activity to retail scenarios various organizations could stand to benefit from devices, interface patterns and quality that users prefer enough to bring in personally.

Comments welcome!

Posted in Apple | Tagged , , | 3 Comments

Counting columns in a CSV from the CLI on Linux

In wrangling some DB exports recently I needed the number of columns in multiple CSVs. It’s easy enough to just open them in OpenOffice and check the final column number, but I wanted a CLI utility. I even entertained some notions of wc having a magical option to provide this, but no luck there.

So here’s a simple function I added to my .bashrc to do the trick:

1
2
3
4
5
6
7
8
9
# Displays number of columns (intended for CSV-type files),
# pass in separator then filename:
function colcnt {
    DELIM=$1;
    FILE=$2;
    echo "# of lines | Columns in $FILE"
    echo "(>1 row means there are other separators in the file):"
    awk -F"$DELIM" '{print NF}' "${FILE}" | sort | uniq -c
}

Continue reading

Posted in CLI | Tagged , , | Leave a comment

Reminder for mysql rubygem install on Ubuntu

Quick easy steps to get up and running with ruby, mysql, sqlite, rails, and most especially the mysql gem on a fresh Ubuntu 10.10 64-bit system:

1
2
3
4
5
6
7
8
9
# mysql and dev packages needed for mysql rubygem:
sudo apt-get install mysql-server mysql-client libmysqlclient-dev \
libmysqld-dev
# Needed for ruby-debug:
sudo apt-get install ruby1.8-dev
# Rails package includes lots of goodies you'll likely want:
sudo gem install rails sqlite3 ruby-debug
# And finally the gem:
sudo gem install mysql
Posted in Programming, Ruby | Tagged , | Leave a comment