Update: The MathJax Plugin for TiddlyWiki has a new home: https://github.com/guyru/tiddlywiki-mathjax
Some time ago, I came across MathJax, a nifty, JavaScript-based engine for displaying TeX and LaTeX equations. It works by “translating” the equation to MathML or HTML+CSS, so it works on all modern browsers. The result isn’t a raster image, like in most LaTeX solutions (e.g., MediaWiki), so it scales with the text around it. Furthermore, it’s quite easy to integrate, as it doesn’t require any real installation, and you could always use MathJax’s own CDN, which makes things even simpler.

Continue reading LaTeX for TiddlyWiki – A MathJax Plugin
Using Monospaced Font in the TiddlyWiki Editor
By default, TiddlyWiki uses its default fonts (Arial or Helvetica) for its tiddler editor. While these fonts are more than fine as the default font for the text in tiddlers, I found them much less convenient when editing tiddlers. Furthermore, they’re even a bad choice when one has code snippets in his tiddlers.
The following code snippet solves the problem by resetting the font used in the editor to a monospaced font. Just add the following snippet:
/*{{{*/
.editor {
font-family: DejaVu Sans Mono, Courier New, monospace;
}
/*}}}*/
To your StyleSheet tiddler (or create it if it doesn’t exist yet). Now, the next time you edit a tiddler, you will do it using a monospaced font.
Temporarily Disabling Bash History
Say that you’ve got to pass some password as a command-line argument to something. It would probably be a bad idea to store it in your ~/.bash_history, but clearing the file isn’t desired either. So you need to temporarily disable the command history for the current session. You can do it by unsetting the HISTFILE environment variable.
unset HISTFILE
The result is that while the session is active, you can access the history as usual, but it won’t be saved to disk. History for other sessions will behave as usual.
search_for_updates 0.2
This is a small update to my search_for_updates script, which has been lying around. The script allows you to search for updates from Portage without resolving dependencies. Thus, it’s much faster than
emerge -pvu world
The new version lists the best version available for each package that can be updated using the --verbose flag. You can download the new version here: search_for_updates-0.2.
CSS Compactor – Reduces CSS File Size
This is a script I wrote back in 2006 that reduces the file size of CSS files by removing unnecessary whitespace and comments. It’s also capable of taking such a compacted CSS file and re-indenting it to make it readable. For example, it would take the following CSS:
/* sample css */
* {
margin: 0px;
padding: 0px;
}
/* define style for the logo */
#header .logo {
float: left;
/* another comment */
}
and turn it into:
*{ margin:0px; padding:0px;}#header .logo{ float:left;}
which is equivalent but much shorter CSS code. It can also re-indent it back to:
*{
margin: 0px;
padding: 0px;
}
#header .logo{
float: left;
}
iproute2 Cheatsheet
The iproute2 package offers the ip utility, which is a modern replacement for tools such as ifconfig, route, arp, and more. It allows you to configure addresses, links, routes, and ARP tables. The only problem is that its documentation can be quite confusing. This post is intended to be a task-oriented guide to this utility. It’s far from complete, and I intend to update it from time to time.
Continue reading iproute2 Cheatsheet
Security Vulnerabilities in the Imagin Photo Gallery
Following a friend’s request, I did a short security review of the Imagin photo gallery a couple of weeks ago. I looked at the newest version, v3 beta5, but the vulnerabilities may also apply to older versions. So here they are, from least to most important in my opinion.
Continue reading Security Vulnerabilities in the Imagin Photo Gallery
WordPress Administration over SSL on Lighttpd
In this tutorial, we’ll walk through the steps of enabling SSL (https) for the WordPress admin panel when using Lighttpd as a web server. The tutorial consists of two stages: the first is enabling SSL at the Lighttpd level, and the second is at the WordPress level.
![]()
Continue reading WordPress Administration over SSL on Lighttpd
Building CookieJar out of Firefox’s cookies.sqlite
Firefox 3 started storing its cookies in a SQLite database instead of the old plain-text cookie.txt. While Python’s cookielib module could read the old cookie.txt file, it doesn’t handle the new format. The following Python snippet takes a CookieJar object and the path to Firefox cookies.sqlite (or a copy of it) and fills the CookieJar with the cookies from cookies.sqlite.
import sqlite3
import cookielib
def get_cookies(cj, ff_cookies):
con = sqlite3.connect(ff_cookies)
cur = con.cursor()
cur.execute("SELECT host, path, isSecure, expiry, name, value FROM moz_cookies")
for item in cur.fetchall():
c = cookielib.Cookie(0, item[4], item[5],
None, False,
item[0], item[0].startswith('.'), item[0].startswith('.'),
item[1], False,
item[2],
item[3], item[3]=="",
None, None, {})
print c
cj.set_cookie(c)
It works well for me, except that apparently Firefox doesn’t save session cookies to disk at all.
Kernel Configuration and nvidia-drivers
This is more of a note to myself, as I keep forgetting this. The proprietary NVIDIA drivers, provided by x11-drivers/nvidia-drivers, dislike alternatives. They will refuse to build against a kernel with rivafb (CONFIG_FB_RIVA) and nvidiafb (CONFIG_FB_NVIDIA) built in or built as modules. Both can be found (and unset) under:
Device Drivers
-> Graphics support
-> nVidia Framebuffer Support
-> nVidia Riva support
