Thursday, 31 May 2012

Consolidating an online presence

I've recently spent some time consolidating my online presence - something I've been working towards for a while, but I've finally pulled a lot of my most active online hangouts (this blog, Twitter, Github), under the umbrella of Mat Alan Gilbert. I've felt it was important to amalgamate my profile into something more coherent, so that it's easier to track what's going on in my world at any particular time.

It's become clear however, that there's one incredibly important part of my life who isn't represented in my online presence nearly as much as she should be. Becky Prince, my wonderful fiancĂ©, is a huge part of my life, and as such, I'm dedicating the first 1000 blog views (this milestone was passed a while ago, but it's still a nice achievement), and my 100th tweet to her. I can't wait to marry her in Minneapolis, and am looking forward to a life in the sun with her.

Becky, thank-you for all your love and support - my life is so much richer for having you in it.

And P.S. happy almost-anniversary!

Wednesday, 16 May 2012

Visual Ruby and Glade: cannot create instance of abstract (non-instantiatable) type `GtkBox'

If you get the error:

GLib-GObject-WARNING **:cannot create instance of abstract (non-instantiatable) type `GtkBox'

When using Visual Ruby and/or Glade to design a Ruby-GNOME2 user interface, the reason is that the latest version of Glade (3.10) has dropped support for Gtk::VBox and Gtk::HBox - it replaces them both with Gtk::Box. This breaks Gtk::Builder. The solution is to use Glade 3.08, which can be installed (for Ubuntu, and Ubuntu based distributions such as Linux Mint) using:
 sudo apt-get install glade-gtk2=3.8.0-0ubuntu3  

To find the correct version/package name for your distribution, use:
 apt-cache showpkg glade-gtk2  

and find version 3.8.0.

If using Visual Ruby, be sure to update the Glade Command Line setting by going to Tools -> Settings and entering

in the Glade Command Line box.

Friday, 11 May 2012

Connecting to a VPN from the command line in Linux Mint / Ubuntu

Set up the VPN using the Network Manager applet, then open a Terminal. The command to connect to a VPN is:
 nmcli con up uuid <your-uuid-here> 

To find out the UUID of the VPN connection, use:
 nmcli -p con list

The command to disconnect from a VPN is:
 nmcli con down uuid <your-uuid-here>

Fixing Hibernate Problems in Linux Mint Part II

My previous attempts to make hibernation work for my Linux Mint installation didn't entirely solve the problem. My system has been hanging far less than usual, but would still occasionally hang at the s2disk hibernating screen.

After a lot of reading, it seems to me that there's problem with the s2disk utility, and so I've worked around the problem using an older, more stable method of hibernation:
 sudo echo disk > /sys/power/state  

This will hibernate the machine, and resume the session when it is powered back up. It's not as fast as s2disk, and doesn't display any information while hibernating (it shows a black screen unless there are errors), but is far more stable, for my set up at least.

I put the command into a one line script, in /usr/bin/, then added an entry in sudoers (see this post) to remove the requirement for a password to be entered. Finally, I added a launcher to Cairo-dock, so that now I have a consistent, stable hibernation function for my Linux Mint installation.

How to run a script requiring sudo without needing a password

To run a script that has a sudo command in it, without needing to enter a password whenever the script is executed, add an entry in sudoers.
First, open sudoers using visudo:
 sudo visudo  

Then add the following line to the bottom of the file:
 <user> ALL=NOPASSWD: <absolute_path_to_script_file>  

Where <user> is the user running the script, and <absolute_path_to_script_file> is...self explanatory :). Though I've found that the script needs to be placed in /usr/bin/ to for the entry in sudoers to be effective.

Save the changes to the file, and log in and out to enact the change. Now, when you sudo script, there will be no prompt for a password.

Monday, 7 May 2012

Spell Checking a Latex Document using Aspell

 aspell --mode=tex check <filename>  

 aspell --mode=tex -c <filename>  

Where <filename> is the file to be spell checked.