Archive for the 'Work' Category

Using SVN+SSH on Windows

Ealden, here’s how I do it:

  1. Install and prepare the Windows tools: Tortoise SVN and Putty.
  2. Create a session in Putty, named svnsession, for example. In Connection > Data > Auto-login username.
  3. Using the Tortoise SVN context menu (when right-clicking), select SVN Checkout. For the repository URL, type:
    svn+ssh://>putty-session-name</path/to/repo

    You may be prompted for a password. To avoid that, try using SSH keys.

Update: Also, make sure that the SSH client field (in Tortoise SVN context menu > Settings > Network > SSH) is left blank. Tortoise uses its own built-in SSH client to establish the connection.

Remote desktop through SSH

I sometimes telecommute. And when I badly need some files on my office desktop, I can connect remotely through the company’s SSH gateway and tunnel RDP to my desktop. Here’s how:

  1. Using PuTTY, create a new session for the SSH gateway.
    PuTTY session
  2. In Connection > SSH > Tunnels, add a new forwarded port: the source can be an arbitrary port number (e.g. 4444) and the destination should be the address of the remote desktop with the port set to tcp/3389 (the RDP port). Make sure the “Local” is selected because we will be forwarding the local port (4444) to the remote desktop’s port (remote.desktop:3389).

    Set tunnel

  3. Connect and log in in the SSH session. (We use one-time RSA SecurID passkeys, so I always keep that nob handy.)
  4. In Windows XP (yes, my notebook is still not free), open up Remote Desktop Connection, add connect to localhost:4444. This should then be forwarded through the SSH session to the remote desktop port 3389.

    Remote desktop connection

  5. You would have to authenticate again, and if all goes well, you’ll be presented with your remote desktop.
    Remote desktop

Steps 1 and 2 above can also be achieved from the command line, using Plink:

C:\> plink -N -L 4444:remote.desktop:3389 user@ssh.server.org

Take note that the SSH gateway must be able to forward tcp/3389. (Setting that up is beyond the scope of this post. ;)) It would have been great if the VNC port (tcp/5900) was set up as well, but unfortunately, only RDP is allowed. So to connect to my Linux box at work, I either use SSH or, in the remote desktop, open up TightVNC. It looks a bit surreal: having a remote desktop within a remote desktop.

Quickies

  • Registered diecastminis.com. Now, www.diecastminis.com point to my hobby blog.
  • My iandexter.net Google-hosted email is having DNS problems. Hay…
  • Wracking my brain all day, trying to figure out how to migrate Serena Version Manager files to Subversion. So far, PVCS-to-RCS has been successful, but it only gets the latest version — no version history!

Update: The DNS resolution issue points to my availment of a service from my domain registrar — turns out they had to point my domain to their name servers. Thus, the MX record for iandexter.net vanished. Fast propagation, though, as I got nearly instantaneous update.

Up-update: Interestingly, during the period when the MX record did not resolve, I still received spam mails. Spam is that resilient? I shudder at the thought.

Trivial desktop customization

I’m currently playing with Devil’s Pie, a utility that matches windows and window events to a set of rules similar to Emacs’ (yikes! :P) S-expressions.

I installed Devil’s Pie on my work desktop (running FC6), thus:

$ sudo yum install devilspie

(I have previously organized my desktop with four workspaces: for browsing, remote SSH sessions, remote desktop sessions, and other tasks.) I then created a configuration file:

$ mkdir .devilspie && vi ~/.devilspie/workspaces.ds
   (debug)
   (if (is (application_name) "Firefox") (begin maximize (undecorate (set_workspace 1))))
   (if (is (application_name) "Terminal") (begin maximize (undecorate (set_workspace 2))))
   (if (matches (application_name) "^rdesktop.+") (begin center (maximize (set_workspace 3))))

and invoked Devil’s Pie: devilspie -d ~/.devilspie/workspaces.ds &. The (debug) line in the configuration is, heh, for debugging purposes so Devil’s Pie will print out events and other information, which I can then later use.

Seems pretty straightforward, though there isn’t much functionality that I can use. (Then again, my requirement is minimal: I just want to group apps to different workspaces to avoid clutter.) I can then drop Devil’s Pie in my X startup script, along with the other startup apps.

CLI shortcuts, 7

(This is part of an ongoing series on Linux CLI shortcuts and hacks.)

After editing .bashrc and .bash_profile, you can reload the values by running

$ source ~/.bash_profile