jump to navigation

Sort recursively by date September 29, 2008

Posted by maxmil in : shell scripting , 1 comment so far

This little combination of commands sorts a list of files by descending date reading all the files recursively from the current folder
find . | xargs -i ls -l {} | sort -rk 6 | awk '$1 != "total" {print $0}'

Modifying the user-agent header sent by firefox/iceweasel September 23, 2008

Posted by maxmil in : Debian , add a comment

Some sites don’t let you in if your not using internet explorer… booo hooo.

The solution is to change the user-agent header sent by your browser. If you use firefox or iceweasel this is acheived by
1) In the address bar type about:config
2) Accept the warning to enter into your preferences editor
3) Right click and "create new string"
4) Give it the name general.useragent.override
5) Give it the value that you want
6) Exit

Removing the new configuration value is a bit harder
1) Edit /prefs.js
2) Delete the line that contains general.useragent.override
3) Save and restart firefox/iceweasel

Modifying the user-agent header sent by firefox/iceweasel

Posted by maxmil in : Debian , add a comment

Some sites don’t let you in if your not using internet explorer… booo hooo.

The solution is to change the user-agent header sent by your browser. If you use firefox or iceweasel this is acheived by
1) In the address bar type about:config
2) Accept the warning to enter into your preferences editor
3) Right click and "create new string"
4) Give it the name general.useragent.override
5) Give it the value that you want
6) Exit

Removing the new configuration value is a bit harder
1) Edit /prefs.js
2) Delete the line that contains general.useragent.override
3) Save and restart firefox/iceweasel

Enable boot logging in debian

Posted by maxmil in : Debian , add a comment

By default boot messages are not logged on debian.

To switch on boot logging modify the file /etc/default/bootlogd to

BOOTLOGD_ENABLE=Yes

Adding new pgp keys to apt September 22, 2008

Posted by maxmil in : Debian, Security , add a comment

I’ve had to search for this too many times its about time that i jot it down here.

After adding a new repository to my /etc/apt/sources.list i often get an error something like

W: GPG error: http://some.address Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXX

The solution is a two liner


gpg --keyserver hkp://subkeys.pgp.net --recv-keys XXXXXXXXXX
gpg --export --armor XXXXXXXXXX | sudo apt-key add -

Where XXXXXXXXXX is the key in the original error message.

Mysql log files in debian

Posted by maxmil in : Debian, MySql , add a comment

I was desperately trying to find the output from the innodb_table_monitor in debian but the files /var/lib/mysql.err and /var/lib/mysql.log were empty.

This is because under debian mysql redirects its log files to /var/lib/syslog.

List a directories content by size September 19, 2008

Posted by maxmil in : Debian , add a comment

This is not complicated but very useful
du --max-depth=1 /usr/local/apps | sort -n -r