Friday, August 3, 2012

Re-enable Screen Brightness Controls on Acer Aspire One (Ubuntu)

There appears to be a problem with some computers and Ubuntu-based distributions (verified on Linux Mint 13 and Lubuntu 12.10) where you can't adjust the screen brightness. This only applies if the brightness controls pop up and appear to work, but the brightness does not actually change - it's stuck at full-bright. If you aren't seeing the brightness popup, that's a different problem.

Here is how I re-enabled brightness controls on my Acer Aspire One.

gksudo gedit /etc/default/grub

Find this line:

GRUB_CMDLINE_LINUX=""

Change it to this:

GRUB_CMDLINE_LINUX="acpi_backlight=vendor"

Save changes and update Grub:

sudo update-grub

Reboot.

After doing this, I can fade all the way to black. Great for battery life! Hard to read though.

Thursday, August 2, 2012

XFCE window title and borders gone; no focus, no move

Experienced this problem on Linux Mint 13 XFCE. Not to worry. This post from Linux and Friends puts it all right.
~$ xfwm4 --replace
Many thanks! If I hadn't stumbled across this tip, I don't know how I would have been able to fix this.

This has happened to me three times now.

It appears to have something to do with corruption of the session when you log out. To avoid the problem altogether, set up your desktop the way you want it, and the log out while saving session state (it's a checkbox on the logout dialog). The next time you log out, uncheck that box. If you don't save, you can't get corruption on save, right? That's the theory anyway.


After not experiencing the problem for about 4 months, I have to give a thumbs up to the uncheck the "Save Session State" solution. Theory confirmed. Or someone fixed the bug.

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.