Tech Tips

Safer Access without Passwords

How do you make sure that your passwords are safe? You can make them longer, complicate them by adding odd characters, making sure to use different passwords for each user account that you have. Or, you can simply skip them all together.

Accessing Remote Files Easily and Securely

The secure shell, ssh, and its companion, scp, are tools that I use more or less on a daily basis. Being able to move files between machines without having to setup SAMBA or NFS is very handy when working with multiple systems. All that you need is to enable the secure shell daemon - sshd.

Drop Your Dropbox and SparkleShare Instead!

We love Dropbox here at Linux Journal. It's cross-platform, offers a decent free offering and generally "just works". It has some problems though. Dropbox is proprietary. Dropbox stores a copy of your data in its own data repositories. Dropbox is limited in size, especially with its free accounts.

Fun with ethtool

Time to be honest here for a minute. The open source community really has outdone themselves coming up with some very obscure names for packages. Let's take this list of packages for instance: emacs, gimp, gcc, mutt, grub, kyle rankin, parted, tar, mutt, vim. Nine times out of ten, a common person is going to look at that list and become utterly confused over what package does what.

Silly Programs

Those of us who have been using Linux for a long time all know the joy of silly programs like xeyes. One of my favorites, however, is good old xsnow. Whether you love the cold weather or live in Florida and like to ski on occasion, xsnow will add some winter fun to your desktop. The xsnow program has been around forever and is surely available for your distribution.

Customize a Distro with Remastersys

Remastersys is a complete system backup tool, but it can also be used to create your own customized remix of an Ubuntu or Debian installation. Basically, you customize a running system and create an install disk that will recreate it. If you've ever wanted to create your own distribution, you won't believe how simple this is to use. Mikebuntu, here we come...

Tutorial: Translating Scanned Docs

Recently, I had to access some information from a German document, but the problem was that it was only available as a poor quality scan. This is an overview of how I extracted and translated the information. The tools used were pdfimages, GIMP, gImageReader and Google Translate.

Back from the Dead: Simple Bash for complex DdoS

If you work for a company with an online presence long enough, you'll deal with it eventually. Someone, out of malice, boredom, pathology, or some combination of all three, will target your company's online presence and resources for attack.

Wi-Fi on the Command Line

More people than ever are using wireless networks as their primary networking medium. Great programs are available under X11 that give users a graphical interface to their wireless cards. Both GNOME and KDE include network management utilities, and a desktop-environment-agnostic utility called wicd also offers great functionality.

The Web on the Console

  Most people think “graphical interfaces” when they think of surfing the Web. And, under X11, there are lots of great programs, like Firefox or Chrome. But, the console isn't the wasteland it might seem. Lots of utilities are available for surfing the Web and also for downloading or uploading content.

Stupid tar Tricks

One of the most common programs on Linux systems for packaging files is the venerable tar. tar is short for tape archive, and originally, it would archive your files to a tape device. Now, you're more likely to use a file to make your archive. To use a tarfile, use the command-line option -f . To create a new tarfile, use the command-line option -c.

Bash Co-Processes

One of the new features in bash 4.0 is the coproc statement. The coproc statement allows you to create a co-process that is connected to the invoking shell via two pipes: one to send input to the co-process and one to get output from the co-process.

Bash Redirections Using Exec

If you've used the command line much at all you know about I/O redirection for redirecting input to and/or output from a program. What you don't see all that often or that you may not be familiar with is redirecting I/O inside a bash script. And I'm not talking about redirections that you use when your script executes another command, I'm talking about redirecting your script's I/O once it has already started executing.

Bash Associative Arrays

The bash man page has long had the following bug listed: "It's too big and too slow" (at the very bottom of the man page). If you agree with that, then you probably won't want to read about the "new" associative arrays that were added in version 4.0 of bash. On the other hand, if you've ever used any modern Office Suite and seen code-bloat at its finest and just think the bash folks are exaggerating a bit, then read on.

Bash: Handling Command Not Found

After a recent O/S version upgrade (to openSUSE 11.2) I noticed that bash started being a bit more intelligent when I did something stupid: it started giving me a useful error message when I typed the name of a command that wasn't in my PATH but that was in an "sbin" directory. My reaction at the time was "huh, that's nice", but today I decided I needed a bit more information.

Comparing Files

You often may need to compare one version of a file to an earlier one or check one file against a reference file. Linux provides several tools for doing this, depending on how deep a comparison you need to make.

Returning Values from Bash Functions

Bash functions, unlike functions in most programming languages do not allow you to return a value to the caller. When a bash function ends its return value is its status: zero for success, non-zero for failure. To return values, you can set a global variable with the result, or use command substitution, or you can pass in the name of a variable to use as the result variable. The examples below describe these different mechanisms.

Bash Arrays

If you're used to a "standard" *NIX shell you may not be familiar with bash's array feature. Although not as powerful as similar constructs in the P languages (Perl, Python, and PHP) and others, they are often quite useful.