Saturday, July 28, 2012

Where are all my Audacity plugins?

I end up having to do this every time I (re)install Linux on one of my machines, so it's getting blogged. The base install of Audacity, for some reason, doesn't install the LADSPA libraries, which means you get a very limited set of plugins. Run this to get the whole kaboodle:
~$ sudo aptitude install vco-plugins tap-plugins swh-plugins rev-plugins omins mcp-plugins
Credit goes to Jeff Ammons. In a recent version of Mint Debian, Audacity was still unable to find the LADSPA plugins. I was able to get it to work by setting the LADSPA_PATH environment variable in /etc/environment (using the find command to locate the LADSPA folders):
LADSPA_PATH="/usr/lib/ladspa:/usr/share/ladspa"

Adding "Users and Groups" Back into Linux Mint 13 XFCE

Linux Mint 13 XFCE is beautiful, and just works. It is missing System -> Users and Groups for some inexplicable reason. I assume at some point they'll realize the problem and fix it. In the meantime, you can add it back in like this:

~$ sudo aptitude install gnome-system-tools

Friday, May 11, 2012

Ubuntu Desktop Security Primer

You weren't born yesterday. You know what a firewall is. You know what anti-virus software is. You know what a man page is, and you've Googled more times than you can count. Let's keep this simple, shall we?

Firewall

Ubuntu includes ufw (Uncomplicated Firewall) by default. And by default, it is turned off. Turn it on:

$ sudo ufw enable
Firewall is active and enabled on system startup

Congratulations. Your computer is now wrapped in electronic cellophane.

Anti-Virus

Most viruses are still targeted at Windows, but the paranoid can never be too careful. Here is the version for those with short attention spans.

  • Install it:

    $ sudo apt-get install clamav
  • Update it:

    $ sudo freshclam
  • Run it:

    $ sudo clamscan / -ir --exclude-dir=^/sys --exclude-dir=^/proc --detect-pua

If you'd like a GUI, check out ClamTk.

Tuesday, May 1, 2012

Xubuntu Tip: Switch Users without Logging Out

I've recently installed Xubuntu on a couple of my computers, and generally I prefer it over stock Ubuntu. I had almost forgotten how nice having launchers on the desktop was. Almost. One feature I missed from Ubuntu, though, was being able to switch between different logged in users. With the default Xubuntu setup, you have to log out before you can log into a different account. Problem solved.

  • $ sudo apt-get install xfswitch-plugin
  • Add User Switching plugin to one of your panels.

Nice.

Maven 3: Default Values for Mojo Parameters that are Collections

I love my custom Maven mojos (or plugins). However, I recently ran into a situation where I needed a parameter that was a list of archive types (zip, tar, etc.), and I wanted to specify some reasonable default. Have you ever tried this by specifying a default-value or an expression? After searching for about an hour, I have come to the conclusion that the designers of Maven didn't thing this through all the way.

Not to fear though! There is a way to get this to work, and I like it so much I think I will start using the "hack" in preference to the "right way."

The trick is to specify a default value for the variable in Java. Don't use default-value or expression at all. If the user doesn't override the value, the variable doesn't get set, so it just picks up the default value you've assigned.

The second part of the trick is to document your default settings in the JavaDoc. Since you aren't specifying the value as part of the @parameter annotation, the site-doc report and help won't pick up the value you've assigned.

Here is an example.

/**
 * Types of archives to create. Any of <code>zip</code>, 
 * <code>tar</code>, <code>tar.gz</code>, <code>tar.bz2</code>.
 * <br><strong>Default</strong>: <tt>["zip", "tar.gz"]</tt>
 * @parameter 
 */
protected List<String> types = Arrays.asList("zip", "tar.gz");

One thing to note is that this will only work for constants. Any default values that have to be pulled from the project context (such as project file paths) are going to require an expression. This can't be helped. Those values have to be injected after the plugin is constructed.

Saturday, April 28, 2012

Extract a DVD to an ISO Image

I needed to copy an old DVD (playable home movies), and came across this gem. This command will extract the DVD to an ISO image, ready for burning. I don't know if it works with copy-protected DVDs, but it was exactly what I needed.

$ readom dev=/dev/cdrom f=target.iso

Friday, April 13, 2012

Shrinking a Decade's Worth of ... Part 2

The video compression (see the previous post) worked really well. It worked so well, in fact, that now my videos are much smaller, in total, than my photos.

Here we go again! Well, not exactly. You see, there is a much easier solution to batch-shrinking image files. It doesn't require any scripting at all.

Warning! mogrify modifies files in place!
Before you do this, make sure you have another copy of your image files. mogrify modifies the originals in place. JPEG is a lossy format, and recompressing the files will result in some loss of image quality. As an example of what can go wrong:

DON'T! $ mogrify -quality 7 *.jpg DON'T!

would essentially destroy your originals.

Here are the steps for Ubuntu. Windows users, you are on your own for the installation.

  • Install ImageMagick.
    $ sudo apt-get install imagemagick
  • cd to the directory with your images.
  • Assuming JPEG format, type:
    $ mogrify -quality 75 *.jpg

Wow, that was easy. I love Ubuntu!

For my images, which came from a Digital Elph, the re-compressed images take up less than half the space of the originals, and to me the images look just as good. Experiment with the quality setting and see what works best for you.