Archive for the ‘Uncategorized’ Category

It's been more than six months since I've posted; I'm still alive and well but haven't had the time to be hacking. Plus our house was robbed and the only thing of value that was taken was my computer, and it's taken me a while to replace it. One of the nice things about the cloud is realizing how little I needed my own machine to get everyday work done; the biggest inconvenience was changing all the passwords that I had stored locally.

But now I have a new Windows 8.1 machine (in my heart I'm a Mac, but I'm cheap). So these next few posts will be my own notes on how to set up a machine that does what I want, so I don't have to remember it all again.

First of all, in Remove Programs, get rid of all the cruft (including the "free trial" software including antivirus). If it's not obvious, you're not gonna use it. Activate Windows Defender.
Go to the Start screen and delete just about everything (a lot of right-clicking). The goal is to create a simple screen of what I want.

Next, install Chocolatey. That makes installing everything so much easier, and lets me rely on open-source-minded people to install useful things without cruft. In a cmd.exe window, run:

@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin

It's kind of annoying that Powershell itself makes running things harder, but Microsoft is trying to save me from myself.

From now on, I want to run in Powershell. Create a shortcut to it in C:\ProgramData\Microsoft\Windows\Start Menu\Programs (that seems to be the only way to pin a shortcut to the Start screen, though I may be wrong. Didn't do enough experimenting on that; this worked, so I was done). Use the properties on that to set the initial directory and the screen colors (I wanted a black background, since the red and green colors that git uses look terrible against the royal blue default), and the initial screen size. Pin that shortcut to the Start screen.

Create a file named profile.ps1 in My Documents/WindowsPowerShell and include a line of $env:Path += ";C:\Program Files (x86)\Git" so that I can use git commands directly from the command line (no more separate git bash). Any other startup code goes there.

Note that scripts, including the profile, will not be run until the Execution Policy is reset below.

Right click that shortcut to Run as Administrator, and start installing:

Set-ExecutionPolicy RemoteSigned

choco install git
choco install putty
choco install filezilla
choco install notepadplusplus
choco install CloudBerryExplorer.S3
choco install gnucash
choco install libreoffice
choco install 7zip

Evidently I could have used

choco install google-chrome-x64
choco install firefox
choco install itunes

But I didn't realize that at the time and downloaded them from their respective websites.

Then find all those programs on the Start screen (just start typing the name) and pin them, then move them where I want.

Then enter the SFTP settings for all my websites in Filezilla and Notepad++ NppFTP, copy over the documents I wanted from my old (thankfully unstolen) computer, and I had a working machine.

One thing to note is that Filezilla stores passwords in ~\AppData\Roaming\FileZilla in plaintext, which is great for changing computers and for finding passwords you've forgotten, but it means that if your computer is stolen or infected, you could lose everything. There are ways to avoid this, but for now I'm relying on hope, which is not a strategy.

Finally got a new machine (Toshiba Satellite C75), with Windows 8.1, and despite all the negative hype, it doesn't suck. My wife has had a Windows 8 computer for a while now, and I had explained that teh way to think about it was as two separate operating systems: the old, mouse-oriented one; and the new, touch-oriented one. She's adapted well to that.

But playing on my own machine made me realize that's the wrong mindset. I now treat the Start screen as a big Start menu, organized with all the programs I want the way I want them. The first thing was to remove all the junk that was on there (I kept the weather app and the news but that's it) and start pinning my programs (Notepad++, Chrome, Git Bash, etc). Now it's Windows key or mouse lower-left, then type or click what I want. I had to write a few .bat files and pin the shortcuts to get websites to open in Chrome, but that works as well.

Now to see what all the fuss with IE 11 is about...

Just upgraded the server to Apache 2.4, and started getting 500 errors on everything. Turns out the access control was completely changed; instead of Order deny,allow and Deny from all you use Require all denied. That change fixed everything. Hope this helps someone.
Updated 2013-12-09 to use much simpler code

One thing that is nice about Prism is that it provides hooks to extend the syntax highlighting, so it is straightforward to create a plugin that adds features like my line numbering, so I can do things like:

<pre><code class="language-javascript" data-linenumber=4>
function foo(arg){
  console.log('You said: '+arg);
}</code></pre>

Download the code.

Download the CSS (the linenumbering parts are at the bottom).

See an example (working together with the line highlighting plugin)(note that Chrome requires an explicit line-height on the <pre> to work). Continue reading ‘Line Numbering Plugin for Prism’ »

This is dumb: I'm typing away on WordPress's fullscreen mode and all of a sudden my keyboard goes haywire: the double quote is now an at sign; the backslash is now a hash. The hint to what's wrong is that the hash sign (shift-3) is now a British pound sign. WordPress thinks I'm using a British keyboard! Other applications work fine. Searching for anything like "Wordpress British keyboard" turns up nothing. It's not until I try typing special characters in the address bar that I realize it's not WordPress; it's Firefox.

Turns out Left Shift + Left Alt is the keyboard switcher, and I had both the US and British keyboards listed as available input methods. I must have accidently hit that at some point. It's not clear why only some applications were affected (I think the keyboard is whatever the setting is when that particular application starts). Anyway, Control Panel->Regional and Language Options->Text Services and Input Languages lets me remove the offending keyboard, and I don't have to worry about it again.

I'm working on moving bililite.com to nearlyfreespeech.net; it's cheaper, more reliable and more hacker-friendly than 1&1. I'll write a post with my experiences and reasons later. But for now just the blog has moved to bililite.nfshost.com/blog, with the plan to move the domain registration for bililite.com to nearlyfreespeech when everything is working and then return the blog to bililite.com/blog. Moving it was straightforward, as I've done it before, but there are some subtleties: nearlyfreespeech runs with safe mode and safe_mode_gid on, so you have to watch file and directory permissions; SaraPin explains exactly how. WordPress loads with the group me and nearlyfreespeech's webserver runs with the group web, so you need to SSH into the account and change the WordPress directory with chgrp -R * web. The file permisssions should be 664 (writeable to self and group, readable to all) and the directory permissions should be 775 (writeable and executable to self and group, executable to all; under UNIX, getting a file from a directory is "executing" it), but the default WordPress installation does that.

If you don't know what that means, you probably shouldn't be using a d.i.y. host like nearlyfreespeech.

And now it works!

Almost. SexyBookmarks's images aren't loading when I use the new code, so I went back to the old version. It slows the page load down anyway, so I may take it off entirely.

And the rest of the bililite site is still at the old host, and some of the sample code (in /blog/blogfiles) uses that, so for now I have a line in my .htaccess to refer it back: RedirectMatch /blog/blogfiles(.*) http://bililite.com/blog/blogfiles$1.

My office manager gave me this as a Christmas present. I have a great job.

XKCD has published the new reference standard for all flame wars: XKCD Connoisseur

I definitely like my iPod Touch better than my old Windows Mobile 6 phone, and I had hoped that the time zone/daylight savings misery I had on Windows would be behind me. No such luck. When I went to New York for Pesach this year, I dutifully changed the time zone (Settings->General->Date & Time->Time Zone) to New York, then changed it back to St. Louis on my return. The iPod, trying to be helpful, moved all my appointments forward an hour, even though it had not moved them backward when I went east. Now everything was an hour off!

I briefly pulled my hair out, then Googled Binged "ipod calendar 1 hour off" and it turns out there are two settings for the time zone: the one under General->Date & Time for the iPod's clock and Settings->Mail, Contacts, Calendars->Time Zone Support->Time Zone for the time to display for events. Setting both to "St. Louis" fixed the problem.

This makes no sense to me; how often would anyone want to see appointments in something other than their local time? And why would it show up only after my return trip? But at least the problem was quickly solved.

And on an almost completely unrelated note, Bing doesn't lend itself to being used a verb the way Google does. Binged sounds like I drowned my computer problems in a fifth of Scotch. Bing'd? Bing-ed? BingisnotGoogled?

I've been using Quicken for years, since Quicken 97 on Window then Quicken 5 on the Mac and then Quicken 2001 when I got my iMac. The problems is that Intuit doesn't upgrade Quicken, it replaces it each year with a version that has more frilly bells and whistles and less real utility (especially on the Mac; just look at the "Using a prior version of Quicken Mac?"). And the datafile is often different from the old file, so stuff gets lost with each "upgrade".

So I've kept my current Mac (a blue & white G3, the "Mickey Mouse" one) just to be able to run Quicken 2001 under Classic. I can't upgrade to an Intel Mac, since Classic won't work. And I want to balance my checkbook while talking to my wife, not only downstairs in my basement office. So I wanted something I could run on my dual-boot (XP and Ubuntu) laptop.

I've been looking at alternatives to Quicken for 5+ years, but with 20 years of data I was too scared. Until now. I've been using gnuCash for just a week now, but it seems to everything I need it to, including importing all my data, even from multiple investment accounts, from Quicken's exported QIF file. I haven't done any complicated investment things, so I don't know how well that side of it works.

Strong points

  • It Just Works. Does what I expect it to do, in the way I expect it to. Of course, I'm a geek who understands double-entry bookkeeping, so that may not be surprising.
  • I can control-S and save the file; I always felt out of control with Quicken since you couldn't force it to save.
  • Open source. I will probably never have the time to tinker, but it's nice knowing that I could

Weak points

  • Keyboard shortcuts. I miss being able to assign my own keystrokes; I hate going back to the trackpad to do anything. But see Open Source above; I can probably fix that.
  • I'm going to have to learn Scheme to create custom reports. Not sure if that's a bug or a feature.

The biggest advantage is the feeling of freedom of not being tied to Intuit anymore. I'll see how it works out, but I'm not going back.