Posts tagged Linux
April 07th, 2010
Clean parameter based Nginx re-writes with map
Topics: Nginx, Howto, LinuxWhen switching to my new blog I needed to re-write all the old Wordpress URLs to point to the appropriate place. Problem is rewrites don't using arguments so I was stuck.
Luckily Curly060 and Seph in #nginx gave me some ideas and we ended up with this:
# Put this outside of server stanza
map $arg_cat $category {
6 /blog/topic/security;
11 /blog/topic/mac;
8.* /blog/topic/lisp;
9.* /blog/topic/code;
3 /blog/topic/linux;
14 /blog/topic/thoughts;
10 /blog/topic/php;
7 /blog/topic/security;
12 /blog/topic/emacs;
5 /blog/topic/projects;
9 /blog/topic/code;
13 /blog/topic/python;
1 /blog;
8 /blog/topic/lisp;
}
# Put this with other re-writes
if ($category) {
rewrite ^ $category;
}
If you want to do a permanent redirect you have to clear all the arguments to stop the browser being caught in a redirect loop. The last stanza would now look something like this:
if ($category) {
set $args "";
rewrite ^ $category permanent;
}
March 08th, 2010
Flash, Google Chrome and Debian Linux
Topics: Linux, HowtoHere’s how to get flash working on Chrome under Debian:
su - cd /opt/google/chrome wget http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_1_p3_linux_022310.tar.gz tar xvzf flashplayer10_1_p3_linux_022310.tar.gz mkdir plugins mv libflashplayer.so plugins/ rm flashplayer10_1_p3_linux_022310.tar.gz
Then just restart Chrome :)
November 13th, 2009
Changing Magento path
Topics: Howto, LinuxIf the Magento path changes everything breaks, here’s how to fix it:
Run this query in your Magento database:
update core_config_data set value='http://new-url.com/' where value='http://old-url.com/example/';
and delete your cache
rm -r magento/var/cache/*
December 31th, 2008
Hacked :(
Topics: Security, Thoughts, LinuxI’ve been hacked, it looks like they got in through a Roundcube vulnerability and used my system as part of a DoS with kaiten.c. I have turned the server off completely for now. I’m part way through changing all my passwords and I will format the server tomorrow.
What a pain in the arse, at least it looks like script kiddies instead of anyone out to get me personally. Before I wipe the box I am going to have a look to see what they did, I will write it up if it’s anything interesting.
Rootkit hunter said the box is clean, anyone know of good ways / tools to see what the nob-head did?
- Dave.
Edit: It was my email server so if you don’t get a reply from me for a couple of days you know why.
January 18th, 2008
Virgin Media Broadband Installation on Linux
Topics: Thoughts, Howto, LinuxJust a quick warning to any Linux users who are getting Virgin Media broadband installed.
The welcome website you put your details into when the connection is first hooked up actually checks if you are using Windows / Mac or not. If not you will get this error:
“Incompatible OS or Browser To set up Virgin Broadband, your computer needs to use a recent version of Windows or Apple Mac OSX and have a compatible Internet Browser. It looks like your computer does not meet these requirements. For further information please consult your set-up guide or give us a call on 0906 212 1111*. * Calls cost 25p per minute, with a 10p connection fee from Virgin Media landlines. If you’re calling from a mobile phone, or another network, the charge may vary.“
Anyway the solution is easy, install tamper data and Under the “Tamper Data - Options” you can update the User-Agent to Internet explorer or Safari etc. which the website allows.
It’s a stupid check anyway really as to the computer it’s just an ethernet connection so why it would only work on certain operating systems is beyond me!