Category Archives: Linux

The most versatile penguin in the world.

rsync longevity

Years ago, I had a problem keeping a long-running rsync process alive longer than ~2 hours between two ReadyNAS boxes. Many suggested fixes were offered by peers, and I did a lot of my own research. It didn’t appear to be a problem with the ssh tunnel, since I could keep ssh open and idle for a whole day. I even upgraded the NAS boxes to DiskStations improve the situation a bit, as the faster CPUs were able to do more of the CPU-bound work in the ~2 hours of life the process had. Still, I kept hitting the limits of my setup, and I had to prune out old backup directories more often than I liked.

I recently came across a stackoverflow post where someone casually mentioned to check logrotate. I dismissed this, of course – logrotate was working fine on my rsync logs in /var/log.

But I kept revisiting it. Why did they suggest looking at logrotate? On a whim, I tried moving the rsync logging out of /var/log. That alone fixed the problem. My rsync process now runs until it’s done! Somehow, logrotate was configured on my DiskStation to kill off rsync periodically so that it could perform its log-rotating duties. It’d be a rabbit hole to explore exactly why or how this happened – I’m just happy that it’s working now 🙂

If you’re having trouble with long-running rsync processes, definitely give this a try.

Automating an “old” TV

My Samsung TV is two years too old to receive automation commands over the LAN. Otherwise, my entire home theater experience is automated in openHAB, including my Yamaha receiver, my Tivo, and my Roku.

I was lamenting this to Noah Ternullo, and he said I could wire up an IR blaster. “Yeah,” I thought, “but that’s going to be really annoying.” It turned out to be really easy.

I already had this IR LED board from a previous project that used an Arduino, but I wanted it to work on a Raspberry Pi instead. I followed this writeup on how to configure LIRC on a Raspberry Pi to work with an IR LED driven by a GPIO pin. I gave my LED board 5V and GND and fed a control pin to it. Then I found a contributed lircd.conf for a very similar remote to my Samsung TV remote.

On the openHAB side, I added this item:

/* TV */
Switch TV_Power "TV Power" <switch> (media) { exec="OFF:ssh pi@raspberrypi.igo irsend SEND_ONCE Samsung_BN59-00685A KEY_POWER, ON:ssh pi@raspberrypi.igo irsend SEND_ONCE Samsung_BN59-00685A KEY_POWER" }

It uses the powerful exec binding to invoke a command from my openHAB server to the Pi. Now I have a power toggle for the TV. I put the private SSH key in /root/.ssh/ on the openHAB server and put the public key in /home/pi/.ssh/authorized_keys on the Pi to facilitate a passwordless connection.If you do this sort of thing yourself, remember that this is just a toggle. openHAB doesn’t really know if the TV’s on or off. In my case, I infer the TV’s state from the state of virtual buttons that I use to start or stop my media experience.

Fake Middle Mouse Button in Ubuntu Unity With a Touchpad

The Problem

It’s been years since I’ve used a laptop that actually had a middle mouse button, and it can be tricky getting the timing right to press the left and right touchpad buttons simultaneously to fake a middle button press. Happily, there’s a really simple way to turn a two-finger tap on the touchpad into a middle button click. This guide assumes that you are familiar with command line and scripting basics. Continue reading Fake Middle Mouse Button in Ubuntu Unity With a Touchpad

It’s Time to Make the Switch

I have been using Linux primarily since 2000 and exclusively since 2003.  In that time, I have found Linux to be a robust and well-supported OS, as long as you stick to compatible hardware.  Windows, on the other hand, was always suffering from self-inflicted wounds or fundamental vulnerabilities.  I was so much more productive in Linux than I was in Windows that it was really a no-brainer.  However, I came to a realization recently: Windows’ many flaws drive the economy.

If it weren’t for Windows, we wouldn’t have so many anti-malware companies vying for your purchase, we wouldn’t have Geek Squad, and large companies wouldn’t have entire divisions dedicated to just keeping Windows from falling apart.  In short, Windows is where the money is, because Windows always needs TLC.  The same thing is reflected in technology shows and podcasts – the vast majority of questions are about Windows, because Linux users mostly don’t have problems, and the ones they have can be self-diagnosed and fixed.  If I were to continue on my path of using Linux and converting others to Linux, I would be chipping away at the enormous Windows service aftermarket, and people would lose their jobs.  I don’t want to be a part of that.

So, as of today, I am switching to Windows so that I can learn how to fix its inherent flaws and get a slice of that Windows support pie.  I’ll be careful to fix them temporarily, since the real money is in not addressing the underlying problems.  After all, if fixing the cause were the goal, people would just have switched to better OSes long ago.

Free Virtualization in Linux

There are lots of ways to create virtual machines in Linux, and I heard about some of them at CPOSC.  In the course of helping someone learn ways to run Windows XP virtualized inside Linux, I found out about Virtualbox OSE.  It’s fairly easy to install and set up and start using.  Right now, I’m installing Fedora 9 on a virtual machine, just to see what the state of affairs is.

I know that lots of you out there use virtualization at home and at work, so I’d be curious to hear how Virtualbox OSE compares with the commercial and free solutions that you use.

UPDATE: Someone asked me on IRC if there was a server mode.  It does appear that there is.

Like an Onion Skin

I saw that Valve was offering a cheap bundle of all the old X-COM games on Steam, and I decided to buy them, hoping they’d run in wine.  The Steam version was too new to show up on wine’s compatibility list, but it was less than $14, so I gambled.  Out of 5 games, 4 run in wine well enough to play, and 1 does nothing.  Here’s the insanity: The older DOS games were not actually ported to Windows, so the Steam version includes a Windows-based DOS emulator.  In my case, I’m running Linux and launching wine, which runs the Windows program, which launches the Windows-based DOS emulator, which runs the old DOS game.  And it works.  You’d sound like a zealot or a crazy person if you suggested that I try to run it that way on purpose, but this only serves to highlight how good wine is now.