Guy Rutenberg

Keeping track of what I do

Archive for the ‘Tips’ Category

Deleting Comments from Tickets in Trac 0.12

without comments

About a year ago I wrote about a way to delete comments from tickets in Trac prior to version 0.12 (as it didn’t exist back then). Basically the method was to directly delete the comment from the database. Lately, spammers have been harassing one of my Trac installations, bypassing the spam filtering, and changing ticket properties. The old method wouldn’t revert those changes. After searching for a solution, I found a little documented option in Trac 0.12 that allows to delete comments and revert changes to tickets.

To enable it, go to the admin panel->Plugins->Trac 0.12 and enable TicketDeleter under tracopt.ticket.deleter.*. This will add a “Delete” button right next to the “Reply” and “Edit” buttons of every comment. It will also revert any changes to the ticket properties.

See #3641 and [9270] for the relevant ticket and changset in Trac’s own Trac.

Written by Guy

July 9th, 2011 at 7:55 pm

Posted in Tips

Tagged with

LaTeX for TiddlyWiki – A MathJax Plugin

with 24 comments

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’s 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.

TiddlyWiki with the MathJaxPlugin

A tiddler with LaTeX equations.

Read the rest of this entry »

Written by Guy

June 25th, 2011 at 5:05 pm

Posted in JavaScript,LaTeX,Tips

Tagged with , ,

Using Monospaced Font in the TidddlyWiki Editor

without comments

By default, TiddlyWiki uses its default fonts (Arial or Helvetica) for it’s tiddlers editor. While these fonts are more than fine as default font for the text in tiddlers, I found it much less convinient when editing tiddler’s. Furthermore, it’s 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 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’ll edit a tiddler you will do it using a monospaced font.

Written by Guy

June 11th, 2011 at 10:58 am

Posted in Tips

Tagged with

Temporary Disabling Bash History

with 5 comments

Say that you’ve got to pass some password as 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 temporary 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 the disk. History for other sessions, will behave as usual.

Written by Guy

May 10th, 2011 at 12:21 pm

Posted in Bash,Tips

Tagged with

iproute2 Cheatsheet

with one comment

The iproute2 package offers the ip utility, which is a modern replacments for tools such as ifconfig, route, arp and more. It allows to configure addresses, links route 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.
Read the rest of this entry »

Written by Guy

December 29th, 2010 at 12:25 am

Posted in Linux,Tips

Tagged with

Kernel Configuration and nvidia-drivers

without comments

This is more of a note to myself, as I keep forgetting this. The propriety NVIDIA drivers, provided by the x11-drivers/nvidia-drivers dislikes alternatives. It will refuse to build against a kernel with the 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

Written by Guy

November 19th, 2010 at 4:41 pm

Posted in Linux,Tips

Tagged with ,

sudo for X Programs

with 2 comments

By default (at least on my machine), it wasn’t possible to open X applications using sudo. For example sudoing xclock resulted in the following error:

$ sudo xclock
No protocol specified
Error: Can't open display: :0.0

The same error appeared even when I executed xclock after running sudo su.
Read the rest of this entry »

Written by Guy

November 12th, 2010 at 11:15 am

Posted in Linux,Tips

Tagged with ,

Eject Your Kindle and Reconnect under Linux

without comments

I am Your User suggested a method to eject your Kindle in Linux. While his method works, you don’t need to specify the partition number. E.g.

$ sudo eject /dev/sdd

where /dev/sdd is the device file of the Kindle.

But what if you want to reconnect it back without plugging in and out the usb cable? You can add the -t switch.

$ sudo eject -t /dev/sdd

Even though it prints the following error:

eject: CD-ROM tray close command failed: Input/output error

it works, and the Kindle reappears in KDE.

Written by Guy

November 6th, 2010 at 4:02 pm

Posted in Linux,Tips

Tagged with

Deleting Comments from Tickets in Trac

without comments

Spammers apparently love Trac. After trying to fighting spam tickets and later installing the SpamFilter plugin, I’ve managed to control spam tickets in the Open Yahtzee Trac site.. But now spammers started spamming in the ticket comments. The bad news is that Trac (at least in version 0.11) doesn’t have built-in facilities to completely remove ticket comments.


Read the rest of this entry »

Written by Guy

May 19th, 2010 at 3:42 pm

Posted in Tips

Tagged with

URL-Safe Timestamps using Base64

without comments

Passing around timestamps in URLs is a common task. We usually want our URLs to be as shortest as possible. I’ve found using Base64 to result in the shortest URL-safe representation, just 6 chars. This compares with the 12 chars of the naive way, and 8 chars when using hex representation.

The following Python functions allow you to build and read these 6 chars URL-safe timestamps:
Read the rest of this entry »

Written by Guy

April 30th, 2010 at 8:08 pm

Posted in Tips

Tagged with , ,