Thursday, July 15, 2010

HOWTO reset mysql database root password

Despite having a pretty decent password storage system, I occasionally find myself without a root password for my MySQL dev servers.  MySQL has a procedure for resetting the password that involves using an init file.  Personally I like this (similar) solution better because you don't need to worry about syntax errors in your SQL since you have an interactive prompt.  Here is the summary:

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root mysql
UPDATE user SET password=PASSWORD("ualue=42") WHERE user="root";
/etc/init.d/mysql restart

Saturday, July 10, 2010

Font size too small or too big in Gnome or Xfce

I've recently had some font-size battles.   Ever had the problem where you get your resolution right, but the font is either tiny or so giant you can barely use the menu dialogs?

The solution: DPI.

For gnome: Go to System->Preferences->Appearance->Fonts->Details and change the 'resolution: dots per inch' value.

For xfce: Go to Applications->Settings->Appearance->Fonts and change the 'Custom DPI Settings' value.

The commands
xdpyinfo | grep resolution
xrdb -query
are useful for determining your current DPI values.

You can also fiddle with the system font settings, and in Firefox you can change Edit->Preferences->Content->Fonts&Colors->Advanced->Minimum font size.  You can also change Firefox's zoom level with Ctrl-Alt-+ and Ctrl-Alt--.  Ctrl-Alt-0 will set the zoom back to zero.  By default the zoom settings are rembered on a per-site basis, but you can change this in about:config.

For your terminal fonts, you can use the fixed width system font settings, or change your terminal profile with Edit->Profile Preferences.