How to FAIL twice in one day
March 2nd, 2009
Have you ever wondered how you could FAIL twice in one day? Sure you have!
Here are two tips to get you going:
Tip one: The ATI graphics driver install
When installing the ATI drivers for your graphic card in Ubuntu: Never ever check what graphic card you really have, take a guess and stick to it. Be sure to spent at least 2 hours trying everything from hacking with the aticonfig-tool to reinstalling the same driver. After two hours (or more) you’ll might find out that you have a X1600 card, instead of a X1300, then the solution becomes fairly obvious. Instead of using 2+ hours you could have done it in about 30 seconds with the correct drivers. But hey, whats the fun in that?! :_((
Tip two: The famous 5-minute WP installation
When you’re about to update WordPress from the 2.6.x to the 2.7.x be sure that you don’t have any backup what so ever! This is a key step to get this guide to work. If you have backup of your wp-config.php, theme files etc. there is no fun in doing this. Delete them right away!
Now, download then newest wordpress version. Before you continue with the actual install you have to make sure that some of the folders have some strange permissions (Why? I don’t know). If you don’t do this your FTP-client (I assume do use FTP) will just overwrite the files and all the fun is gone. Instead you will have a mix of new and old files side by side! Now you have to upload everything from the newly downloaded version of WP and check that the FTP-client is set to overwrite all files.
When the upload is finished you try visiting your blog page, and what do you know, the update has fucked up! At this point it’s important to get frustrated and just delete the whole shebang and try the good old reinstall. The reinstall seems to work, all the files is installing in the right way and everything is great! Now you go to you blog page. What do you see? “There doesn’t seem to be a wp-config.php file. [...]“. “wtf?!” might be your first response, but then you remember, you deleted all the WP-files a couple of minutes ago, including wp-config.php of course.
One should think that missing the wp-config.php isn’t that bad, basically it’s just information to log in to your MySQL database. Well, if you want to make things really interesting you have cleverly disguised your WP-database with a non-describing name. After some minutes looking through your databases you find the database with contains the WP data, and everything seems to go your way.
FINALLY! The blog is back, or wait, what the hell is this?! – The default wordpress theme?! Yes, that’s right. Don’t you remember? You deleted all your old theme files – and you don’t have any backup! Oh well, it shouldn’t take more than a couple of hours to get a working theme up and running again. Enjoy! :(
Summary
Yesterday sucked monkey balls :(
LaTeX in WP
May 24th, 2008
I finally got LaTeX in WP! Now I can write [ tex ] [ / tex ] and voilá! I’m now using a external site for rendering my equations, but as soon as I get the code running on my own server I will of course use my own.
To get this working I had to write a little plugin for WP, which was easier than I thought. Here is the code I’m using:
-
Plugin Name: LaTeX
-
Version: 0.1
-
Author: Ole
-
*/
-
-
function addLatex($text)
-
{
-
$text = preg_replace("/\[tex\](.+)\[\/tex\]/",'<img src="http://www.codecogs.com/eq.latex?\\1" alt="" />',$text);
-
return $text;
-
}
-
-
add_filter('the_content','addLatex');
WP need the comment to get data about the plugin and you simply use the add_filter() to apply your own function on given data. Here I’m using addLatex() on the content.
Here is how it works:
[ tex ] V_{ind} = -\frac{d}{dt}{\int_A{\vec B d\vec A } = -\frac{d\Phi_B}{dt} = -\frac{d}{dt}\left( \int_{a+vt}^{a+b+vt}{ \frac{\mu_oI}{2\pi x} cdx \right) = … = -\frac{\mu_0 Ic}{2\pi}\left( \frac{v}{a+b+vt} – \frac{v}{a+vt} \right) [ / tex ]
Gives:
You gotta love LaTeX, and you gotta love physics. This equation is actually the solution to a problem on an old exam.