Fork me on Github
Fork me on Github

Joe Dog Software

Proudly serving the Internets since 1999

Hope And Change: Nerdblog Edition

Your JoeDog read that women marry a man hoping he’ll change. Men, on the other hand, hope she’ll remain the same. He’s also noticed that most of the denizens on this nerdblog are men. They don’t like change! Well change is coming.

No, we’re not taking art classes with young guys named Pierre.

Your JoeDog is ditching cvs for git. This is a good thing. He’s using github.com which means the repository will be available to you.

Unfortunately, the history is not. Your JoeDog tried and tried to port the history to git. He used all the tools, followed all the instructions and posted all the errors into the Google machine. Apparently his cvs repository is — how does he say this? — fscked up. It doesn’t seem fscked up but the Internets have spoken.

The commit history is important. A few years ago Your JoeDog was contacted by a heroic Patent Fighter. Some douche wanted to patent a rudimentary coding technique and Our Patent Fighter was searching for original art, stuff that was published before Patent Douche came up with his “orginal idea.” I believe that idea was, “I can’t believe nobody’s thought to patent this yet!”

Well sir, Your JoeDog was able to provide detailed publishing dates which were used as original art. Patent Douche was defeated and it was happy nice time for everyone but Patent Douche.

The point is, kids, don’t smoke cigarettes. Also, we’re moving the source to github.com

UPDATE: Siege was added to github.com; same deal, no history. You can check it out of version control with the following command:

git clone https://github.com/JoeDog/siege.git

 

[Trending: JoeDog’s source repository]

 



Link Spammers Are A Bag Of Dicks

This big, cruel world is filled with all sorts of social rifts. Some of you are liberal while others are conservative. Some believe in God while others like to sleep in on Sunday. We’re deeply divided but there’s one thing we can all agree on: link spammers are a bag of dicks!

Your JoeDog is up to his armpits in spam. And if you’re a link spammer spamming this post, go /sbin/fsck yourself.

Google created these monsters. It awards points to sites with incoming links. But here’s the thing: it can’t be just any link. Back in the day, link-weenies created link farms to bump their SEO. A few years ago, the search engine giant started penalizing those type of links. As a result, link spammers now work overtime to add links to your website.

So they’re shitheads. But here’s the thing about these shitheads: they’re nicer than the average Internet. Gawker once chronicled a nasty flame war on a comment thread about a cake recipe. People are nasty but link spammers are nice.

They post compliments! Seriously, they have nothing but nice things to say about you or your site. They appeal to your ego with the hope that your vanity preserves their links.

Frankly, this makes them easier to root out of the comment queue. When I see, “Best site on the ….” kerplunk! I don’t need another word to know that’s spam. But if a comment begins, “Hey, asshole …” well, I need to keep reading because it’s probably legitimate commentary.

To combat this scourge, Your JoeDog uses Akismet. As a C-List nerdblogger, he can’t afford to give them much money but he can give them a linky! Oh! That’s two linkies. Wait, what? You’d rather have money. I give you guys $12.00 a year how much more do you want??!!

Akismet works pretty darn well. For each spammer who manages to find his way onto the comment queue, Akismet deletes hundreds of others ones. The company claims it’s saved Your JoeDog 52 days in comment management since he started using their service. That sounds about right.

Your JoeDog highly recommends Akismet and if your site actually makes money he encourages you to slip them a little more than $12.00 a year.



How To Eliminate Unused Variable Warnings In GCC

Your JoeDog uses gcc v4.8.2 on his snazzy System 76 laptop. By default, that version uses this flag: -Wunused-but-set-variable If you’d like to see a lot of compiler warnings, then I suggest you use it, too.

Inside fido’s src directory you can find GNUs regex. The file names were changed to ereg.c, ereg.h and  ereg2.h to avoid potential naming collisions. Well, sir, that .c file cries like a whiney two-year-old when it’s compiled with -Wunused-but-set-variable. Here’s what you’ll see in the console:

gcc -DHAVE_CONFIG_H -I. -I. -I../include -W -Wall -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -g -O2 -c ereg.c
In file included from ereg.c:640:0:
ereg.c: In function ‘byte_re_match_2_internal’:
ereg.c:7145:27: warning: variable ‘sdummy’ set but not used [-Wunused-but-set-variable]
const CHAR_T *sdummy = NULL;
^
ereg.c:7144:22: warning: variable ‘pdummy’ set but not used [-Wunused-but-set-variable]
UCHAR_T *pdummy = NULL;

Let’s see the offending code, shall we?

UCHAR_T *pdummy = NULL;
const CHAR_T *sdummy = NULL;

POP_FAILURE_POINT (sdummy, pdummy, dummy_low_reg, dummy_high_reg, 
                   reg_dummy, reg_dummy, reg_info_dummy);

I don’t know about you, but Your JoeDog thinks those variables are pretty much used. POP_FAILURE_POINT is a macro but that shouldn’t matter. Since he doesn’t maintain this code, Your Nerdblogger decided to put a bandaid on the wound rather than stop its bleeding.

The Internets are loaded with bandaids! Here’s one from a discussion on this exact topic:

#define UNUSED(expr) do { (void)(expr); } while (0)

To silence that warning, pass the offending variables to the macro and “Presto!” no more bitching….

UNUSED(sdummy);
UNUSED(pdummy)


All Aboard….

Your JoeDog is coding on the train right now. What’s he coding? He’s adding recursive directory searches to fido.

 

 



How To Prevent root’s mailbox From Filling With Cron Messages?

So one of your file systems is full and you traced it to a curious phenomena: root’s mailbox is loaded with messages. And you think to yourself, “Who the hell is sending mail to root?” Chances are, it’s you!

This recently happened to a friend who’s new to Linux. Root’s mailbox was full of messages that looked like this:

/bin/sh: ntpdate: not found

It turns out he had a cron job that ran ntpdate to sync his system time with a server at the National Institute of Standards. (Here’s a complete list of NIST time servers.)

The program ‘ntpdate’ was located in /usr/bin which was not in root’s PATH. So here is lesson number one: Always use the full path to a program in cron. In this case, he should have used /usr/bin/ntpdate.

Now about those mail messages. When a cron job fails, it captures the program’s output and mails it to the cron owner. If you set /bin/ls to run every five minutes in cron, you’re going to get a directory listing in your mailbox every five minutes. You can silence cron and stop mail messages by redirecting output to /dev/null. The ‘>’ character means ‘redirect’ Here’s the syntax: /bin/ls > /dev/null

Yet that wouldn’t have helped Your JoeDog’s friend. In his case, the offending message was an error message. Error messages are written to a different file descriptor.

The Linux/UNIX shell has three file descriptors: stdin, stdout and stderr. ‘/bin/sh: ntpdate: not found’ was written to stderr. In the shell, 1 represents stdout and 2 represents stderr. To capture both we need another character. ‘&’ means file descriptor. So 2>&1 means redirect stderr (2) to whatever stdout (1) points to. Here’s the syntax he should have used:

0 */6 * * * /usr/bin/ntpdate nist1-pa.ustiming.org > /dev/null 2>&1

Now Your JoeDog has been in this game for quite a while. In the day, to really silence the crontab we’d write the redirect like this:

0 */6 * * * /usr/bin/ntpdate nist1-pa.ustiming.org 1 >/dev/null 2>&1

That’s basically the same as the first one but it seemed to work around oddities and keep our mailboxes clean. The crontab man page still contains that syntax. Your JoeDog will continue to use that superfluous first 1 but your mileage may vary.



Linux Bare Metal Recovery With Rear

Your JoeDog loves rear! And who doesn’t, amirite?

Except it’s not that rear. It’s an acronym for Relax and Recover, a Linux bare metal recovery tool.

Your JoeDog has been using Mondo for cloning systems. It’s good software that served him well despite difficulties moving from one hardware set to another. If Your JoeDog archived sd disks and recovered to cciss, then he was knee deep in i-want-my-lvm hell.

Rear makes those type of migrations much easier. If you archive a server using one type of disk driver and recover it to one that requires another, rear reworks the disk layout for you. It’s also configured to ignore external disks. If you archive a server connected to a SAN, rear simply ignores those multipath devices.

Like Mondo, you can archive and recover from an NFS server. Here’s a suggested configuration for NFS archiving. Place these directives inside /etc/rear/local.conf

OUTPUT=ISO
BACKUP=NETFS
NETFS_URL=nfs://10.37.72.44/export
NETFS_OPTIONS=rw,nolock,noatime
OUTPUT_URL=file:///export

To archive the system, run ‘rear -v mkbackup’

This configuration creates an ISO image called ‘rear-hostname.iso’ inside 10.37.72.44/export/hostname. To recover the server, burn that ISO onto a CD and boot the system with it. Select the Recover option then run ‘rear recover’ at the command prompt.

“It’s that simple,” Your JoeDog said with the zeal of a recent convert. He’ll be back to bitch about rear in a couple weeks but for now it’s nothing but love….



High Tech Depression

The Atlantic has an interesting article about depression and anxiety in the tech industry.

Yet certain elements of startup life and culture may make people particularly susceptible to depression. Stress, uncertainty, youth and isolation—the virtual cornerstones of today’s startup—have all been shown to increase likelihood of developing the disorder.Irregular work hours and constant high stress levels can lead to both social isolation and sleep disturbances, which can aggravate depression and make people even more volatile.It’s almost a perfect storm, says Maurice Ohayon, a professor of psychiatry at Stanford University School of Medicine. “Any psychiatrist can tell you that this population is particularly exposed,” he told me.

Most founders operate under a huge amount of pressure. They are responsible for employees, shareholders, and maintaining company morale, mostly before reaching the age of 30. And especially in the early stages of running a startup, they shoulder that burden mostly alone.

[Atlantic: Tech Has a Depression Problem]

 

 



A Lock Picking Tool For Sidewinder Locks

 

When Your JoeDog lived in Manhattan his car had traditional locks. Thieves frequently jimmied those locks and took whatever they could find inside the vehicle. One morning before work, he was seen carrying a new battery down Second Avenue after his was stolen the night before.

He finally solved this problem in 1993 by installing a red light below the dash. The light didn’t do anything other than illuminate but thieves figured Your JoeDog had a fancy pants alarm and moved on to the next car.

In 1998, Volkswagen introduced sidewinder keys to thwart lock jimmiers. These keys had a flat metal blade with a wavy groove down the center. They had an identical cut on the reverse so the key could be inserted either way. They were also known as internal cut or laser cut keys.

Starting in October 2000, Volkswagen added a transponder chip for additional security. This type of key is now found on a wide array of vehicles.

The video at the top of this post is generating a stir. It features a lock picking tool for sidewinder locks. After a little fiddling inside the enclosure, the tumblers seem to adjust to the tool and the door opens for the intruder. He’s able to turn the ignition with even less effort. Fortunately, the car doesn’t start. It’s probably looking for a signal from the transponder chip.

So while your car may remain in its parking spot, as Your JoeDog can attest, once thieves gain entry they can wreck your entire morning. A battery gets pretty heavy after just one block. Imagine lugging one for seven more….

[Digg: If You Live In Bangkok Here’s How Your Car Will Get Stolen]



Here’s What We Know About The GMail Hacking Incident

Yesterday there was a flurry of reports about five million hacked GMail accounts that were posted online. A large number of people were understandably alarmed. This is the type of breach that can expose a victim to identity theft.

The GMail credentials first appeared on btcsec.com, a bitcoin security forum. They were posted by someone named TVSkit. He was described as Russian, probably due to his penchant for funny characters since the forum is a Russian language site.

Soon after the initial wave of reports, Google weighed in on its security blog. The company harvested the posted login credentials and checked them against their internal records. According to the company, less than 2% were valid and even fewer could be used to access an account.

In the wake of this report, there was another round of breaking news. Google probably wasn’t hacked but you should probably change your password anyway, the media said as it turned its attention to the next shiny object. No. What you should do is setup two-step verification.

In all likelihood, this stir was caused by an adolescent copy-and-paste hacker who grabbed someone else’s credential sheet and used it to bolster a claim about a non-existent GMail breach.