Monday, March 31, 2008

First python script

Did my first successful python scripts! The first simply imports the second, the second checks the existence of a network connection.

Thursday, March 20, 2008

NTFS external drive

For fun, I checked my external drive while booted in Windows. Oh no! It needed to be defragmented! Defrag recommended CHKDSK as well.

Big mistake: One or both of them scattered a lot of my backup files (including the backups of this blog - quite a few entries gone until they turn up again). I'm afraid to look at my music...or my collection of Futurama episodes. Only fix is to hunt through the 'found' folder and put stuff away manually. Big mess.

Thursday, March 13, 2008

Tesseract OCR

Tesseract is a very powerful OCR package that works only from the command line. Imagemagick is a very powerful image conversion toolkit. To OCR a PDF:

convert inputfile.pdf covertedfile.tiff
tesseract covertedfile.tiff textfile
. That's amazingly easy.

Deluge crash recovery

I just figured out that Deluge saves a quick-resume file in the same folder as the torrent (/home/me/.config/deluge/torrentfiles). I wondered how often it updates - now I suspect it updates every time Deulge successfully quits without an error.

If so, then a good idea is to quit and restart Deluge every 6 or 12 hours or so, thereby limiting the loss from a crash.

My external drive is NTFS, and likes to crash on I might start setting my timer.

New MacBook - File Sharing

File sharing is finally easy. System Preferences -> Sharing -> Turn sharing on. Option to log in as the user for total access. At last. The MacBook and iBook share wonderfully. Haven't been able to get the Linux box or the XO laptop on board yet - they see the file shares in Avahi, but can't connect to them.

Sunday, March 9, 2008

New MacBook - Migrating

The new MacBook arrived a couple days ago, and I finally touched it tonight. The new MacBook had OS 10.5, the old iBook has 10.3.9. The iBook wouldn't run the Migration Assistant, and I don't have a Firewire cable we used the house wireless, I logged into the iBook through file sharing on the MacBook, and moved most of Library by hand. Great web page detailed which files to move...but can't find it any more.

Saturday, March 8, 2008

Sharing Music Files Using Avahi

Success! I successfully shared my Linux (Ubuntu 7.10) music files to the Mac using Avahi on a wireless network. Now, if the Mac and Linux boxes are on the same network, the Mac can see and play any of the Linux songs.

How I set it up (surprisingly easy):

  1. Install package mt-daapd for the service, and package avahi-discover as a diagnostic tool.
  2. Open a web browser to localhost:3689, Username: (blank), Password: mt-daapd. The project is called Firefly Server.
  3. On the Configuration tab, put in the directory to music files. On the Server Status tab, click Start Scan.
  4. Open the Mac and launch iTunes. Look in the Shared section for the Firefly Server, and test play a file.

No mucking about with .config files, no command line work, no ports or services to modify.

We'll see if it works after a reboot. Still need to figure out how to share iTunes music with Rhythmbox, and how to share both wth the OLPC. Still need to figure out how to share video files, and other non-media files.

Mounting a USB stick drive on an OLPC Laptop

Success! How do you mount a USB stick on an OLPC laptop and get a window of the contents?

Tip #1: Try several of the USB ports. I was successful in the lower right side port.

Tip #2: Once inserted, the USB stick will automount under /media/UsbStickName. Just do an ls /media/ to see your stick there.

Tip #3: For the GUI, look in the Journal. The stick shows as an icon on the bottom. Click it, and the window of contents opens!

Tip #4: To unmount and eject the drive, use the Journal's USB Drive icon. Trying to use the umount command in Terminal fails, claiming the drive is busy.

The joy of cURL

curl is a wonderfully useful and scriptable upload/download tool. For example, instead up firing up FTP to upload this page to my website, I figured out that I can open a Terminal and enter: $curl -v -T localpath/TechBlog.html -u username:password And it does the whole thing for me!

Cleaned out orphaned packages

Periodically, I use the terminal command deborphan to clean out orphaned packages. Found eight or nine.

It's easy to use. Deborphan merely lists the items. I use Synaptic to remove them.

Update - It's easy to use apt-get autoremove to do the same thing without an additional package.

Friday, March 7, 2008

Fixed Toshiba Sound!

Since the reinstall, there's been no sound in Linux. Xubuntu has output no sound. Found the following solution on the Ubuntu Forums.

Edit the alsa config file: sudo mousepad /etc/modprobe.d/alsa-base

Added the following lines at the bottom of the file:

# Fix for Toshiba sound. From Ubuntu Forums
options snd-hda-intel model=auto

We'll see how it works at the next reboot.

Wednesday, March 5, 2008

New MacBook on the way!

My wife's old iMac G4 started making an ugly sound last night.

So I backed it up immediately. We looked at the loose power connector, the buckling casing, and the noise...and decided it had become unreliable. So I ordered a replacement today.

Looks like the kids get a spiffy toy.

Reinstallation fallout

<p>So far, only three problems with the reinstallation.</p>
  <li>Some data from my shared partition was lost - my backup wasn't as thorough as I thought. I also had to reenter all my e-mail accounts to Evolution (backup copy on the Mac, whew). Nothing critical, just minor annoyances...and a couple Doctor Who episodes.</li>
  <li>The trackpad was fine for the first day, then suddenly became jumpy and unusable today. Looking through various forums, it seems I'm not alone. May or may not be related to the reinstall. On Windows, it was intermittent. On Xubuntu, it's always bad.</li>
  <li>Sound works great on Windows, no sound at all in Xubuntu.  Well, I kind of expected it...</li>

Tuesday, March 4, 2008

Dual Boot (Win XP / Linux) Reconstruction

<p>I decided not to wait until April...</p>
<p>Downloaded and burned an Ubuntu 7.10 Alternate CD. Reinstalled Windows (snore, 1 hour of installing, 2 hours of updating and faddle). Installed Ubuntu 7.10.</p>
<p>Uh-oh. No I didn't. The Ubuntu CD was corrupt, and instead hosed everything again.</p>
<p>Reinstall Windows while using the Mac to download and burn an Ubuntu 7.10 Live CD.</p>
<p>The live CD passes the self-test, but then is no longer recognized as bootable by the laptop.</p>
<p>Use the installed Windows to download and burn Xubuntu 7.10 live CD. At the same time, installed Quickbooks and Openoffice, and de-bloated the tiny (10GB) Win partition. Even used the 'compression' feature to squeeze 2.5 GB free space.</p>
<p>Install Xubuntu 7.10 - Success! Lots of adding and updating, but it's done. The laptop is usable again.</p>

Monday, March 3, 2008

Quickbooks Repair on the store PC

<p> I located the store's .qbw file on my laptop (the Linux partition is still fine), moved it to a stick, and took it to the store. Goal: Install the latest company data on the store PC, since I had been updating at home.</p>
<p><code>QuickBooks has encountered a problem and needs to close. Microsoft Visual C++ Runtime Library Runtime Error! Program: C:\PROGRAM FILES\INTUIT\QUICKBOOKS\QBW32.EXE</code></p>
<p>Okay, go to Add/Remove Control Panel and repair it...</p>
<p><code>The following error occurs when trying to register the QuickBooks items:
    Internal Error 2908 {7D4B5591-4C80-42BB-B0E5-F2C0CEE02C1A}</code></p>
<p>Argh. Turns out I had weeded unused programs last week. I hate bloat. I had removed <code>Microsoft .NET Framework 2.0</code>. Who knew it was installed by Quickbooks?</p>
<p>Put in the Quickbooks CD. It recognized that the correct component was missing, and installed it. Ejected the CD and put it away.</p>
<p>Went back to Add/Remove and the Repair option. It chugged a while (20-30 minutes) and reported success. Tried it with the moved company file....success! We're back in business.</p>

Sunday, March 2, 2008

Scripting and CURL

Learning to use curl, to download schedule information. Using a tutorial to guide me through the minutae of faking forms and another to guide through scripting it into BASH.

Saturday, March 1, 2008


Cool! Package apt-rdepends installs a shell command (also apt-rdepends) that gives a clean list of all dependencies. Reverse searching is also possible. I needed something like this in Iraq, when I was upgrading by hand due to a lack of internet connection for my laptop.

Interestingly, Synaptic has grown a script-maker for offline package changes. It generates a script that you use on a connected machine to download the right packages. I could have used that, too...

Now they are merely of academic interest - unless I go back.

Instead of using the apt-rdepends package, you can get the same result using the apt-cache rdepends packagename command.