Linux FLOSS

Posts about Linux and other FLOSS (Free Libre Open Source Software)

Status.net Word Filter Plugin (Wordfilter)

The TWiT Network has pretty strict rules about profanity across all channels including the netcasts, chatrooms and the TWiT Army Canteen. There are usually moderators lurking the IRC and microblog but once in a while some profanity gets through the cracks. Therefore I wrote a little word filter to preempt the profanity.

Poor Man's Dock - add a simple dock style launcher in XFCE

dock desktop

After having gotten fed up with Gnome I decided to try XFCE as suggested by most of my Linux-using Twitter friends and I must say, it's a huge improvement.  One thing I missed though was Gome-do's dock launcher.  While I could install Gnome-do in XFCE it would install a ton of required packages and also requires compiz to look normal.  Instead I decided to create a simple and fast dock launcher that needed no extra packages.

Add the new Google Caffeine search engine to your Firefox search bar

Update 11/11 Sandbox closed

It was fun while it lasted but Google has officially closed the Caffeine search sandbox. I will leave the code below for reference but be advised the search plugin will not work.

Google announced a new search engine preview today called "Caffeine" that can be found at http://www2.sandbox.google.com, and while it looks the same on the surface the results are certainly different. To simplify using this new engine I whipped up a plugin to add the new engine to the Firefox search bar.

CodeIgniter CSRF (XSRF) library

They say a lot of developers work on things to scratch their own itch. This is me scratching.

I'm a fan of the CodeIgniter project but I find it odd that such a well developed framework lacks CSRF protection in the core. There are a few CI CSRF libs but most of them are outdated so I wrote my own. A few ideas came from Michael Wales' toolkit but this library is written from scratch. One of the major differences is that this toolkit uses form IDs instead of a timer to handle forms in different tabs which I find more robust since it doesn't rely on time.

Download csrf-v4.tgz

Status.net Plugin Developer Helper Plugin (PDhelper)

As with most open source projects, the Laconica (now Status.net) team focuses much more on development than documentation. That's not necessarily a bad thing for the project but makes it harder for third party developers. I had to use a lot of trial and error when working on the TWiT Army Laconica Plugin.

Here's where I had some trouble:

  • Finding the right hook to insert elements in specific places
  • Determining the 'action' name for the loaded page
  • Figuring out how to remove elements

For the last one, it turns out that returning bool FALSE for some hooks will prevent the default output. That was a good idea by the dev team. As for the first two, I decided to create another plugin that just spits some markers and useful PHP object data. You can see a demo of this plugin on my Status.net test site: status.kylehasegawa.com. Some of the markers are not in the body element so these markers are added as HTML comments. View the source of the test site to see these markers.

Comments, feedback, and suggestions are more than welcome. Full source code below the break.

Update v0.3 2010/01/05

  • Status.net v9.0 support (tested on 0.9.0rc2)
  • XHTML now mostly valid (<!DOCTYPE is not on line 1)
  • Other minor enhancements

TWiT Army Laconica Plugin

I was recently asked by my friends over at the TWiT Army to checkout the new Laconica plugin system in version 0.7.2.1. They wanted to know if it could be used to modify the default Laconica output on the TWiT Army Canteen, a feature currently handled by Javascript after the page is loaded. Javascript was used because it saves them from having to modify core code since core changes complicate upgrades. The downside of Javascript is that users see a brief flash of the original output before the JS runs. Another problem with JS modifications is that users who disable JS won't see the page as intended. I doubt anyone besides the TWiT Army will actually use this plugin but it's a decent example of how to use the plugin system so I hope it will be helpful for someone.

What the plugin does

  • Inserts 'apple-touch-icon' link in <head>
  • Adds 'helmetlink' and 'logolink' divs
  • Adds 'toplinks' and 'toplinks2' divs and lists (Live, Leoville, ODTV etc.)
  • Adds 'watermark' and 'bugle' div
  • Replaces nav links (tabs) on some pages

My Linux cheatsheet

I have a text file with some of my favorite Bash commands and I thought I'd share them. Some are specific to CentOS/RHEL/Fedora but most are simple and useful. Feel free to comment if you can improve on any of them. Cheers.

Drag and Drop Images From Firefox 3

Here's a little trick that I haven't seen on any of the many redundant of "Firefox 3 tips" blogs.
Simply drag images from a page to a local directory to save. How easy is that!

This will even work on sites use JavaScript to deter right click context menu saving..

Firefox 3 extensions requiring cookie exceptions

First of all, if you're not browsing the web with third party cookies disabled please stop reading and disable third party cookies for your own protection. Third party cookies (TPC for the remainder of this blog) are generally a bad thing. Don't believe me, listen to Security Now!

Unfortunately, you may have noticed that some of your extensions broke after disabling TPC. There are a number of extensions (add-ons) which require TPC but it's always safer to whitelist trusted sites than to try to blacklist all the bad ones. Here are some extensions which require TPC exceptions and the domain required for the exception. You should try to whitelist the most specific level domain (subdomain) where possible.

Backup multiple Gmail accounts with Thunderbird Portable

envelope logo

Gmail is the best email solution in my opinion but there have been a few reported cases of lost emails so it's always a good idea to keep an offline backup. There are a number of ways to do this and even a few freeware and commercial applications made specifically for backing up Gmail but I prefer a more standard solution and free is always a good thing.

All code on this site is free for use at your own risk and provided as-is under the WTFPL license unless otherwise stated. Attribution is appreciated but not required.
Blog content, with the exception of externally quoted material, is licensed under the Creative Commons Attribution 3.0 license