Malicious enjoyment derived from observing someone else’s misfortune
 

Tag Archives: howto

Super Key Fix in Ubuntu

So I found that my super key was not a modifier key in GNOME today, but rather a standalone key. THis was unacceptable. To change it, I did this: System -> Preferences -> Keyboard -> Layout Options -> Alt/Win Key Behavior -> Super is mapped to Win-Keys Now, I can change my shortcuts to not be stupid.

HUGE Mistake in Ubuntu Feisty Fawn HERD 5

Wow. Just wow. After being frustrated for hours, I found this post on why Ubuntu Feisty Fawn HERD 5 was completely ignoring that I had any hard drives during initramfs. I kept getting to the USB HID part (which happens after the ‘Waiting for root filesystem…’ message) and hard locking for about 5 minutes before dropping to the initramfs shell. Here’s how to fix this absolutely stupid and negligent problem: Get your LiveCD and go into rescue mode (I used [...]

How to make a Mephisto Plugin

So, I figured I might as well provide a quick tutorial on how to make Mephisto Plugins currently. Many of the old plugins are broken, so there needs to be a resurgence of plugin development. Here’s the basic structure of the Tag Cloud plugin: mephisto_tag_cloud – init.rb README – lib – mephisto_plugins – tag_cloud.rb As you can see, the structure is very simple. Here’s my code for init.rb Liquid::Template.register_filter(MephistoPlugins::TagCloud) That’s it! No require or anything! Next, I edited lib/mephisto_plugins/tag_cloud.rb: module [...]

Extending RedCloth

I wanted to put emoticons into Textile for Beast, but to do it, I needed to use very few lines of code since there is a 500LOC limit on Beast. After a long time debugging, here’s what I came up with: First, I made a new method in the RedCloth namespace. class RedCloth def refs_smiley(text) text.gsub!(/(\s)~(:P|:D|:O|:o|:S|:\||;\)|:’\(|:\)|:\()/) do |m| bef,ma = $~[1..2] filename = ActionController::AbstractRequest.relative_url_root+”/images/emoticons/”+(ma.split(//).collect{|l|l[0]}.join(‘_’))+”.png” “#{bef}<img src=’#{filename}’ title=’#{ma}’ class=’smiley’ />” end end end All I’m doing here is some nifty gsubbing [...]

Make irb Do Tab Completion

I was missing readline. The sadness. Thanks to these guys, i fixed it. Here’s how to do it on FC5: sudo yum install ncurses-devel readline-devel cd ruby-1.8.4/ext/readline ruby extconf.rb make sudo make install

Simultaneous SVN Dump and Load with Netcat

I started by looking at the code from here. Then, I decided I should use netcat instead of scp. Here’s the result: cd <repos dir> svnadmin dump reponame | nc6 -x <NewServer> 7676 cd <repos dir> svnadmin create reponame nc6 -x -l -p 7676 | svnadmin load reponame Works like a charm – it’s awesome to have 2 windows open and watch the simultaneous dump and import – how hot.

Successful Settings for Apache forwarding to Mongrel

So, after a day of working on it, I finally fixed the problems I was having. I wanted to have Apache forward all traffic hitting a path to a mongrel server running in a rails application. So, I did as bish0p suggested, and set up the rails app to accept this behavior. First, I put this at the bottom of my environment.rb: ActionController::AbstractRequest.relative_url_root = “/MyRailsApp” This make it so all the urls in the Rails app are prepended with /MyRailsApp. [...]

Building Subversion and Apache Trunks

I was trying to move the subversion server today, and found some good tips, but I had some problems today building subversion, so I decided I better write the process down. While I’m at it, I better detail the steps to install apache as well. Apache Get the trunk, and go to the source library directory: svn co http://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x httpd-2.0 cd httpd-2.0/srclib Now, check APR out of svn: svn co http://svn.apache.org/repos/asf/apr/apr/branches/0.9.x apr svn co http://svn.apache.org/repos/asf/apr/apr-util/branches/0.9.x apr-util cd .. Build with [...]