sha1sum in Mac OS X

Mac OS X doesn’t come with a sha1sum utility. Neither does fink. So what’s the quickest way to check a sha1sum on a Mac? Use openssl: openssl sha1 filename If you’d like to roll this sha1sum check into a simple bash script, create the following sha1sum script: #!/bin/bash /usr/bin/openssl sha1 $1 Then make the sha1sum script executable, and run it: chmod 755 sha1sum ./sha1sum...

SMTP relay with FreeBSD and sendmail

Here’s a guide to setting up a FreeBSD server to relay emails for a set of IP addresses and/or hostnames. Be very careful to only enable relaying for trusted machines. Ideally, you’d setup your FreeBSD sendmail server to require authentication. Enable sendmail on your FreeBSD server by adding the following line to the /etc/rc.conf file: sendmail_enable="YES" Start sendmail using FreeBSD’s rc.d system. /etc/rc.d/sendmail start Add the IP address or IP addresses that you’d like sendmail to relay mail for to the /etc/mail/access file. For example, the following lines enable relaying for all emails coming from 10.0.2.1, and any IP address starting with 192.168.0. 10.0.2.1 RELAY 192.168.0 RELAY cd to your FreeBSD server’s /etc/mail directory, and run make to apply your changes to sendmail. cd /etc/mail...

Installing djbdns dnscache on FreeBSD 6

djbdns is a DNS server package that was created in response to BIND’s history of security holes. Whenever I setup a Linux or FreeBSD DNS server, I try to use djbdns rather than BIND. Here’s how to setup a DNS caching server using FreeBSD 6.x and djbdns’s dnscache mode. The following commands should be run with root, su or sudo: Install the djbdns port, and its dependencies. cd /usr/ports/dns/djbdns make install clean rehash Enable the supervise service, which is used to start djbdns. echo 'svscan_enable="YES"' >> /etc/rc.conf mkdir /var/service usr/local/etc/rc.d/svscan.sh start Create djbdns’s cache and log accounts. pw useradd Gdnscache -d /nonexistent -s /sbin/nologin pw useradd Gdnslog -d /nonexistent -s /sbin/nologin Configure djbdns as a DNS caching server. In the examples below, 192.168.0.1 is the IP address of the interface that the djbdns DNS caching server will run on, and 192.168.0/24 is the network that I want to allow to access the server. Subsitute in the appropriate IPs and range(s) for your network. dnscache-conf Gdnscache Gdnslog /usr/local/etc/dnscache 192.168.0.1 ln -s /usr/local/etc/dnscache /var/service touch /var/service/dnscache/root/ip/192.168.0 /usr/local/etc/rc.d/svscan.sh restart Sources: How to install djbdns How to run an external cache for your...

How to disable EVDO on a Motorola e815 with Verizon Wireless / Page Plus

EVDO can shorten your Motorola e815’s battery life. Since Page Plus, my cell provider doesn’t support EVDO, I disabled it on my unlocked e815 with the following procedure: Enable Test Mode Quickly press the Menu (top-center) key, then 073887*. Enter your security code when prompted. By default, this will be 000000. If you aren’t prompted for your security code, go back to step 1. You probably didn’t type the sequence in fast enough. Scroll down to “Test Mode”, and press Select, then Enable. Press Exit to go back to the main screen. Disable EVDO Press the Menu key followed quickly by the Left Soft Key (top left key). Press the Left Soft Key until you see “HDR Pref” and “HDR Hybr” (around 5 times). Scroll up to “HDR Hybr”, and change its value to CDMA by pressing the Right Soft Key. Scroll up to “HDR Pref”, and change its value to Off by pressing the Right Soft Key. Press the Left Soft Key to select Exit. Press the End button to go back to the main screen. Disable Test Mode Quickly press the Menu (top-center) key, then 073887*. Enter your security code when prompted. By default, this will be 000000. If you aren’t prompted for your security code, go back to step 1. You probably didn’t type the sequence in fast enough. Scroll down to “Test Mode”, and press Select, then Disable. Press Exit to go back to the main...

Printing to a Cannon ImageRunner 5075 from Microsoft Word 97

One of my customers recently had a Canon ImageRunner 5075 coper/printer/fax unit installed in their office. Everything seemed to be working until someone tried to print a document in Microsoft Word 97. It seems that Microsoft Word 97 didn’t like the new printer. It would crash every time someone went to File -> Print, and selected the Canon printer, but strangely enough, it printed just fine if the Canon IR 5075 was set as the default, and they just clicked on the Print icon. None of the other printers caused Microsoft Word 97, or any of the other Microsoft Office 97 apps to crash. As a workaround while I tracked down the problem, I asked them to print their word documents as PDFs, then print the PDFs to the Canon ImageRunner 5075. Needless to say, that kludge wasn’t a good long term solution for the printing problems.What I found was that Microsoft Word 97, and the rest of Microsoft Office 97 for that matter didn’t like Canon’s UFR (Ultra Fast Rendering) drivers. I found a PCL 6 driver for the ImageRunner 5075 on Canon’s website, switched to it, and the crashes...

Using dd to write disk images to CompactFlash disks and floppies under Mac OS X

Here’s how to use the dd utility to write a disk image to media under Mac OS X. I tested this with 10.5.2 with both a USB to CompactFlash adaptor, and a USB Imation USB SuperDisk. Plug the media into your Mac. If you get a message saying that the media cannot be read, click Ignore. Open Disk Utility (Applications -> Utilities -> Disk Utility). On the left-hand column, find that disk that you plan to write to. Select any partitions on that disk that are mounted, and click the Unmount button (not the Eject button). Once unmounted, the partitions should grey out. On the left-hand column, find that disk that you plan to write to, click it, then click on the Info button. In the window that pops up, note the Disk Identifier. It should be something like disk2 or disk3. Open up Terminal (Applications -> Utilities -> Terminal). Type in the following command, replacing diskx with the Disk Identifier found earlier, and image.img with the name of the image file that you wish to read from. sudo dd if=image.img...

Configuring the Cisco VPN Client in Ubuntu Linux 7.10 (Gutsy)

I do some work for an organization which requires me to authenticate to a Cisco VPN. Getting the VPN client setup under Mac OS X is a simple matter, but doing the same under Linux required some research. Here’s what worked for me. I’m using the 64-bit x86 version of Ubuntu, which didn’t seem to cause any hiccups: Step 1 – Install the Cisco VPN Client: Check what kernel you’re running by issuing the uname -a command. You should get something like: Linux matt-media 2.6.22-14-generic #1 SMP Tue Dec 18 05:28:27 UTC 2007 x86_64 GNU/Linux Download a copy of Cisco’s VPN client for Linux. If you’re using a 2.6.x kernel, it’s important to use a 4.8.x client. Confirm that you have kernel sources installed for your kernel version. Check the /lib/modules/ directory. Download a patch matching your kernel version from http://tuxx-home.at/. I’m running 2.6.22, so I ran: wget http://tuxx-home.at/projects/cisco-vpnclient/vpnclient-linux-2.6.22.diff Extract Cisco’s VPN client tarball: tar -xzf vpnclient-linux-x86_64-4.8.00.0490-k9.tar.gz Apply the patch: cd vpnclient patch -i ../vpnclient-linux-2.6.22.diff Install the VPN client: sudo ./vpn_install Step 2 – Configure the VPN Client: Take a backup of a working Cisco VPN client’s configuration. The location below is where these files were located on my Mac OS X system. They’re no doubt located somewhere other than the /private folder in other OSes. tar -czf cisco-vpnclient.tgz /private/etc/opt/cisco-vpnclient Copy the cisco-vpnclient.tgz tarball that you just created into the /etc/opt/ directory of your Linux system, and unpack it. sudo tar -xzf cisco-vpnclient.tgz Start the vpnclient service. sudo /etc/init.d/vpnclient_init start Check the name of your VPN’s profile by listing the contents of the Profiles directory. Your profile’s name will...

VNC in Mac OS X 10.3.9

The latest version of Vine Server (3.0) only officially works with Mac OS X 10.4 or later, but there’s a way to make it work with Mac OS X 10.3 (Panther). After installing Vine normally, just delete the following directory. It contains the offending OS X 10.5 (Leopard) specific files: /Applications/Vine Server.app/Content/Resources/TigerBundle.bundle That’s it! You should now be able to launch Vine’s VNC Server from the Applications Folder, configure it, and remotely control to your Mac OS X 10.3 system over the...

Kismac r62 download for Mac OS X 10.3 (Panther)

I was able to download a copy of the elusive Kismac r62 – the last version of Kismac to run on Mac OS X 10.3 (Panther). Kismac r62 is now running happily on my G4 iBook with OS X 10.3.9. I’ve mirrored Kismac r62 here in case anyone wants to download it:...

Prevening an iBook G4 from going to sleep when closed

Here’s how I prevented my iBook G4 notebook from going to sleep when the lid is closed. This worked with Mac OS X 10.3.9 (Panther). YMMV. If you’re running a OS X 10.4 (Tiger) or newer, you might want to check out InsomniaX instead. InsomniaX should work with Mac OS X 10.4 and later. Download and decompress Insomnia.kext.tbz. I wasn’t able to retrieve a copy of from the Insomnia project’s home page, but I did grab a working copy off of the Internet Archive, which I mirrored here. I also mirrored a copy of the source code in the Insomnia.src.tbz file. Open a command prompt, switch to the directory that you decompressed Insomnia.kext.tbz to, and execute the following commands: sudo chown root:wheel Insomnia.kext # set the module to be owned by root mv Insomnia.kext /System/Library/Extensions # move the module to the kernel extensions directory cd /System/Library/Extensions # change to the kernel extensions directory sudo kextload Insomnia.kext # load the module Test the module by closing your notebook’s lid. If your Mac doesn’t go to sleep, you’re in business. You can unload the Insomnia.kext module at any time by executing the following commands: cd /System/Library/Extensions # change to the kernel extensions directory sudo kextunload Insomnia.kext # unload the...