Wednesday, July 02, 2008

 

Start Apple's X11 App on Alternate Port

First post in a looooong time, look at that!

Learned something today that I don't want to forget. For whatever reason, I can't get through on port 6000 over my office's new VPN. This was putting quite a crimp on my work-from-home flow, since 6000 is the default port of X11. There are a few ways around this, AFAIK:
I started down the ssh path. Unfortunately, I don't have access to root on the Sun servers at work (go figure!), and so naturally AllowX11Forwarding is set to NO in the sshd config files. Eventually I could have made this work, but it would require me to set up the tunnels by hand and blah blah blah. A little bit of time spent on it was a bit confusing and frustrating and not for me.

So then I thought, hey, why not just run the Apple X11 client at home on an open port? 6100 is open... so just use an offset (screen number) of 100, right? Only there is no preference for the port in Apple's app (at least not in MacOS 10.4). Fortunately, you can kick off X11.app from the command line like this:

> /Applications/Utilities/X11.app/Contents/MacOS/X11

(adjusted for your path, of course)

And all you need to do is throw a display number (offset) of 100 in there:

> /Applications/Utilities/X11.app/Contents/MacOS/X11 :100

And since I like the terminal to be available, I background the whole thing:

> /Applications/Utilities/X11.app/Contents/MacOS/X11 :100 &

Tada! X11 on port 6100!

Of course, when you login to the server, you have to set the DISPLAY variable to the IP address of your home computer and the correct port - like so (assuming tcsh shell):

> setenv DISPLAY 123.45.67.89:100.0

Saturday, October 27, 2007

 

DSC01988.JPG


DSC01988.JPG
Originally uploaded by Ray Cathcart
I'm just testing the Flickr blog function

Saturday, June 03, 2006

 

Dvorak Keyboard

I use the Dvorak keyboard layout on my computer. Most people agree that I am a pretty weird bird, but that is not actually why I started using Dvorak. The actual reason is this: I never learned to touch-type. I went through the first 28 years of my life typing hunt-and-peck style, and I actually got pretty good - something like 28 words per minute (WPM) if I am transcribing something, faster if I don't have to constantly look away from the keyboard. Many times, I tried to force myself to learn to touch-type, and many times I reverted to looking at the keys. I decided that what I should do is put little stickers over the keys so that there was no way that I could cheat.

This seemed like a pretty big inconvenience to my wife, however (and to whomever wanted to log in to my PC at work). As I browsed the web, I came across the Dvorak layout. I read that it was pre-installed on all Mac, Windows, and Linux machines... This allowed me to switch between both keyboards, minimizing the inconvenience of others. All my wife has to do is click on the little DV on the menu bar and change it to the little icon of the American flag.

So my touch typing? I'm not that great, since I don't actually type all that much, but my speed with the Dvorak layout is now about 45-50 WPM. That's fast enough to make me happy - and now I can transcribe stuff. My next goal is to teach myself to touch-type on the standard QWERTY layout, but with the new kid that's not likely to happen.

Tuesday, May 30, 2006

 

Fixing FlashGot for Mac cURL Use

FlashGot is a neat extension for Mozilla, Seamonkey, Firefox, etc. that gives you a lot of help downloading large numbers of links. I downloaded the FlashGot plugin for Seamonkey to make my allofmp3.com experience smoother, and was disappointed to find out that it does not support the Mac's built-in version of cURL as a download manager. Don't get me wrong, cURL is not a download manager - but all I really wanted was the whole list of mp3s that I purchased to download with one click instead of clicking on each one independently.

So I fixed it. The "fix" is a bit of a hack, but it works now.

Simply open up this file in your favorite text editor:
/Applications/SeaMonkey.app/Contents/MacOS/components/flashgotService.js

Note that flashgotService.js may also be in your Mozilla profile instead, but I chose to install it in my application instead.

Find the line that says:
var job="[ -x \"`which 'xterm'`\" ] && CURL_CMD='xterm -e curl' || CURL_CMD='curl'\n";

and change it to:
var job="CURL_CMD='curl'\n";

The problem is that FlashGot was trying to open cURL in an X11 window, which isn't going to work on a Mac unless you have X11 running all of the time and also have the environment set up properly.

You will not get any kind of feedback once you choose something to download. I check to see if something is still running by opening up a terminal window and typing:
ps auxww | grep -i curl

Which will dump out any curl processes currently running.

Sunday, March 12, 2006

 

Blogger Dashboard Widget

Google makes a new widget for Dashboard that lets you create a quick post right from the Dashboard on Mac X. I just needed to test it :) Says that it supports bold and italics. Yup, seems to.

Monday, October 10, 2005

 

pandora.com

Pandora.com is a very cool idea. It lets you build your own radio station, using a TiVo-style thumbs-up, thumbs-down controller for each song. Where it differs from, say, last.fm, is that it doesn't use other users or sales as the basis for similar music. Instead, they use a cadre of professional musicians who describe each song. It uses these descriptions to come up with a play list. It is fascinating and frustrating at the same time.

Fascinating because:

Frustrating because:

Now if there were a way to get this into your car/walkman... it would be cool to have an iPod Shuffle-like device with only 4 buttons on it: play, thumbs-up, thumbs-down, and skip.

So far, I've signed up for the 3 months for $12 deal. My wife and I are both hooked on it right now, but I could see the novelty wearing off. In fact, I think Abby might already be done with it.

update 11-Oct-2005:

Some more interesting observations:


update 16-Oct-2005:

Saving the Streams!

Yes, I've figured out how to save the streamed music! Turns out that the music is just regular old mp3s that are loaded onto your hard drive. On my Mac using Safari, the path is in /private/tmp, which is the standard temporary directory. Safari throws each downloaded song in there with a filename beginning with "WebKitPlugInStream". Some of these files are just small files containing song info, and others are much larger and contain the mp3. All you have to do is take the big files, make a copy of them, and add ".mp3" to the end. Ta-da! Now you have an mp3 file that you can open in iTunes, or whatever.

It seems like the Pandora player always queues one song ahead, so if you want to keep the currently playing song, just use the 2nd most recent big file. The most recent file will play next.

Obviously, this arrangement will be different if you are using Firefox, but I imagine it will be pretty much the same thing - only the file names and the location will be different. I wonder how long this will last before they get wise? Someone could easily write a GUI app that would do this automatically.


Saturday, July 30, 2005

 

Open up that firewall

Here's a "trick" from a unix novice. There is probably a better way to do this, but...

I have giFT (Poisoned is a front-end to giFT, so this will also work with Poisoned) running on my Mac, and it opens several different ports to listen. I wanted to make sure I had all of the ports opened up on the firewall, so first I fired up the terminal and typed:

netstat -an | grep LISTEN > before.txt

This dumps a list of all the ports that are currently listening (waiting for a connection) to the file called "before".

Now I start giFT:

giftd -d

Next I repeat the command that I used above, to see what new ports giFT has opened:

netstat -an | grep LISTEN > after.txt

You can either open both of these files and compare them manually, or use the diff utility:

diff before.txt after.txt

In my case (because I'm anal), I then went through and made sure that each of the ports was something that I actually wanted exposed to the internet - in this case there was one port (1213) that giFT uses for the GUI, so I chose to keep that closed. All of the others I opened up on the firewall.

This will work with any application - I'm just using giFT as an example.


This page is powered by Blogger. Isn't yours?