Entries Tagged 'Random Observation' ↓

Geek distractions

Tools are getting so sophisticated now – that they can be a distraction for the lightweight or part time coder.

You can get lost in the ins and outs of git vs hg, choosing a database engine (SQL vs Key-Value etc), javascript frameworks, PIP vs Buildout and integrating with virtualenv.

They all have their merit, especially to people who sit in this world all day long, but none of them directly produce work product for you. They are tools – and its best to learn them bit by bit, not all at once, or you will be overwhelmed.

watchedinstall

[update: project now on bitbucket]

The Problem

There is often the need in a deployment scenario to repackage an installer into some other format. This might be a [radmind][1] transcript, a simple payload only installer package or perhaps just a manifest of what exactly changed on the system.

Apple installer style packages contain simple payloads, but often contain pre or postflight scripts which can make additional and important changes to the filesystem.

There are a couple methods that have been used to try to deduce what exactly was installed:

Continue reading →

calling to the shell in python

This is one of the most frequent utility routines I have in many (most?) of my python scripts. Creating subprocesses in python is very flexble and powerful, but a bit verbose. Sometimes you just want to run a command and set a variable to the output.

from subprocess import Popen, call, STDOUT, PIPE
def sh(cmd):
    return Popen(cmd,shell=True,stdout=PIPE,stderr=PIPE).communicate()[0]

You can then just use this as:

sh('ps -x')

Will iTunes 8.2 lock out the Pre before it arrives?

The iTunes 8.2 update came out today with some curious details that, when you squint hard enough, suggest that Apple is trying to lock out the Palm Pre even before it launches.

Continue reading →

10.5.7 fails to update PPC machines properly

One of the things Leopard changed from Tiger was who could add printers. In Leopard only admins could manage printers – a change made apparently because schools were complaining that non-admins were adding printers they weren’t supposed to. But then it turned out that there were just as many cases where this caused a problem. Apple tried to fix this in 10.5.7 – but forgot to apply the fix completely for PPC machines.

Continue reading →

Reducing size of iPhoto POI database

This is probably only of interest to those of you that have to deploy iPhoto over a slower (ie wireless) network.

Continue reading →

Screen Juggling

Ever since I had a Powerbook Duo back in the day – I’ve made a laptop my primary machine. There has never been a sync solution that I have found adequate – and with my current AL macbook – I’m happy with the performance and memory. The only shortcomming is the screen as you can never have too much (spaces help – but its not a solution). At my desk at work I have an older eMac that serves as sort of a utility workhorse (encoding/archiving DVDs, backup ARD admin terminal, iTunes jukebox etc). I’ve always sought a way to make good use of the extra screen. In the beginning I was just using Apple Remote Desktop, but this was always a little klunky as it required switching away from whatever I was doing. I’ve not found a couple pieces that when put together result in close to a perfect setup.

Continue reading →

Broadcasting text to speech with Python

Background

As a busy father there are times during the day when I can not be glued to the computer, but am free to listen to something on headphones (ie doing dishes, cleaning the garage etc). Sometimes I listen to podcasts – but sometimes I’m out of interesting ones. I’ve recently been working on learning Django and wanted to be able to lurk on the IRC channel more. Its not something that I always want to have front and center on my screen, but would be interested in listening in on as if it were a conversation. So I thought: “I wonder if I can use the built-in OS X text to speech engine and broadcast that over streaming MP3 to my iPhone”. So began a saturday project during the kid’s nap, with some tweaks over the next several evenings.

The result is several pieces that can be used separately or together:

  • a basic IRC bot (basically taken from a python irc library)
  • a method of taking a set of strings, converting them to spoken text and then pushing them out as streaming MP3

While I developed the latter to work in service of the former, the basic technique could be used with any number of text sources – such as tailing logs etc, there is some interesting potential.

Continue reading →

Purple is the fad

Here are icons from three apps I use fairly regularly – seems like purple is the cool color right now. Time for iTunes to change its color again.

Purpleisit

Raising Octopus from Eggs

Where would people like this go without the internet?

 

Script to alert you when printing is done

At work I’m doing a bunch of printing of some large documents.  I wanted a way of being notified when it was done printing.  The action to take is up to you, I’m using curl to load a python CGI on a server to send an email/SMS to my phone. If you want to watch your non-default printer – just use the -P flag to lpq.

#!/bin/bash
LPQSTAT=lpq | head -1 | awk '{ print $NF }'
while [ $LPQSTAT = 'printing' ];do
 echo $LPQSTAT
 sleep 5
 LPQSTAT=lpq | head -1 | awk '{ print $NF }'
 done
curl ....
exit 0

Thank you NPR

In times of plunging gas prices – it takes some real smarts and guts to remind people that the peak oil problem has not disappeared.

Some quick observations.  It seems that CERA is always contacted for the “oil is not a problem” perspective.  I don’t know why they get so much cred, when it has been shown they have been wrong in the past.

Also, interesting to note that the next generation of oil professionals is more in tune with peak oil as a reality.

Lastly – Simmons is one smart guy, Obama should invite him in for a private presentation.

Now to convince the barnacles to stay off

I predict we will see people getting excited about projects like this.  But I have to wonder if the scientists working on these have ever seen the fouled bottom or pier piling.  What is the energy cost after you factor in maintenance?

Hard Drive Milestone

I can remember my first hard drive.  It was in college – I think it was an IBM PC-AT – it was 20MB and it seemed huge at the time (and it was for all I had were wordperfect files) – and it was very expensive.  I don’t even remember how it connected.

Then I remember buying a new 200MB drive for the lab I was working in – I think it was like $600 and it didn’t feel as large because now we were using photoshop and canvas – but still it was pretty mind blowing that you could get one drive that could hold 200MB.

Now today I just got in the mail a 1TB drive.  Terabyte = 1000GB or 1 trillion bytes = (1,000,000,000,000) bytes.  

The price $99

Unfortuntely USB seems to be winning out over firewire in terms of prevalence, and neither USB nor eSATA allow daisy-chaining the way FW does.  But with sizes like this – maybe its less of an issue, for now….

Kudos to Amazon

What a great idea – maybe there is hope for the world afterall