Diatribe, Macintosh, Tips, UnixAugust 19, 2008 11:41 am

I’m sure everyone with Unix experience has their own cherished best practice to compile software from source. I’ll try to tone down the soapbox.

What set me off was a TidBITS article on DNS (at work, we compiled that patch as soon as it came out). I was ready to yell at my computer screen! They got it right about the need to patch right away, but wrong on how to do it well.

The very basic process to compile from source is:
./configure
make
make install # as root

Well, I like to log the results of those three commands; if it fails to build, I’ve got something to study later without worrying about my scroll buffer. I also like the visual feedback of how the compile is going, so I also want to see the output as well as logging it to a file. The reason why make install is its own step is so that you can follow the principle of least privilege. My method does all of those things.

./configure | tee configure.out
make | tee make.out
sudo make install | tee make-install.out

Feel free to choose your own file names, or switch to root instead of using sudo (potentially more secure, but longer). However you do it, just keep in mind that logging and least privilege are Good Things.

Macintosh, Favorite Software, Project, Journal, UnixMay 22, 2008 9:58 pm

I use certain “boilerplate” text in all of my scripts for work. I use the same toolsets with the same setup in different combinations with different filtering, but getting started is always the same. So far, I’ve been happiest with Idea Knot, but I’ve always wanted to that flexibility in a format I could easily share with others.

So yesterday I started looking for a JavaScript, XML, or PHP way to display external files selectively. I did not find an easy PHP approach with Google. I found an XML merge that I thought would be easiest to configure although a little harder for others to use, but it didn’t work for me. I probably didn’t configure my input XML files properly, although they passed xmllint. I have ideas on what to tweak to get it to work, but I decided instead to maximize my time and move on to what would be easier for everyone (myself included!) to use: JavaScript. I found an excellent tutorial on including other files on a web page, with an example. There’s another example that converts the other file before displaying it. Very cool! So I whipped up a quick variant using my files, and what do you know?: it worked! Since I have no experience with JavaScript, I’m allowed to be surprised that it was easy. I even understand what the code does! Very nice.

On the first pass, I found how to do this with JavaScript with all of the boilerplate contained in JavaScript variables, but that made the monolithic web page so very large. Also, I do update my boilerplate as I learn new tricks and add new toolsets, and updating a monolithic page is tedious to say the least. So that’s when I started looking for a way move from inline variables to external files to store my code building blocks. I feel good about using good code that I understand, and storing my information in multiple external files that will be easy to maintain.

Building the code generation page and moving from Idea Know to external files will take me a while, but at least now I have all of the components needed. This will be a useful tool to share at work!

Macintosh, Tips, UnixMay 7, 2008 7:55 pm

I need to remember how to do this trick, using sed on literal tabs, which you can usually get by typing ^v. Control-V, Tab allows sed to operate on tab characters. Yes.

Tips, Journal, Unix, iPodApril 26, 2008 6:26 am

I like my iPod touch as a handheld web browser using WiFi. Yes, it’s expensive for that niche when you could probably use the slower Nintenndo DS Browser or other applications, but then you have an iPod for music, podcasts, or (my favorite) video podcasts.

However, I hit a stumbling block for a minute when I couldn’t find the tilde on the soft keyboard. Then I agreed, tilde (~) should not be used in Web addresses. Luckily I remembered %7E on my own, and I know that is URL encoding. You could use an online URL encode/decode page, a self-contained page that can be saved for offline URL encoding and decoding, sample JavaScript to write your own, or these excellent shell scripts called urlencode and urldecode.

Macintosh, Favorite Software, Tips, TroubleshootingMarch 4, 2008 8:54 pm

I downloaded the Import QIF 3.0.0.1 plugin for Buddi 3.0.0.7, but then I had a terrible time importing the data I just exported from Quicken Deluxe 2002 for Macintosh (OS X).

  1. Export each account one at a time. (Pain.) Do not check any export options, just a single account with no categories or budgets or anything else. I don’t think I needed to convert line endings (tr '\r' '\n'), but I did anyway.
  2. Delete all lines before the date of the first transaction (with the account information).
  3. Now I could import that modified QIF into Buddi without ERROR: java.text.ParseException: Date could not be parsed:
  4. .

In retrospect, that doesn’t sound too bad, but I sure did spend a lot of time modifying date stamps before I tried this!

The good news is, I moved my data, and if I’m lucky, I won’t go back to Quicken and Intuit’s terrible customer service!

, , ,

Macintosh, Favorite SoftwareFebruary 29, 2008 4:34 pm

Rats! Now that I’m totally hooked on Quicksilver, I hear it’s going to die. Read the Lifehacker Interview with Quicksilver’s creator on the (gloomy) future of QS. sigh Maybe I’ll be able to retrain myself to use Spotlight instead.

,

Macintosh, Favorite Software, TipsFebruary 1, 2008 11:45 am

You’d think it would be easy (possibly even included) to import a text file, probably CSV, into iCal. But nooooooo it’s not. Luckily, there’s iCalTextImport for the job. I just wanted to enter the school year calendar without having to enter the data manually because copy and paste are wonderful tools!

,

Macintosh, TroubleshootingJanuary 22, 2008 9:46 am

My laptop keyboard’s been out most of the past month. It was never right after it got doused in water, even though I replaced. There’s a fuzz connector under the T, G, and Y keys that connects the keyboard to the motherboard. Ever since I replaced the keyboard, I’ve occasionally had to press down on those three keys very firmly in order to regain keyboard and trackpad. Well, one day last month that trick stopped working. (Luckily I have an external USB keyboard and mouse so I can keep working.)

The ambient light sensor for the backlit keyboard always works, so there’s power to the keyboard. However, none of the keys work (not even the CAPS LOCK light).

This failure is different, though. I have keyboard right after the laptop boots, but after a while, it goes out (and no amount of pressing on TGY brings it back). For instance, one time I lost keyboard in the middle of typing 11 minutes after a reboot (I was on AC). The next time I was on battery, and it took two hours to go out. That would indicate a heat problem, and fuzz connectors aren’t the most solid connection under the best circumstances. However, I think it’s load-related (keyboard goes away when I see the CPU head up) more than power-related. So still a heat issue, but more about CPU than AC versus battery.

However, I collected a list of suggestions from the Internet on what to try for PowerBook G4 keyboard problems.

  1. Disk Utility’s Repair Permissions
  2. Zap RPAM by pressing COMMAND-OPTION-P-R immediately after the startup chime. (This was tough, until I let the laptop cool off for a couple hours so that the internal keyboard worked because the external keyboard isn’t loaded in time.) I also tried the Open Firmware zap by pressing COMMAND-OPTION-O-F immediately after the startup chime and then running these commands: reset-NVRAM, set-defaults, and reset-all which made it reboot normally.
  3. Reset PMU by pressing and holding the power button for 5 seconds when the laptop has no AC and no battery.
  4. Try safe boot by pressing the SHIFT key after the startup chime.
  5. sudo rm ~/Library/Preferences/com.apple.BezelServices.plist /Library/Preferences/com.apple.BezelServices.plist
  6. Reapply last combo update.

Yes, these are predominantly software fixes for what appears to be a hardware problem, but it doesn’t cost anything to try. It does make the new MacBook Air very tempting, but I don’t want onboard Intel graphics.

  1. Update 1/19/2008: Repair Permissions didn’t fix the keyboard.
  2. Update 1/21/2008: Neither form of zapping the PRAM fixed it.
  3. Update 1/27/2008: No luck resetting the PMU. Twice.
  4. Update 1/29/2008: Safe boot didn’t fix it.
  5. Update 1/31/2008: Removing BezelServices didn’t change anything keyboard.
  6. Update 2/12/2008: Combo updater was not the ticket either.

So it looked like a hardware problem, and sure enough, I think this proves it. The fuzz connector between keyboard and motherboard can only be reset so few times, and I went over the limit. This laptop will just have to stay docked …

,

Macintosh, Tips, TroubleshootingJanuary 19, 2008 11:45 am

Ah, I finally figured out why I couldn’t close windows (just tabs) in Safari! I still had the Taboo 0.3 bundle loaded. Remove it (Safari now warns you when you’re quitting with multiple tabs or windows open), and I can close Safari windows again. Whew. It’s pretty annoying when you can’t close Safari windows!

, , ,

Macintosh, Tips, UnixJanuary 10, 2008 4:01 pm

I thought I was going to go batty trying to get a reasonable blank version of Lewcid’s presentation in TiddlyWiki because I could not download a version that I could edit! Yes, I tried the #author:true URL, but nothing changed. Well, when your browser fights you, use something else!

curl -O http://lewcid.googlepages.com/presentation_empty_full.html

Anyway, now to see if I think slides in TiddlyWiki are easier than slides in S5. I’m using OmniOutliner to organize my talks, saving as OPML, and using an XSL to convert to S5. I have two problems with this approach: my notes aren’t converted from OPML to the handout (print, not slides) section, and the XSL is cruel to links and images. So before I run the XSL, I mangle the URLs with sed, XSLT, de-mangle with the reverse sed. That’s a little annoying, so I was wondering if there were something simpler. Since I use TiddlyWiki all the time …

I’ll see how it goes, but at least I crossed the first hurdle, getting a TiddlySlides file that I can edit.

UPDATE 1/11/08: the trick wasn’t actually curl; it was to quit and relaunch my browser (Firefox). Something must have been cached that prevented the #author:true from working.

,