Technology

Gettting Grab screen writing jpeg instead of tiff files

By default, “Grab” on MacOS saves the file as .tiff. Why? There’s no preferences to change it. Fortunately, there’s a pretty easy way by opening a terminal window and running the command line:

defaults write com.apple.screencapture type png

You need to reboot for it to take affect. You can make other choices: jpg, tiff, etc.
You can also set the “location” and read the current values

defaults read com.apple.screencapture
Technology

Apple’s Time Capsule and Airport Express

I had a Linksys wireless router (WRT54GS) but it’d been acting a little flakey
the past 1/2 year. It kept getting confused about assigning IP address
(e.g. DHCP) and generally being unreliable. I’d been looking at Apple’s Airport
Express for a few months. I wanted some way to hook up some decent speakers
wirelessly and also thought it’d be nice to be able to have the printer
available over the network.
Last week, they announced the latest generation
with the latest wireless standard: 802.11n (Cost: $99). Not a big deal for me.
I already had a strong enough signal and am more limited by my cable modem then
any wireless network. But the new offering made me want to upgrade.
Sadly after installing the Airport Express it turned out not to be sufficient.
I have an older computer using ethernet and a phone using VOIP — both need an
ethernet jack and the Airport Express doesn’t have any extra (just the one for
the WAN). I tried to get the Linksys to act as a dump router and connect
wirelessly but no joy.
The other thing I’d been thinking about was backup. I’m normally pretty good
about backing stuff up. I’d tried using an old notebook drive via USB but it
wasn’t big enough. So I hadn’t really backed anything up. I also needed to get
my gf’s MacBook doing backups too.
So I decided to buy the 500GB Time
Capsule
which is both a wireless router and a backup hard drive (Cost:
$299). So I spent a little more than I’d planned (what’s new?).
I couldn’t believe how easy everything was to setup! In 15 minutes I:

  • Had the router connected to my cable provider with the phone and old computer connected
  • Had both laptops connected wireless using WPA2 for security
  • Got the printer connected wirelessly (through the Airport Express)
  • Had iTunes playing through the Airport Express to some speakers)

The software design is just so superior! Being able to query info about the
device and use that to do the setup. I didn’t even have to enter in the printer
name. I just read what the Airport Utility was telling me and either entered a
password or clicked on “Next”.

Technology

Installing apache on Mac OS X

I’ve got Leopard (10.5.1) with the developer tools installed and want to do some
more development in Django on my laptop. I first want to install MacPort to make it
easier to download and install various opensource projects. Using MacPorts, I’ll
get Apache
installed and configured. Finally, I’ll get the basic django working.
1. Installing Mac Ports painless. Just follow the direction at the web site. I prefered to download and install the disk image: disk image
2. You need to add port to your path. I use a ~.bashrc:

PATH=/usr/local/bin:/usr/X11R6/bin:/opt/local/bin:/opt/local/sbin:$PATH
    

and make sure it’s available (create a new shell, a new terminal window, or “. ~/.bashrc”). The command

bport -h/b
Usage: port
        [-bcdfiknopqRstuvx] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
        [[portname|pseudo-portname|port-url] [@version] [+-variant]... [option=value]...]...
"port help" or "man 1 port" for more information.
    

should print a help message.
3. I checked to make sure which apache and any options I could chose from (the “sudo” is so I can run the command as root (administrative user) and I do it each time so I have a log of my actions)

$ sudo port selfupdate
MacPorts base version 1.600 installed
Downloaded MacPorts base version 1.600
The MacPorts installation is not outdated and so was not updated
selfupdate done!
$ sudo port list apache
apache                         @1.3.37         www/apache
macbook:~ ware$ sudo port list apache2
apache2                        @2.2.6          www/apache2
$ sudo port variants apache
apache has the variants:
	universal
	darwin
	apache_layout

And finally, let’s install it:

$ sudo port install apache2

Shockingly, there was an error:

...
checking for mawk... (cached) no
checking for gawk... (cached) no
checking for nawk... (cached) no
checking for awk... (cached) no
configure: error: No awk program found
  

I think there was a path problem involved because gawk was now installed and restarting the install worked:

$ sudo port install gawk
Skipping org.macports.activate (gawk ) since this port is already active
$ sudo port install apache2
  

I now need to tell OS X about starting up this application on system booting:

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
  

And now it’s time to configure apache:

$ cd /opt/local/apache2/conf
$ cp httpd.conf.sample httpd.conf
   

Trying to start it apache up gave me this error:

$ sudo /opt/local/apache2/bin/apachectl start
httpd: Syntax error on line 96 of /opt/local/apache2/conf/httpd.conf: Cannot load /opt/local/apache2/modules/mod_ssl.so into server: dlopen(/opt/local/apache2/modules/mod_ssl.so, 10): Symbol not found: _ssl_cmd_SSLCACertificateFilen  Referenced from: /opt/local/apache2/modules/mod_ssl.son  Expected in: flat namespacen
   

Use your favorite editor to comment out ssl (I don’t need it, yet)

$ sudo vi httpd.conf
...
#LoadModule ssl_module modules/mod_ssl.so
...

3. Start it up:

$ sudo /opt/local/apache2/bin/apachectl start
$ sudo bin/apachectl start
 

4. And prove it works by connecting to http://localhost/