Entries Tagged 'Random Observation' ↓

Turning a Mac Lab into a disc burning machine

Have a lab of Macs – need to burn a bunch of CD or DVDs? Harness those monkeys!

Continue reading →

Bash completion for diskutil (and others…)

A few of the tools I use have spent some time working up bash completing. django-admin and virtualenvwrapper to name two. As a Mac sysadmin I use a number of CLI tools for stuff, and was interested in working up some bash completion for these.

Continue reading →

Integrating a paper based stage in a digital workflow with Django and QR code

There are several procedural things at work that still involve a signature, or hand written note on a piece of paper. This reality has made it hard to digitize these practices. While much of the process could be replace with a web app, with plenty of benefits. The reality is that because the paper step is required, the process would become disjointed. One way to reconcile the paper with the digital record, is to scan in the signed document and attach it to the digital record. However this doesn’t pass my “ugh” test in that even with ajax, manually attaching scanned documents to the correct record is still a tedious process. That is where qrcode comes in.

Continue reading →

Kevin Nails it

The Django Advent site is proving to be some great writing. The recent piece by Kevin Fricovsky hits the nail on the head in so many ways.

Continue reading →

a little tip on color

Not much to say other than I’ve been using this for a while and want to pass it on.

This post has a great tool for randomizing terminal colors.

If you have a lot of terminal windows open – this can make expose very handy (I don’t really use tabs).

I have this bound to CMD-Shift-C

Python,Multiprocessing,Hyperthreading, and image resizing

I have the occasional need to resize a set of images. I used to use Photoshop batch actions, then I used some droplets, and recently I’ve been using a simple python script with PIL (Python Image Library)

We recently got an 8 core Mac Pro, and I wanted to see if I could take more advantage of all those cores when resizing images.

Continue reading →

Pretty view of hg diff

Been using hg, and like to use hg diff to help me make better commit notes – but been spoiled by bitbuckets HTML view of diffs

So here is a quick script that I keep on my path for viewing hg diff, formated with pygments – I’m sure it would be very easy to adopt this to git.

here is the gist

Installing MySQL Python bindings on OS X Leopard server

Installing the mysql-python package on Leopard is relatively easy if you’ve installed MySQL from the mysql.org distribution – but installing on Leopard Server is a bit more problematic.

Continue reading →

Local editing of remote files

So found this buried under some dust. I had forgotten that I had ever set this up, but in adding some stuff to a .bash_profile on an older server found some code that I’ve spruced up bit for this post that lets you locally edit a remote file initiated via command in a remote SSH session.

Continue reading →

Marking all read in Mail.app

I’ve always been annoyed that the only way to mark all as read for a mailbox was with a contextual menu in the sidebar – lets change that.

Continue reading →

Letting users get to (i)Work

iLife and iWork can throw up an awful lot of update dialogs and welcome screens for people who first launch them. For users on my network I wanted to prevent those from coming up

Continue reading →

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 →