Turn on query logging in MySQL
By Joao
Add the following to /etc/my.cnf:
log=/var/log/queries.log
Then restart mysqld.
All queries will be logged to that file. In MySQL 4.1 the log file must already exists beforehand. Check /var/log/mysqld.log during startup in case it’s not logging anything.
Cannot start Microsoft Office Outlook. Cannot open the Outlook window.
By Joao
Start->run..then type the following -> “Outlook.exe /resetnavpane”
Problem loading ssh keys remotely
By Joao
When I try to load my ssh-key from a remote location I get the message:
Could not open a connection to your authentication agent.
The way to get around this is to load a shell session inside the ssh-agent:
ssh-agent bash
ssh-add
ssh-add ~/.ssh/somekeyfile
How to force yum to uninstall a package when you change it’s name
By Joao
Use the obsoletes tag in the specfile. This will cause “package-oldname” to be uninstalled before installing “package-renamed”.
Name: package-renamed
Obsoletes: package-oldname
Using dd to create large files
By Joao
An example of using dd to create a 1GB file.
dd if=/dev/zero of=testfile bs=1M count=1024
How to temporarly ignore foreign keys in MySQL InnoDB.
By Joao
SET FOREIGN_KEY_CHECKS = 0;
SELECT @@FOREIGN_KEY_CHECKS;
SET FOREIGN_KEY_CHECKS = 1;
Alexander Stetsenko blog has more info about it.
How to open a .eml file in Outlook 2007
By Joao
If you try to open a .eml file in Outlook 2007, it will create a new message containing the .eml file as an attachment.
In order to read .eml files from Outlook 2007, you need to pass the /eml argument to outlook.exe . This Microsoft kb article describes how to tweak the windows registry to accomplish this.
Essentially you need to edit the HKEY_CLASSES_ROOT/Microsoft Internet Mail Message\shell\open\command default value to :
“%ProgramFiles%\Microsoft Office\Office12\OUTLOOK.EXE” /eml “%1″
To revert back to using Outlook Express, set the value of the same key to:
“%ProgramFiles%\Outlook Express\msimn.exe” /eml:%1
Find largest files
By Joao
A little code snippet to show files ordered by size:
find . -type f -printf "%k %p\n" | sort -rn | head
Apache2::Request rpm
By Joao
Not immediately obvious, but if you’re looking for an rpm to install the Apache2::Request module you need perl-libapreq2 (this works in CentOS 5 and I imagine others as well).
yum install perl-libapreq2
Common yum commands
By Joao
List available repositores
yum repolist
Search by package name (case insensitive)
yum list "*package*"
List files inside a repository package (regardless if that package has been installed)
repoquery --list <PACKAGE_NAME>



January 7th, 2010