Thursday, June 28, 2012

cannot load such file -- zlib

When getting started with Ruby, this error might appear:


ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::InstallCommand


However, it is fairly simple to fix. Run the following commands from your terminal.

rvm pkg install zlib
rvm remove 1.9.3
rvm install 1.9.3

Hope that helps!

Thursday, June 21, 2012

Gnome Shell grid workspaces

By default, Gnome Shell tries to maintain only one workspace including the ones that are in use. This can be a great pain when being used to have some sort of structure on your desktop.

There is however a combination of extensions for Gnome Shell that allows you to configure your good 'ol 3x3 or 6x2 set of workspaces! Here are the links:


When both are installed, rigt click anywhere on the workspace indicator on the bottom right side of the screen and select how many workspaces (vertical and horizontal) you want.

Update:

You may also want to hide the bottom panel. By default this is not an option.
However, there are basically two fixes available.

1. With CSS (the most clean way)

Open, and edit ~/.local/share/gnome-shell/extensions/Bottom_Panel@rmy.pobox.com/stylesheet.css on line 6, change the height to 0px.

All credit goes to Brian McSweeney

2. With JavaScript (the alternative way)

For instructions, have a look at this comment at Ask Ubuntu.

All credit goes to Rasmus.

PS

In both cases, remember to update GNOME Shell (Alt + F2) and execute 'r' (for refresh).

Happy tweaking!

Saturday, June 9, 2012

Log out of basic auth with JavaScript

Ever wanted to log out of a basic authentication session with only JavaScript?

The following code requires jQuery, but it is of course possible to hack something together with plain JavaScript.

$.get(document.URL.replace(/(https?:\/\/)/, '$1logout@'));

Update:
I have figured out that this doesn't work all the time, and it seems unreliable. However, it may be used as a last resort.