Tech Archives, page 20

All things technology. Very popular here on Justinsomnia.

Windows Vista Point

Vista Point, The Wow starts now.

I can’t be the only one who’s thought it. (I, however, take the Alexander Ave exit to get to work.)

In related news, I’m planning on moving my primary laptop (Thinkpad T42) over to Ubuntu (for reasons mentioned earlier). It’s been running just fine on my X23 for the last few months, and at work since I started at FM. I like the painless package management (Synaptic). I like that I can do development on it. I like that there’s a new release every 6 months.

I will miss Fireworks MX 2004, but remain hopeful that Wine will one day support it (or Adobe will open source it). It appears that Fireworks 8 works!

Update: For future reference, the [surprisingly small list of] apps that I use on Windows, and their Linux equivalents, where different.

Windows Linux (if diff)
Acrobat evince
BitPim
EditPlus EditPlus + Wine
Excel OO Calc
Firefox

  • BugMeNot
  • Copy as HTML Link
  • Firebug
  • LastTab
  • Live HTTP Headers
  • Resizable Form Fields
  • Searchbar Autosizer
  • Web Developer Toolbar
Fireworks
Gaim
Gallery Remote
Hugin
SecureCRT Terminal + SSH
Winamp Rhythmbox
WinSCP SSH
Word OO Writer

Goodbye Windows, it’s been nice knowing ya.

How to regularly backup Windows XP to Ubuntu, using rsync

Back in September I revived my Mini-ITX box to serve as a backup server. I set up BackupPC, ran it once, it seemed to work, and then ignored it for weeks. When I checked back, it hadn’t run successfully since. Ugh, I want backups to just work!

A few nights ago I decided to try again, this time dropping the constraint of not installing software on my laptop. Turns out I already had the building block I needed: rsync, installed in the form of Cygwin.

I began with these Rsync for Windows instructions, and everything went smoothly until the very end—rsync on Windows wasn’t connecting to rsync on Ubuntu. My gut told me rsync’s port 873 isn’t open on Ubuntu, but I had no idea how to open ports anymore. Luckily I found How to start rsync daemon at boot in the Ubuntu forums which told me exactly what I needed to know.

Partly as an aide to my memory, and partly to help anyone out there who might be struggling with the same project (unless everyone except me is already backing up their computers) I decided to summarize the process without all the false starts and dead ends it took me to figure it all out. For more information, the rsync man page is useful, as well as the results in Google for windows rsync.

Set up rsync server on Ubuntu

  1. Run sudo apt-get install rsync (it’s probably already installed)
  2. Create a file named rsyncd.conf in /etc
    1. sudo nano /etc/rsyncd.conf
    2. Add the following to rsyncd.conf, replacing all instances of username with your Ubuntu username:
      [usernamebackup]
      
          path = /home/username/backup           
          comment = Backup                                      
          uid = username
          gid = username
          read only = false
          auth users = username
          secrets file = /etc/rsyncd.secrets
    3. sudo chmod 644 /etc/rsyncd.conf
  3. Create a file named rsyncd.secrets in /etc
    1. sudo nano /etc/rsyncd.secrets
    2. Add the following to rsyncd.secrets, replacing username with your username and password with a password of your choosing:
      username:password
    3. sudo chmod 600 /etc/rsyncd.secrets
  4. Open rsync port by editing /etc/default/rsync and setting
    RSYNC_ENABLE=true
  5. Restart rsync
    sudo /etc/init.d/rsync restart

Set up rsync client on Windows

  1. Install Cygwin, making sure Editors > nano and Net > rsync are selected
  2. Add C:\cygwin\bin; to the Windows PATH statement
    1. Right-click on My Computer and select Properties
    2. Switch to the Advanced tab and click the Environment Variables button at the bottom
    3. Find the “Path” or “PATH” variable in the System variables list at the bottom and click Edit
    4. Add C:\cygwin\bin; to the beginning of the list
  3. Create secret file to store password in Cygwin
    1. Start Cygwin Bash Shell
    2. Create secret file in the filesystem root and enter only the password in rsyncd.secrets above, with no spaces or line breaks
      nano /secret
    3. chmod 600 /secret
    4. chown Administrator:SYSTEM /secret
  4. Create bat file to run rsync
    1. Open Notepad and enter the following command, replacing User Name with your Windows User Name directory, username with your Ubuntu username, and ipaddress with the IP address of your Ubuntu server (e.g. 192.168.0.100):
      C:\cygwin\bin\rsync.exe -qrtz --password-file=c:\cygwin\secret --delete "/cygdrive/c/Documents and Settings/User Name" username@ipaddress::usernamebackup

      As you may have guessed, the "/cygdrive/c/Documents and Settings/User Name" command line option designates where to start backing up from. As currently configured, this will backup your Windows home directory (Desktop, My Documents, etc). If you want to backup your whole hard drive, change that option to "/cygdrive/c".

    2. Save the file as C:\rsync.bat

Create scheduled task to run C:\rsync.bat once a day

  1. Create scheduled task
    1. Goto Start > Programs > Accessories > System Tools > Scheduled Tasks
    2. From the File menu, select New > Scheduled Task
    3. Name this task “rsync backup”
    4. Right-click on the task and select properties
    5. Enter C:\rsync.bat in the Run field
    6. Switch to the Schedule tab and select the time you want the backup to run every day and click Ok
  2. Test the scheduled task
    1. Create a folder called C:\data and put a few photo files in it
    2. Edit C:\rsync.bat and change "/cygdrive/c/Documents and Settings/User Name" to "/cygdrive/c/data"
    3. Add the command pause on a new line at the bottom of C:\rsync.bat and save the file
    4. Right-click on the “rsync backup” scheduled task and select “Run”—A command window should popup and with either errors or the list of files being transfered. If there are errors, troubleshoot them.
    5. Once the scheduled task and C:\rsync.bat appear to be working correctly, change "/cygdrive/c/data" back to "/cygdrive/c/Documents and Settings/User Name" and remove the pause command
    6. Finally, edit the scheduled task properties and change “Run as:” to NT AUTHORITY\SYSTEM—this will ensure that the process runs in the background, without popping up a command prompt window

Run your first backup

Run C:\rsync.bat from the command line before going to bed. Backing up 35GB over a wireless-g connection took me over 8 hours. Subsequent backups take less than a minute. Behold the beauty of rsync.

Update: for information on how to backup Ubuntu to Ubuntu (or Linux to Linux really) using rsync with passphraseless keys, check out Playing with rsync on Ubuntu. For information on backing up Ubuntu to an external hard drive, check out How to rsync your Ubuntu home directory to an external hard drive.

How to manage a self-hosted WordPress blog from Windows

…or how I manage my self-hosted WordPress blog.

Get webspace

Install WordPress in your webspace

Continue Reading

CAPTCHA insecurity

CAPTCHA sampleI worry about the day when I’m no longer able to correctly answer CAPTCHAs, and computers stop thinking I’m human.

Digg.com CAPTCHA

The story of a laptop

I’m writing this on an old friend, resuscitated.

Back in 2002, I purchased my first laptop, an IBM ThinkPad X23. It had an 866MHz Mobile Pentium III processor, 256MB of RAM, a 1024×768 resolution screen, and best of all, it weighed a mere 3lbs. It was so small and light I could bring it anywhere. And I did. All around the world in fact. To me this was the epitome of what a laptop should be. So portable, you’d forget you even had it with you.

Three years later I was out of school, and its extreme portability was less of a priority. I was looking for something with a little more screen real estate. So I upgraded to a newer (and slightly heavier) model, the T42—which has been my primary computer ever since.

Meanwhile the X23 has lived a rather circuitous and lonely life. I sold it to my brother (on installment) and within a month or two it died on him. It would start up and run for a few minutes, and then just shut off. He held onto it for a few months—until we salvaged his data off the hard drive—and then my dad took it home to Texas to poke around. He took the whole thing apart (I think I remember seeing it in some state of disassembly last Christmas), but he couldn’t uncover the cause of the problem.

A few months later, I get a box in the mail. It’s the laptop, reassembled, still nonfunctional. It’s my problem now. Along with all my other things, it got packed up and moved down to San Francisco, where for the last few months it’s been sitting in a brown paper grocery bag, hard drive-less, on a shelf of things Stephanie and I don’t know quite what to do with.

Why am I telling you all this? Well, since I started riding the bus to work, I’ve read the free weeklies, I’ve been slogging through a book, but sometimes, especially right after work, when I have to physically pry myself from my computer to catch the bus home (lest I wish to wait another hour for the last bus of the night), my brain is looking for something a little more interactive. That and it’s completely dark out now.

I thought about getting a GameBoy Micro (everyone at work has been talking PSPs and PS3s and XBOX 360s and Wiis lately), but I’m not sure I’d only want to be playing games—I’m not sure I’d want to start. I thought about getting one of those neat Archos audio/video players like Kyle has, but I’d probably wish it had a keyboard so I could blog.

And then it occurred to me: what I want is a computer! I don’t want to lug my T42 around all the time (and risk breaking it), but the X23 is light enough and battle hardened enough that it just might do. All I had to do is find another X23 on eBay (preferably one with a busted screen) and swap out the motherboards!

Sure enough, the first day I looked, there were two different models sans functional screens. One was completely stripped down (not even a hard drive), the other had all sorts of accessories. Thanks to some last minute bidding, I won the auction for the former, for a mere $78. I ordered a new 60GB 7200RPM hard drive ($90), and I bought a new 802.11b/g mini-PCI wireless card ($40) on the off chance that I could upgrade my frankenlaptop to speak 802.11g. (My laptop already had a new battery and the memory upped to 640MB—for my brother.)

The broken laptop arrived on Monday, and I immediately set to disassembling both and swapping out the motherboard. Of course it wasn’t until I’d taken the new laptop completely apart that I realized all I had to do was remove the LCD screen assembly (with its integrated wireless antennas) from my laptop, and install it, along with my 802.11b wireless card, on the new laptop.

Justin performing open laptop surgery

Taking the computer completely apart did provide one rare insight. The thermal paste that connected the fan to the CPU looked pretty dried up on both models. It’s possible (now that I think about it) that the reason the laptop would freeze a few minutes after turning it on was because the CPU was overheating. Doubly strange was the behavior that if you torqued the base of the laptop just so, it would run flawlessly. Perhaps we were inadvertently restoring contact between the fan and the processor? Maybe my old laptop’s guts might actually be salvageable after all? Now all I need is another screen!

Amazingly I had some thermal paste in my box of parts, so I applied some as I put the computer back together. Meanwhile I not-so-patiently waited for my new hard drive to arrive. Today it finally did, as promised, along with the new mini-PCI card, so I put everything together, popped in an Ubuntu 6.10 CD I burned last night, and powered the thing up.

We have liftoff!