Archive for the ‘os x’ Category
Default fonts too small in gitk on OS X when installed with MacPorts
This is an easy one, addressed obliquely by the blog post that is the number one result in Google. The blogger also sets his font to Arial, which no one should emulate.
Gitk works pretty much straight out of MacPorts. Bravo, except for the 9 point fonts. Really.
Launch X11 and cd to your git repository in xterm. Run gitk and marvel at the unreadable text.
Edit the top three lines of ~/.gitk to change the fonts and/or sizes. Mine looks like this:
set mainfont {Helvetica 12}
set textfont {Courier 12}
set uifont {Helvetica 12 bold}
set tabstop 8
...
All this assumes that your X11 profile has a usable $PATH.
FinderColor: A Ruby interface to Finder labels in Mac OS X
I just posted to Rubyforge the first public version of FinderColor, a very small interface to the Finder label colors in Mac OS X. FinderColor sends Apple Events using rb-appscript, bypassing AppleScript entirely. This counts as a good thing.
Install: sudo gem install findercolor
There are only 5 methods to FinderColor:
FinderColor.get_index(full_path_to_file)
FinderColor.set_index(full_path_to_file, index)
FinderColor.get_color(full_path_to_file)
FinderColor.set_color(full_path_to_file, symbol)
FinderColor.batch_set(hash)
The index argument must be between 0 and 7. The hash argument to batch_set expects the keys to be integers or symbols for color names. FinderColor::Labels gives you an array of the color symbols in their index order:
FinderColor::Labels #=> [:none,
range, :red, :yellow, :blue, :purple, :green, :gray ]
Rdocs here.
Managing PHP fastcgi with Launchd
Because I’m using PHPLDAPAdmin as a stopgap while I build a custom web directory application, I have gotten soiled a bit by PHP. I’m running everything on a headless Mac mini, and I chose to use Mac OS X as the OS for reasons I won’t go into here.
The front-end web server is nginx, which is proxying to php running as fcgi. Pardon me in advance if/when I get the terminology wrong. I tried using the instructions from the Homo Adminus blog, and while both the Bash script method and the spawn-fcgi method work, I could not figure out how to get launchd to manage them.
I hope that some of you are laughing at me at this point, because the problem was (and may still be) totally centered on my ignorance of the fastCGI usage of the php binary. I was being dense about launchd as well. Launchd doesn’t use spawn-fcgi or a custom shell script as the ProgramArguments. Rather, it completely obviates the need for them. This should have been obvious (a phrase that I promise will be common on this blog).
For the edification of the similarly ignorant, here’s a launchd plist that seems to work.
As I understand it, you set the server IP address and port number with the -b argument to the php binary. Homo Adminus adds the -q option (suppressing HTTP Header output) in his Bash script, so I did as well. To arrange for more than one listening process, you have to set the PHP_FCGI_CHILDREN environment variable.
Leave a Comment
Leave a Comment
Leave a Comment