2012-01-16

Adding a user in mysql for a specific database

Whenever installing some new webapp on a LAMP stack, the typical procedure goes such that the app gets its own database in mysql/mariadb/drizzle/whatever and needs a user to access it.

The database is of course created like
create database <database>;

To add the user, one usually uses a command like this in the mysql client shell:
grant all privileges on <database>.* to '<new_user>'@'localhost' identified by '<some_password>';

In which I like to use a randomly generated password (e.g. using makepasswd) for each user.

Besides assigning rights, the latter command also creates <newuser> as a side effect, and even flushes privileges in one fell swoop.

One might further want to prune the granted rights to only work on the actual data, not allowing modification of the tables/schema, but most webapps come with an installer built in that creates/updates the app's tables so this is left as an exercise for the reader.

autossh / screen without the hassle

$ autossh -M 0 <host> -t 'screen -x'

2012-01-08

Coping with gnome3

The most important thing to know is of course gnome-tweak-tool, which is pretty much self-explaining once you know it's there.

On less capable machines, fallback mode can be quite cozy too, provided you can do with the limited number applets available. For laptops where vertical screen estate is scarce, know that the panel (bar at the bottom) can still be set to autohide like in the olden days, however it must be clicked with Alt+RightMouseButton to bring up a preferences menu that actually includes this option. Same goes for the top menu, which can hold application icons in case you forgot.

To get rid of the annoyance that is edge tiling (the fact that a window goes fullscreen whenever it happens to touch the top of the screen while you're trying to move it around), one can use gconf-editor and remove the tickmark from /desktop/gnome/shell/windows/edge_tiling.

A great summary of Tips'n'Tricks on this topic is found here. It is based on Mint Linux which deviates somewhat from stock gnome3, but the guide is still very useful.