Wednesday, November 20, 2013

Get your bugles ready - it's Taps for WInamp

Now before you say anything, I know Winamp isn't native to Linux (and yes, you can run it under Wine), but like most Linux users our there, you've probably had to run either a dual boot or dual systems with Windows boxen at some point.  Back in the 90's I did just that.  I spent many hours listening to tunes served up off of a Slackware box to my desktop using Winamp.  Granted, I haven't used Winamp in years, but I was still sad to read today that it's going the way of the dodo.  Apparently AOL (yes, they are still around, too!) managed to foul something else up and drove them into the ground.  I think the only positive thing that AOL will ever be remembered for was their endless supply of free floppy disks and beer coasters.

After 15 years of llama-whipping, AOL shuts down Winamp for good

Sunday, November 17, 2013

What happened to the SourceForge that we used to know?

One can't mention open source software and not think of SourceForge, the once de facto haven for almost any major FOSS project.  There are others that have sprung up over time and lured developers away whether due to better features or the lack of an ever increasing onslaught of ads, but SF has still managed to survive.  Now there is another nail in the slowly creaking coffin  - bundled "crapware."  Take a look at this article from The Register.

Monday, November 11, 2013

Mounting SMB shares with spaces in the name

I had a situation pop up recently where I needed to mount an SMB (CIFS) share from a WIndows server on an Ubuntu based machine via the fstab, but hit a small snag - spaces in the share name.  Why in the name of all that is good Windows admins insist on doing this is beyond me, but I did find a good blog post on how to deal with it without involving ammunition.


fstab mounting cifs shares with spaces in the name

Simple character substitution... nice!

Wednesday, October 30, 2013

On the subject of DDoS...

I suppose it's the theme for the day.  Another really cool discovery I made recently is the Digital Attack Map:



It pretty much speaks for itself.  I'll put a permanent link to this handy page in the Resources section.

Google rolls out Project Shield DDoS attack mitigation service

I noticed on Engadget the other day that Google has rolled out a new service named Project Shield which is aimed at small static websites targeted by DDoS attacks.  This is a pretty cool gesture for those who have something to say but may very well fall victim to attackers who want to silence them.  Take a look at the article for more info.

Sunday, October 20, 2013

Duplicate output with Tee

Quite frequently I'll run across a previously unknown gem that keeps my head from getting too big.  It doesn't matter how long you've been doing this type of work, there are things that everyone can learn.  I had a situation the other day where I needed to direct the output from a process to both a file and std out.  Now there are several ways one can accomplish this, whether with named pipes or a bit of creative redirects.  I did a bit of research and found that there is a tool just for such an occasion - tee.

Think of a T-fitting used in plumbing and you get the idea.  By piping output to tee, you can still get the output via std out but also send it to a file.  It's a standard *nix command, so check out the man page for more info.

Tuesday, August 27, 2013

How to edit multiple files automatically with vim

From time to time I may have a slew of files that I need to make bulk changes to but don't want to edit each one by hand.  A quick and easy way to do this is by using vim's -c option.  For those of you who are thinking "what about sed?" just hold on to your seat.  The sed command is also a favorite of mine, but the mood just struck me today to talk about vim.

Almost everyone who uses Unix or Linux agrees that vim (or vi for the super-hardcore folks) is the editor of choice.  Pico and nano are for sissies.  Emacs, you say?  I believe the old joke goes "Emacs is a great operating system but lacks a good editor."  I give you a +1 if you get the joke.  Kidding aside, let me get to the point of the post.

Vim, or vi improved for the unfamiliar, allows you to edit a file without getting your hands dirty via the -c option.  This option allows you to pass a vim command directly from the *nix command line.  With this nifty trick, it's easy to iterate through a list of files and perform the same edit on all of them in no time flat.  Let's say that you have ten files all containing a host named foo.net which needs to be changed to bar.com.  if all of the files are sitting in one directory and for simplicity's sake, named 1-10.txt you could do something like this:
for file2edit in *.txt; do vim -c "%s/foo.net/bar.com/g" -c "wq" $file2edit; done
The command will loop over all files ending in *.txt and do a simple string substitution followed by a save and quit in vim.  Of course, depending on your situation you will like need to tweak the for loop or vim command line a bit, but this should give you an idea of the potential time savings.  I'll try to post a similar example using sed soon.