Sync login/lock screen wallpaper to current desktop background

For Windows 7, this turned out to be pretty easy to do via PowerShell. I just had to look for a native image resizing library since the lock screen for some odd reason, only supports JPEGs up to 256KB in size. Probably one of those legacy items left over from NT, like the file system permissions dialogs, and the built-in environment variables editor…

I ended up using WIA’s ImageProcess COM library which worked surprisingly well. It just resizes whatever you give it to the primary desktop resolution, so that’s not guaranteed to be less than 256KB, but it works more often than not so it was good enough for my purposes.

Windmill – Windows Window unclobberer

I noticed during the (many) meetings I attend that disconnecting and reconnecting my laptop from the dock reorganizes all my windows to the laptop’s display. This got annoying to have to drag and resize everything when returning to my desk, which has a 3 monitor setup. So, I wrote this small Win32 application to allow you to save the positioning and size of all windows and then restore them at a later time.

There are binaries in the releases tab.

There doesn’t seem to be an API to detect when removed or added from a dock, so a futher enhancement I’d like to do is to detect when (the same) monitors are re-connected and then automatically move all the windows back. But, it works really well as it is.

Fixing mirrorlist on Arch Linux Arm (Raspberry Pi)

I hadn’t updated my Raspberry Pi (a B+ model for my rpi-drd project) in about a year. Pacman -Syu kept complaining about being unable to find files on any of the mirrors.

So I, without thinking, ran reflector on an x86 host and copied it over. Oops. Now it definitely can’t find packages.

The website gave me the hostname I needed, but not the entire URL. Put this in your mirrorlist (as the sole entry) to restore functionality:

Server =$arch/$repo

Oculus Rift and Touch

I’m super excited for the imminent onslaught of consumer grade VR equipment and game support. I think it will change how games are played from now on. Not all games, mind you, it takes a certain level of involvement to strap on a head-mounted display and get into the experience. The military already uses similar technology extensively for training. It’s just a matter of months before equipment hits shelves.

That said, there’s a serious problem with it already. When you strap on a VR headset, your mouse and keyboard disappear. They seem antiquated as you tilt and peak below the headset to find the right keys. HIDs are going to need a total revamp to work well with head mounted VR.

Enter the Oculus Touch. Basically two Wii motion controllers. It makes sense. I can’t say it’s the best solution, because no one really knows what is (well, aside from 100% perfect hand and finger motion tracking without any device attached). It’s a great start, and I can see it working well.

via Engadget

For example, one thing I’m really excited for is VR support in my favorite flight combat sim, Eagle Dynamic’s DCS. I’ve seen some footage of the Oculus in use with it, and I’ve used the Oculus DK2 for development and with other games. But DCS has some serious keyboard use involved when playing. Even if you have a nice HOTAS, you can’t map all functions down to the toggle switches and buttons. And even then, you have to know it by feel. What DCS does offer (somewhat uniquely, if I’m not mistaken), is the ability to use in cockpit (on-screen) controls–currently with the mouse.

The new Oculus Touch should be able to handle that. Reach out and you see a hand reach out on screen. Move your hand over to the landing gear switch and press a button. How’s that for integration? This isn’t anything new, the technology’s been around for years now but no one’s made a solid controller for the PC, nor has any game I’m aware of supported it.

I was already excited for Oculus (and other VR HMDs). First-person shooters are also about to see a big change. The current heavy reliance on mouse input for looking and keyboard input for moving makes a lot of FPSs all about mouse/keyboard coordination. HMDs will allow a more realistic experience–if that’s what’s desired. For me, I’m more about the simulation than kill counts (or “360 no scopes”) so I can’t wait.

Installing Arch Linux with an encrypted root

I’ve got a ThinkPad T410. I got it off craigslist in what was a somewhat shady transaction. Regardless, it came with a 300GB spinner. Not interested in finding out how much life was left on it I got a solid state replacement from NewEgg for “Cyber Monday”. A 240GB Intel one for $110, that’s less than 50 cents per GB!

The spinner has a single unencrypted partition with Arch Linux running on it. I wanted to run Arch on an encrypted partition. The main reason: If it’s ever stolen I don’t want to have to worry about any of the data on it. Bonus reason: Geek/spy points.

So, while there are excellent guides for installing Arch, and setting up encryption, and optimizing an SSD, there don’t seem to be any combining the three. In reality it’s not that much more difficult, and if you are motivated to setup encryption on Linux in the first place you probably know what you’re doing. Still, I was disheartened a bit at the lack of information so I decided to note how I went about it in general. Continue reading

Interesting Spam

Akismet is really good at preventing spam, but I’ve noticed that spammers don’t even seem to be trying sometimes. This is what’s in my spam queue:

{I have|I’ve} been {surfing|browsing} online
more than {three|3|2|4} hours today, yet I never found any interesting article like yours.
{It’s|It is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners}
and bloggers made good content as you did, the {internet|net|web} will be {much more|a lot more} useful than ever
I {couldn’t|could not} {resist|refrain from} commenting.

Granted, it’s probably a bot doing this that has some Mad Libs license key problem, but still… at least try.

Updating WordPress on hosts

Update Dec. 13, 2014:

These scripts are out of date. NFS has the WP-CLI installed allowing for much, much easier upgrades, backups, etc. See the repository for information.

Originally posted on Sept. 10th, 2014:

If you use as your web host, you may have found it difficult to automate WordPress updates. I’ve made a script that does this for you. It also calls my backup and permissions fixing scripts, which I include here as well.

Beware of some notes and assumptions though:

  • Assumes WordPress is installed in /home/public/ (not a subdir of it)
  • Scripts are assumed to be in /home/private/
  • Does not check or recover from errors

Continue reading

Windows Backup

After installing Windows 7 in place of OS X on my MacBook Pro for work, there are only a few things I miss. But man, they were really nice.

  1. Unix shell
  2. Time Machine

The first one I’ll just say if you haven’t used a Unix-like shell of some type (Bash, zsh, whatever) then it’s hard to explain. Just that you can do everything a GUI can do (save for graphics work), but much, much faster. It’s very powerful, especially with file management.

Compared to Windows Backup, Time Machine is light-years ahead. Mainly because it’s a ‘set it and forget it’ type of thing. Here’s the number one problem with Windows Backup, it doesn’t overwrite the oldest backups. That’s right, no rolling backups. So guess what happens when your backup drive is full? It doesn’t backup. Great! If you’ve disabled the annoying Action Center, it silently fails.

Windows Backup


You have to manually delete older backups. Here’s the process:

  1. Remember to check Backup status
  2. Start Windows Backup and wait for the service to start to show status
  3. Realize it’s out of space and doesn’t have any recent backups
  4. Click on “Manage Space” and wait for another window to load
  5. Click on “View Backups” to show the list below
  6. Click on a backup period to select it
  7. Click delete
  8. Click “Yes” on the confirmation
  9. Wait for it to be deleted
  10. Repeat steps 6-9 until a satisfactory amount have been removed

Windows Backup

6 clicks, at a minimum, to ensure you’re backup is working. That’s pretty lame. Also, there’s no way to encrypt your backups without BitLocker (not available in all Windows 7 flavors) or a 3rd party tool. Time machine does all of that, automatically. And it’s easy to navigate. And it tells you when things go wrong.