Category Archives: Linux

Running Arbitrary Script on Multiple Login Attempts (Linux)

It so happens that someone was having trouble writing a login script to run after failed attempts. And they needed not only a login script but one to run after some number of failed login attempts and to commit some arbitrary actions.

You could do that with fail2ban, sure. But in this case there’s already a native way to handle it without going outside most standard Linux installs. Because the authentication layer is handled by PAM.d

Continue reading Running Arbitrary Script on Multiple Login Attempts (Linux)

Disable Middle Click to Close in XFCE4-Terminal

If you’ve used XFCE4 Terminal as a terminal emulator on the desktop you may have noticed an odd behavior. Every so often a tab will inexplicably close while you’re using it or floating the mouse pointer by it on the desktop.

As it turns out this is a middle mouse button click to close. In my case it happens when I’m using the track pad. Or not using the track pad, as the case may be, and instead nailing it with my palms while typing.

At one point the setting was stored in ~/.config/Terminal/terminalrc and on some older installations this may still be the case. On the current (through updates) Ubuntu install that I’m running it’s located in ~/.config/xfce4/terminal/terminalrc and in either case the option in question is MiscTabCloseMiddleClick=TRUE which needs to be changed to MiscTabCloseMiddleClick=FALSE

Hopefully this will save you from the headache of having your work or connection unexpectedly disappear!

How To: Run a Benchmark on Linux

So you’re wondering how fast that new Linux desktop you’ve built is.  But you’re not sure how to run a quick benchmark and find out.

Maybe you’re not familiar with the programs you should use. Maybe you’ve never actually run a benchmark before!  In any case we’ll go over a few basic benchmark tools that’ll have you comparing real world and synthetic performance numbers in no time.

picture of hardinfo running on Ubuntu
hardinfo System Profiler and Benchmark for Linux displaying a blowfish benchmark screen

hardinfo is fairly straight forward tool to start with (see the debian package information here) .  On debian or Ubuntu Linux it might already be installed. In Ubuntu it will show up as “System profiler and benchmark” in your menuing interface.  If not it can be installed with the command “sudo apt-get install hardinfo” or searched for in your favorite software manager.

This all-in-one information tool gives you easy access to systems hardware list from the proc and sys psudo-filesystems (which are an article in and of themselves) and a variety of benchmark tools.  Unfortunately you can no longer auto-sync with the hardinfo benchmarks database with the closure of BerliOS.  But it remains both a good one-page source of system information and a tool for getting a couple of quick number crunching benchmarks run.

GTKPerf showing multicolored lines to test a systems speed displaying them.
GTKPerf running it’s drawing area test.

GTKperf is a small test suite that shows you how fast your system handles creating graphics, rendering lines, and scrolling through drop-downs with the GTK user interface speed. To install it search for gtkperf in your package installer or type “sudo apt-get install gtkperf” in a terminal.

From it’s creator’s web site: “There exist other performance tools but none to measure GTK+ UI speed. With this tool it can be done easily and repeated (the) same way multiple times“.  And that’s exactly what it does.

While it’s not going to give you an idea of how massive number crunching will go it should give you some measure of how responsive your desktop will be.  Which is about as practical as benchmarks can get.

To actually run the default test set in GTKperf click on “Start” under the “i” tab.

Gnome Disks window in the background with a benchmark of an SDD in the foreground.
Gnome Disks showing a SDD benchmark.

gnome-disks is another application that has benchmarking as a small subset of it’s capabilities.  To install gnome-disks on Debian or Ubuntu search for gnome-disk-utility in your package manager or type “sudo apt-get install gnome-disk-utility“.

Seasoned Linux veterans will remember this application as the nearly impossible to remember palimpsest software.  The latest interface isn’t quite as robust, but it still has hard drive speed benchmarking as part of it’s tool set.  It will also provide you with information about your hard drives SMART status and access to many of the partition management utilities from a clean graphical interface.

On a drive with partitions it’s not recommended to run a write benchmark unless the data is backed up or you don’t mind the possibility of something going wrong and it being destroyed.  These benchmarks are better used for drives that don’t currently have data on them that you’re’ getting an initial speed run of and for that gnome-disks gives you a very nice graph of the drive’s speed and latency for your test criteria.

To actually reach the benchmark options use the gear symbol when you’ve selected the appropriate drive.  Again, this is a tool best used for drives without any data and requires root access to run.