Archive for the ‘Mac OS X’ Category

How to connect to a VNC machine that is behind a firewall using SSH tunneling, OS X and Chicken of the VNC

VNC is a very useful program for accessing a computer remotely. These are instructions for accessing a remote machine using OS X, Chicken of the VNC, and Vine Server when there is a firewall in the way.

VNC SSH Tunnel

Normally it is a fairly straightforward process to connect from a VNC client to a VNC server running on a remote machine. A firewall in the middle can complicate the process a bit.

Normal:
MY MACHINE -> VNC CLIENT < - -> VNC SERVER < - REMOTE MACHINE

Behind firewall:
REMOTE MACHINE -> VNC SERVER -> SSH TUNNEL < - -> VNC CLIENT < - MY MACHINE

  1. On MY MACHINE, create a local SSH user account and password - call it vnc_user
  2. On MY MACHINE, determine my public IP address - go to whatismyip.com (MY_IP_ADDRESS)
  3. On REMOTE MACHINE, turn on the Vine Server and set the password
  4. On REMOTE MACHINE, open up Terminal and enter the following command:

    ssh vnc_user@MY_IP_ADDRESS -R 5900:127.0.0.1:5900

    where MY_IP_ADDRESS is the IP address of MY MACHINE.

  5. Enter the password for the vnc_user. You should now be connected to MY MACHINE over SSH.
  6. On MY MACHINE, open up Chicken of the VNC. Connect to localhost and enter the password for the REMOTE MACHINE.
  7. You should now be connected to REMOTE MACHINE’s VNC server and be seeing their screen.
  8. Notes:

    • Make sure that you are not running a VNC server on MY MACHINE, or that it is turned off
    • If you are running a firewall on your own network, you may need to enable port forwarding for SSH to ensure that SSH requests on port 22 are connected to MY MACHINE and not blocked by your own firewall.

    Thanks to this article that describes how to do this and also includes an Applescript that makes the connection.

    Popularity: 5% [?]

150 open documents in Photoshop - long day of work

screenshot
This is after a long day of work building out a new website: TeamMercy.com. Lots and lots of graphics there. Good times.

Popularity: 15% [?]

Selling 12″ Powerbook G4 keyboard for parts [SOLD!]

Powerbook keyboard parts

We just replaced Kristin’s laptop’s keyboard since the up, down, right shift and enter keys don’t work anymore.

I listed the keyboard on eBay, so go there and bid on it if you’re interested in it for the parts.

Thanks!

Check out the eBay Listing: Apple 12″ PowerBook G4 Keyboard Keys (Full Set) NR!

Popularity: 5% [?]

How to sync audio and video for DVD playback using your remote speakers, AirPort Express, Rogue Amoeba’s Airfoil and VLC

Apple AirPort Express

I’ve been enjoying using my Apple AirPort Express to stream music from my laptop to our living room speakers using iTunes. The other evening I wanted to watch a DVD and use the good speakers to get the best sound, but you can’t do that without using a helper program.

Rogue Amoeba's Airfoil

I found a program that lets you route any audio signals to your AirPort Express — it’s called Airfoil (free to try out, $25 to purchase) and is made by Rogue Amoeba. It’s very simple to install and run. When I tried playing a DVD, though, the audio didn’t synch properly with the video.

This is the solution I found to fix the audio synchronization problem using VLC to play back the DVD and by adjusting the preferences and using VLC’s ability to buffer audio and adjust the synchronization settings.

How to increase audio buffering amount in VLC for DVD playback

  1. Open preferences in VLC
  2. Click on Advanced tab on bottom of screen
  3. Select Input/Codecs
  4. Select Access Modules
  5. Select DVD with menus [Note: to make this same adjustment when you are playing back regular files as opposed to DVDs, simply select File instead of DVD with menus and continue with the rest of the instructions]
  6. Change the default value (300 milliseconds) to 6000. This will increase the amount of audio data buffering to 6 seconds, which should be enough to synchronize the audio playback.
  7. Click Save to activate your changes (you may need to quit VLC to ensure the settings become active).
  8. Re-open the DVD using VLC and click Play.
  9. Click the “f” key repeatedly to adjust the amount of audio synchronization offset. It adjusts the audio offset downwards by 50 millisecond increments. I had to set mine to around -4900 milliseconds to correctly match the audio with the video output on my system. Press the “g” key to increase the offset in the other direction. Watch the actor’s lips and adjust the offset until it matches perfectly.
  10. Enjoy listening to your DVD audio through your speakers, streamed wirelessly!

Hacking the Gibson

Download VLC (Free Open Source video player)

Download Airfoil

Popularity: 10% [?]

Google Gears (BETA)

Interesting…

Google Gears (BETA) is an open source browser extension that enables web applications to provide offline functionality using following JavaScript APIs:

  • Store and serve application resources locally
  • Store data locally in a fully-searchable relational database
  • Run asynchronous Javascript to improve application responsiveness

Check it out: Google Gears (BETA)

Popularity: 6% [?]

How I got networking working on my Powerbook using Single User Mode in OS X

You NEVER want to see this on your Mac.

Update: It turns out that the reason my laptop had this problem in the first place was one of my 1GB sticks of RAM that had gone bad after running with zero problems for over a year. The kernel panics happening on a totally clean install of OS X was a clue, and then using the hardware test CD that originally came with the laptop confirmed that it was indeed bad RAM. Bad RAM sucks!

I had an unfortunate thing happen today — my trusty Powerbook decided that it had had enough and that it was going to lose it’s mind. It froze while I was working on the new version of Kristin’s website (not up yet…)

At first I was like, hmm, that’s annoying. That feeling turned into, oh crap, my laptop is broken when it wouldn’t finish booting up.

A quick Google using my Treo reminded me of the OS X startup key command to enter single-user mode (it is CMD+S). First, though, I tried the command for a verbose startup so I could see what the problem was (CMD+V). Verbose startup indicated that something was wrong with the hard drive meta data. So I decided to try starting up in single-user mode and then ran fsck -f to see if it could fix the problem. No love there.

This is the error message that showed up:


localhost:/ root# fsck -f
** /dev/rdisk0s3
** Root file system
** Checking HFS Plus volume.
** Checking Extants Overflow file.
** Checking Catalog file.
Keys out of order
(4, 23212)
** Rebuilding Catalog B-tree.
** The volume New Hotness could not be repaired.
localhost :/ root#

CRAP!!!!

At this point in time, I am VERY grateful that I had recently (~3 weeks ago) made a full backup of my entire drive (over 60GB of applications and data). All of the source code for my work projects are under version control (Subversion) so I’m pretty good there even without backups. But what about the new work that I had been doing on Kristin’s site? That wasn’t backed up, hadn’t been checked into version control yet, and had considerable amount of work done that was stored in the MySQL database.

After doing some research about possible ways to fix this error (going to go into the Apple store tomorrow morning to see if they have a DiskWarrior disk that we can use to try to fix the Catalog B-tree problem), I thought it would be a really good idea to get Kristin’s site source code onto another machine so I would have a backup of that. Oh, and maybe also it would be a good idea to copy the 1+GB of China pictures that I hadn’t backed up yet (but had deleted off my camera!). Also, email inboxes, and other home directory files that I knew weren’t part of the 3 week old backup.

Mounting my laptop in Firewire Target Disk mode (hold down T during startup) didn’t work (it didn’t mount when I plugged it into Kristin’s laptop). Booting up using the install CD only gave me options to install a fresh system or use Disk Utility, which didn’t give me the options I was looking for.

So, the problem that I now faced was this: How do I mount a drive or get network access using Single User Mode?

Lots of searches didn’t turn up any solid answers, until I found this command on the MacOSHints forum archives:

/usr/libexec/kextd
/usr/sbin/configd

So first I ran mount -uw / to mount the root filesystem in writable mode. Next I ran the commands that I found. The kextd command output a few errors, but exited cleanly otherwise. The configd command got networking running. YAY!

Once that was running, I plugged in an ethernet cable between my laptop and Kristin’s, and turned on the built-in SSH server on her laptop using the System Preference panel (Sharing > Remote Login > Start). I was then able to successfully SSH into her system and copy over all of the needed files.

Hopefully I won’t need to utilize these backups, but it is a great relief to know that I have them if needed.

I hope this can be helpful if you get in a similar jam.

My System Specs:
I’m running the latest version of OS X 10.4.9, have 2GB ram and an upgraded hard drive in a 15″ PowerPC Powerbook.

DISCLAIMER: I’m pretty sure that my laptop is really screwed up right now, and has kernel panicked and segmentation faulted a couple of times during transferring of files. If you find yourself following these directions, then you are probably already screwed too. But know that I am not responsible for what you do and also I don’t know if my copying over these files may have in fact screwed things up even more than they already are. So, your mileage may vary, proceed at your own risk, etc.

Popularity: 4% [?]

How I used the Unix command line to do a multi-file search and replace to fix over 4,700 individual files

Evil hackers attack!

Some customers of mine recently reported some suspicious behavior on one of their sites. I discovered, with dismay, that a number of months ago there was a nasty cPanel exploit that some evil hackers had used to insert a malicious line of code into the bottom of every HTML page on this server. After verifying that the cPanel installation had been fixed, I used grep to search through all the files on the server to see if any other files had been touched by the hackers. I found over 4,700 individual files that had malicious code added and knew that something needed to be done immediately to address this problem.

Not the best way to start my day…

(more…)

Popularity: 9% [?]

DiddleBug Extractor 2.1 - Palm DiddleBug image extractor script for OS X, Windows, Linux (Replaces Didcon 2.0)

DiddleBug Extractor 2.1

DiddleBug drawing - crow

Drawing pictures on your Palm

I use an excellent free Open Source program called DiddleBug on my Palm Treo 700p for doing small black and white drawings. The latest version of DiddleBug creates 320×320 pixel size drawings. These are referred to on their site as “high-res” pictures instead of the 160×160 pixel size drawings that older versions of the software created.

Getting DiddleBug pictures off your Palm

I used to use a nice converter on my Windows laptop called WindleBug but wanted to be able to just use my Mac laptop by itself instead.

The DiddleBug FAQ mentions using a Perl script called Didcon on Windows, Linux and OS X which hadn’t been updated yet to extract the new 320×320 pixel sized images. When I ran the Didcon script for the first time, it saved out a 160×160 graphic that had weird lines running throughout it, due to the fact that it wasn’t reading out the data for a 320×320 pixel sized graphic.

After hacking at it for a little while, including researching how to correctly indicate the pixel size of an image in a Windows bitmap in the header of the file, I managed to get a working script that correctly outputs a 320×320 .bmp file.

This is the modified script, and I’m also including a second script that you can double-click in the Finder to run the extraction process.

(more…)

Popularity: 11% [?]

Searchball - Google Pagerank checker for Safari

Howto check Google Pagerank using Safari:

  1. Go here Searchball - Google Pagerank checker for Safari and add the bookmarklet to your browser bookmark toolbar.
  2. Click the bookmarklet whenever you want to know the Pagerank for the site your are viewing
  3. A small window will appear telling you the Pagerank.

I just finished making some adjustments to Searchball. This is a small little service that gives you a bookmarklet that lets you check the Google Pagerank for any site simply by clicking it. This is really nice if you are using Safari or any other browser that doesn’t have a Google Toolbar or browser extension (like Firefox) that supports showing you the Pagerank of the site you’re viewing.

Check it out: Searchball - Google Pagerank checker for Safari

Popularity: 5% [?]

Auto level your audio recording with The Levelator from GigaVox Media (for podcasts)

GigaVox Media, Inc. - The Levelator

What is The Levelator?

Do you believe in magic? You will after using The Levelator to enhance your podcast. And you’ll be amazed that it’s free (for non-commercial use).

So what is The Levelator? It’s software that runs on Windows or OS X (universal binary) that adjusts the audio levels within your podcast or other audio file for variations from one speaker to the next, for example. It’s not a compressor, normalizer or limiter although it contains all three. It’s much more than those tools, and it’s much simpler to use. The UI is dirt-simple: Drag-and-drop any WAV or AIFF file onto The Leveler’s application window, and a few moments later you’ll find a new version which just sounds better.

It’s a java app that auto-levels your audio, which I’ll be checking out for the Lafayette Square Christian Science Society podcast. If this works as advertised it will be a huge help and timesaver.

Popularity: 4% [?]