Aug 312013
 

Every Linux/Unix user ought to be familiar with the old rm -Rf * gag. Or the more subtle rm -Rf files/ * issue, in which a misplaced space results in the removal of all files and directories. An administrator is going to use the rm utility a hundred times a day. How can they remain efficient while insuring a simple mistake doesn’t result in downtime and serious data loss?

Continue reading »

Jul 312013
 

I’ve been carrying on a personal challenge for a while – attempting to remain in the 90th percentile for any activities I attempt. To some extent, I think it’s in my nature to compete with others. Alternatively, it’s a good way to be certain I’m actually applying myself.

Some activities are harder than others to gauge, but I find this system provides a good metric. It’s exceptionally hard to be the best at anything, but if you’re in the top 10% then you can be comfortable knowing that you’re doing reasonably good work. If you’re not in the top 10%, then you know you need to improve your methods and/or put in more effort.

Eliot Eshelman Top 10% of Profiles on LinkedIn

Continue reading »

Jun 302013
 

Dealing with hoards of e-mail is a challenge a lot of us face. Sometimes, I think we slog through without taking a moment to consider improvements. Making yourself more efficient can be worth it, though:

Chart to determine if an optimization effort is worth the time.

I’m not really discussing SPAM filtering. At this point, I think the big guys are already doing a good job taking care of that nuisance. Google Apps with GMail serves me well.

However, people get a lot of “bacon” – e-mail you did technically subscribe to, but may not read regularly. This will be companies you’ve purchased from, LinkedIn updates, professional association newsletters & journals, etc. Not things you’d like to delete, but also not items that should demand your immediate attention.

I was able to clear most of my inbox using a single word:

Unsubscribe

Because we’re assuming these are legitimate senders (not spammers), they will adhere to standards by including a link to unsubscribe from the mailings. If you’re feeling obsessive, you might also include “Opt Out” in your filter.

This one change has made me quite happy at work.

Mar 212013
 

find is a very useful utility, but has so many capabilities that you end up hitting the man page every time you come back to it.

I occasionally need to remove old/cached files based on age, which is perfect for find. It’s able to search based on file access times, file status change times and file modification times. Not all systems even track access times (look at your mount options and/or /etc/fstab) so I try to search by modification time when possible. The *time options specify days (24 hours). The *min options specify minutes.

For example, I don’t usually need a copy of any temp files from more than a week ago:
find /tmp -mtime +7 -exec rm -f {} \;

In some cases, you’ll want to search for recent files rather than older files. In this case, you simply switch the sign in front of the number of days. To see a list of this last week’s temp files:
find /tmp -mtime -7

In one case, I needed to restrict to the last day’s FTP uploads, excluding any files that were currently being written (to inspect and remove unauthorized uploads). Here, I assumed that anything which hadn’t been touched for 30 minutes was no longer being uploaded:
find /var/ftp/pub -mmin +30 -mtime -1 -exec parse_script.sh {} \;

Jan 302013
 

I’ve used the /proc and /sys filesystems for a variety of tasks, but it’s always interesting to discover a new use. For example, if you want to completely remove an ethernet device from the system (not just disable the ethernet link) it can be done from /sys. In almost all cases, you simply want to use ifconfig down or ifdown to de-activate the port (allowing you to reactivate later). But there are instances where you want to remove the eth device. In this case, you can use /sys to remove a single device.

In my case, it worked even though there are two ethernet devices on the same Intel gigabit ethernet chip and are both served by the same Linux kernel module.
Continue reading »

Jan 022013
 

Health researchers have long been studying the effects of sitting at work. The reports I’ve seen are negative: sitting all day at work is detrimental to your health. Circulation is cut off to portions of your body, your organs are squeezed and your joints/muscles are forced to remain in static positions all day. Even more disturbing is the finding that exercise cannot offset the negative effects of sitting. If you’re sitting all day, you are harming your health.

Standing desks are nothing new, so I’ve been thinking about it for a number of years. After seeing a post describing very cost-effective standing desks, I decided it was time to try. It depends upon your height, but most people need nothing more than a coffee table and a shelf from Ikea (about $20 total). In my case, I’m tall enough that I don’t even need the shelf. The only item I purchased was a 35″ x 21″ LACK coffee table (p/n 101.042.95). You will probably also want an anti-fatigue floor mat to protect your feet, knees and back.

Continue reading »

Dec 272012
 

I’ve been using Pulseaudio to easily switch audio output between my digital amplifier and analog headphones (this prevents my headphones from blaring when I’m not actually wearing them). Recent updates to Pulseaudio required a number of changes in my configuration. At this point, I’m not even sure I could use the digital and analog outputs without going through this process. The process is not incredibly complex, but requires the use of new utilities and a bit of experimentation.

Continue reading »

Nov 242012
 

I’ve been with T-Mobile since the release of the original G1 android phone. Overall, I am a happy customer, but the quantity of bloatware on their phones does seem to be increasing. The G2 shipped with a few odds and ends you couldn’t install, such as Twitter and Facebook. This wasn’t extremely annoying, as they were popular 3rd party apps. I’ve now upgraded to a “flagship” Samsung device that arrived with a fairly large quantity of lousy Samsung and T-Mobile apps. I’m stripping out much of this, but rooting the device and returning to stock Android is not attractive, because this device has specialized apps for a stylus (Samsung Galaxy Note II).

Continue reading »

Jul 212012
 

The rsync utility has a lot of great uses, such as keeping servers in sync with one another, but sometimes you want it to run unattended. So how do you securely and automatically sync between servers?

Because rsync and ssh work so well together, it’s easy to set up an encrypted, rsync-only link. There are a few different pieces that have to be put in place, so be sure to follow along closely.

First, understand that the method I’m describing is a “pull” rather than a “push”. The backup server connects to the production server to pull the most recent copies of the files. I prefer this method because it reduces the attack surface of the backup servers – they don’t need to accept ssh or rsync connections. They only need to connect to ssh on the production servers. The production servers are also well protected from outside/malicious ssh connections, as you’ll see below.

Continue reading »

Jan 272012
 

Maybe you’ve had the experience of retrofitting your computer to operate quietly? Afterwords you say to yourself, “How did I ever think with all the noise that computer was making?” A small change in your environment creates a shift in your thinking and productivity.

I had the same reaction to the Sublime Text editor. After an hour of use I was loving it. A couple hours later it was customized just the way I like it. The next day I realized I was spending more time getting good code written and less time fiddling around.

Screenshot of Sublime text editor

Sublime doesn’t have every feature possible, but it does have some imaginative features such as multiselect/multi-edit. Linux, MacOS and Windows are supported. A vi mode is available. It’s also incredibly clean and fast. You’ll love the way it looks and feels.

There are all sorts of options for customizing the editor. Many plugins are available and it’s easy to write you own. You’ll also find plenty of assistance in the forums. It seems Sublime is going viral within the developer community.