Upgraded Blog to Typo 5.0.3
The blog has been updated to Typo 5.0.3. There were just a handful of issues which had to be addressed from my old 4.1.1 install.
- cp ../typo-4.1.1/config/database.yml ./config/
- rake db:migrate
- ./script/plugin install http://svn.typosphere.org/typo/plugins/delicious_sidebar
- ./script/plugin install http://svn.typosphere.org/typo/plugin/xbox_sidebar
- rake tmp:clear
- rake tmp:create
- rake sweep_cache
- rake db:sessions:clear
- rake log:clear
Then I updated the theme to Scribbish and I was done.
Posted in Howto | no comments |
Swallow: An Add-on to Gurgitate-Mail
I just recently got Amber setup on my swallow and gurgitate-mail system today, which turned out to be more of a bear than I thought it would. The main issues had to do with installing 0.9.5 rubygems locally on her accounts, configuring DSPAM, and setting up the MySQL database. As promised eariler, here's a run down of the features of this system:
Advantages
- "Quick-to" addresses. Don't want a million aliases? Auto-create them with quick-to's. These allow you to setup a run that says "any address with looks like xxxxxx-com, put in the Commercial folder". This means I don't have to have separate microcenter-com, amazon-com, etc, emailing aliases (which I used mainly to ferret out spammers). Now they are created automatically and always get stuffed into my Commercial folder.
- Universal "Read" Count: Since this is an IMAP account, I never have to worry about which device/client has read which email.
- Really good Spam engine, DSPAM.
Disadvantages
- DSPAM needs it's own MySQL database.
- DSPAM needs to have it's tables purged every once in a while
- Gurgitate-Mail and Swallow need a generic rules script which is part of neither.
- Swallow has to be configured for exactly what you want. This took the least amount of time out of all these.
Assumptions
This brief guide assumes:- You have your own domain.
- ...on Dreamhost.com
- ...you have webpanel access
- ...you can create users.
Installing:
- Create private domain, or subdomain.
- Create the main user account, make sure they have email.
- Create a "catch-all" email forwarder, for that subdomain.
- If you just forward the catch-all to your main, you don't need to worry about a spamfilter account, but if you want to reduce the flow to your main (add subsequently reduce the email in your suspicious folder, you can create a secondary account in domain which will receive the catch-all's and forward to your main user as needed. However, this requires that the secondary's .procmailrc has to be configured manually to coincide with your main user's ruleset.yaml (to be described later).
- Install RubyGems locally (I used $HOME/usr as my prefix)
- Install Gurgitate-Mail Gem
- Install Swallow Gem
- Download .gurgitate-rules.rb (renamed to .gurgitate-rules.rb)
- Download example .swallow-config (rename to .swallow-config)
- Download example ruleset.yaml
- Create Whitelist.yaml (a YAML array of strings which are email addresses)
- Create Aliases.yaml (another YAML array of strings which are email address)
- Install DSPAM on Dreamhost
- Create a MySQL host and table for DSPAM
- Create Folder structure in your mail client to reflect those in your ruleset. You must have a:
- Innocent - for emails which are wrongly marked as Junk (in the Junk folder)
- Junk - emails which DSPAM thinks are spam
- Suspicious - emails which weren't handled. They weren't in the whitelist, or junk, so they could be fine, but you'll have to handle them manually. Put them in Junk if they are.
- Write a .procmailrc for your account. Don't forget to create the .forward.postfix file.
- Optional: Train DSPAM
MAILDIR=$HOME/Maildir
LOGFILE=$MAILDIR/procmail.log
SHELL=/bin/sh
RUBYLIB="$HOME/usr/local/lib/site_ruby/1.8"
GEM_HOME="$HOME/.gems"
GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8"
PATH="$HOME/usr/bin:$GEM_HOME/bin:${PATH}"
LINEBUF=4096
# Use Gurgitate Mail to Sort my email.
:0
| $HOME/.gems/bin/gurgitate-mail
# We've not been able to decide what to do with it, lets just stick it in the
# Suspicious Folder.
:0
$HOME/Maildir/.Suspicious/
Posted in Howto |
A preface to Gurgitate-Mail on Dreamhost
When I got my iPhone, I decided to go back to using my Dreamhost account through IMAP so that I could have a single account with a persistent state. While this is nice, I didn't want to have to wade through a ton of spam on my iPhone. Since I wasn't neccesarily have Mail.app or Thunderbird open all the time at home running mail filters, and you can't do that on the iPhone, I was in a bind. How do I filter my mail easily and still use IMAP across multiple devices?
I came across Gurgitate-Mail, a great little filter which is launched by procmail or whatever you use to receive email. You can write some pretty concise email rules or make it even more complex. The point is that you can write rules in a proper programming language instead of cobbling together something in your favorite Mail program. In the coming days I will be posting more about what I've done.
Posted in Journal, Howto | no comments |
Poor Man's Tagging
an adventure in triple nested hashes.
PMT is a ruby script which can help you sort your data in a manner which has been heretofore unavailable in Windows NT/2k/XP. Lets say you have a lot of files of a limited set of types (source code, docs, TRM's, manuals, etc...) which are used in a limited set of projects that you work on, all which can be grouped together under some sort of name. Lets say for exmaple we have a few sets of these.
- Your custom Rails App in source code for some project
- This ruby script and it's docs
- Your library of PDF's about programming
- A few year's tax returns
PMT allows you to "tag" your data, in a exceptionally crude and gross scale, and then sorts it into a tagging heirarchy in your file system using "junctions" in Windows (or softlinks in other OS's) to point back to the original data.
First, arrange your data in the "raw" folder with the following naming template: name_type_project
raw/
MyCustomApp_src_Programming/
pmt_src_Programming/
pmt_doc_Programming/
Books_pdf_Programming/
taxes2006_doc_Finances/
taxes2005_doc_Finances/
And then run the script to auto-generate this tree (all peers to "raw"):
by project/
Finances/
doc/
taxes2006/
taxes2005/
Programming/
doc/
pmt/
src/
MyCustomApp/
pmt/
pdf/
Books/
by type/
doc/
Programming/
pmt/
Finances/
taxes2006/
taxes2005/
src/
Programming/
MyCustomApp/
pmt/
pdf/
Programming/
Books/
by name/
taxes2005/
doc/
Finances/
taxes2006/
doc/
Finances/
pmt/
doc/
Programming/
src/
Programming/
MyCustomApp/
src/
Programming/
Books/
pdf/
Programming/
These are just examples. You can develop your own Project names, types, group names. You might find that only one type of organization appeals to you. I found that I tend to use multiple approaches to find information. Using this system, you can find it anyway you need to.
Dependencies
This project is dependent on the "junction.exe" program provided by http://www.sysinternals.com. It's a really neat little utility that takes all the headache out of making junctions in Windows (the ruby implementation would be quite nasty).
Usage
Simply call the scripts with -c for create, -d for delete, or -r to delete, then create the structure. It will assume that you'll want to have the folder structure defined from where you call it.
by name by type by project raw [emrainey@macbookpro ~/Data]$ pmt.rb -c
Incidently this should also work in *nixes too like Mac OSX, but it uses "ln -s" instead of junctions.
Converting your old Mac Mini into the new Apple TV hotness
First we have to talk about prerequisites. I already have a Mac Mini. It's already been upgraded to 1GB of RAM. It already has an external hard drive to supplement the internal drive. All the media I have will be stored on the external drive. I already had the ATI Remote Wonder. These are all sunk costs in this venture and don't factor into the buy or reuse argument. Now, on to the good stuff.
- I bought a DVI to HDMI cable at Fry's for $14.
- I checked out Mighty Dave's guide to pimping out the Mini with the Remote Wonder software and it's related information about DisplayConfigX. Cost: $12 (optional if you don't care about overscan/under-utilization of the screen).
- Installed Matinee. Cost: Free
- Installed Democracy. Cost: Free
- Installed FrontRow for Mac Mini PPC (via Enabler 1.5). Cost: Free
- Then I mapped all the FrontRow keys to keys on the ATI Remote Wonder using this guide.
- Then I installed this startup script which allow automatically boots the Mac Mini into FrontRow and does some other AppleTV mimicry.
Now, there are some drawbacks. The Mac Mini is not really a go-er if you know what I mean. It's a bit lacking in the horsepower department. When playing back full screen HD content, it's a bit pokey. When the USB disk is being used by another application, such as a torrent client, lets say, the playback is rather poor, even for smaller vids. So in the end it appears that I'll have to use this much like a really AppleTV in that I'll have fixed transfer or sync times or at least stop the possibility of updating podcasts or torrent downloads while playback is active.
Posted in Howto | no comments |
The Art of Tagging
Dear Galt, I love it. I love it too much in fact. It caters to my OCD tendancies and I know I spend far too much time doing it. It's just that it feels so damn good to get my bookmarks sorted. It's the same sort of feeling one gets from a clean house or an organized desk. It feels efficient, powerful, sleek and functional. Well I guess you have to like that sort of thing. Anyway the purpose of this post is to help those who are unfamiliar with tagging (Hi Mom!) to get a better grip on what it is and how to use it effectively.
First, what is it? I define it as "the Art of non-heirarchical, potentially orthagonal, data organization". This means that tags are meta-data which can be used to sort your normal data in a way that does not fit into a layered series of "folders" (non-heirarchical) and that may be applied across your data in ways that form matrix-like structures (as in tables, not dystopias). For example, take my del.icio.us bookmarks. I use the term Art because this is not an area which can tolerate a set of strict rules, but instead, must use a set of fuzzy or flexible rules which allow for adaptation and possibly paradoxes. If you use a system of tagging which is too restrictive you will find that some data can't be organized with it, but if you use a system that is too loose, you'll find that it is ultimately useless. The utility of the system is somewhere in between, and finding that is an Art (as in "a skill that is attained by study, practice, or observation, which arises from the exercise of intuitive faculties." Not as in "the human effort to imitate, supplement, alter, or counteract the work of nature", which incidently is a bad definition is a bad definition in and of itself.)
Basically, tagging is only useful if you maintain a consistent organization policy. You must use the same methodology to sort all your tags. You can't expect to have a useful tagging system if you change the way you sort, half-way through your bookmark imports, or in a year from now. Now I'm not saying that you can't change the way you might organize your tags in the future, you should just reorganize all your preexisting tags to fit the new heirarchy.
Tagging cuts to the core on a lot of deep computer science issues which I am not well versed enough in, nor qualified to lecture about. If you are interested in formal systems like tagging you can look up such concepts as Godel's Incompleteness Theorem as more verbosely described in Godel, Escher, Bach. On a less mathmatical note, you should also read up on Folksonomy, which is basically the uncontrolled result of the internet comming up with a tagging system. They are unsystematic and rather noisesome. I'd steer clear of trying to adhere to what you might think is "the way the people on the internet" do tagging because it generally stinks.
There are only a few rules about how to tag when you break it down to fundamentals.
- Use of Multiple Orthagonal Heirarchies
- Topical Coherence
- Consistent Usage
- Editing (revisting your organization)
The whole point of tagging is really summed up in the first item (the rest are for better usage of the concept).
Most people keep their bookmarks in complex, nested folder systems. When they file a bookmark they'll put it in the place that seems most logical at the time. The question is, will you find that organization logical when you try to look it up later? With tagging you simply put all the relevant information you could possible organize that link with into the tags and when you go to look it up later, you simply need to look it up only one of those terms.
Lets take a look at my del.icio.us links to see what I mean.
I sort of several different heirarchies which are not necessarily related to each other (thus, orthagonal). Typically I use:
- Site Type: blog, portal, email, stores, etc...
- Topics Covered: news, gadgets, electronics, ruby, etc...
- Heirarchal Topics, like: mac osx software drivers
- Frequency of my visits: daily, weekly, monthly, yearly
Let's look as at another example.
Let's say that I am a new mac user and I'm bookmarking all the new software I download on my MacBook Pro so that I can check it weekly or monthly or whenever and update it as necessary. So, using this system I would tag the bookmarks with "mac osx software monthly" for monthly updates or use whatever time frame I would want. Not only can I get a folder like presentation with this system, but I can then also have a list of all the sites I need to visit on whatever time period I like. You can then make a firefox RSS bookmark for your "monthly" sites and just schedule some time for yourself to cruise all of them once a month. You'll notice that some of those links in my mac osx software list also have other tags on them. This is part of the power of the tagging mindset. I only need to record that bookmark once with tagging, where before I had to place the bookmark in multiple locations in my bookmark folders and maintain all of them. Here, I maintain one link with some meta-data.
So in summation, tagging is just a system of organization which allows you to sort your data in a very flexible way with less work maintaining that organization.
Posted in Howto | no comments |
TunnelBlick on MBP
- Download TunnelBlick 3.0 RC2 or better and install in /Applications/
- Create your Root Certificate and Key, and all your client keys on the OpenVPN server (reference).
- Copy the required files ca.crt and the client keys to ~/Library/openvpn/ on your Mac
- Create a .conf file in that directory which will serve as your connection description. If your familiar with the Windows versions, be sure to name your dev items (usually "tun0") and your dev-node items (usually "/dev/tun0") correctly (see reference again for sample config files). Be sure to match the type of tunnel as with the type on your server (tcp to tcp, tun to tun, etc).
- Expose the OpenVPN port (which is configurable on the server) to the outside, beyond the firewall.
- Add entries into your hosts file to support name resolution over your tunnel, or setup a Split DNS Server.
- Connect!
Posted in Howto | no comments |
URL Protocol Launcher
In order to make my Active Desktop actually useful for shortcuts and functions that I commonly do, I wrote a little utility which translates the URL Protocol invocation created by clicking on an HREF in an HTML file.
And you have these entries in your registry (cut and paste into a reg file and merge it):
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\ssh]
@="URL:SSH Protocol"
"URL Protocol"=""
"EditFlags"=dword:00000002
"BrowserFlags"=dword:00000008
[HKEY_CLASSES_ROOT\ssh\DefaultIcon]
@="%SystemRoot%\\system32\\url.dll,0"
[HKEY_CLASSES_ROOT\ssh\shell]
@="open"
[HKEY_CLASSES_ROOT\ssh\shell\open]
[HKEY_CLASSES_ROOT\ssh\shell\open\command]
@="C:\\bin\\launchurl.exe \"%1\""
This will invoke the utility I wrote which will then access the following registry keys (also cut, paste into a reg file and merge):
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\URL Protocol Launcher]
"ssh"="C:\\PROGRA~1\\Putty\\putty.exe -load \"%1\""
"cmdshell"="C:\\bat\\shell.cmd \"%1\""
"ue"="\"C:\\Program Files\\UltraEdit\\uedit32.exe\" \"%1\""
"google"="C:\\PROGRA~1\\MOZILL~1\\FIREFOX.EXE -url \"http://www.google.com/search?q=%1\""
"vnc"="\"C:\\Program Files\\TightVNC\\vncviewer.exe\" -compresslevel 5 -quality 5 %1"
These keys define the actual program to call with all the proper command line switches and it supports a single variable replacement.
You have your active desktop HTML with a link in it like this:
<a target="_top" href="ssh:somehost">Somehost (SSH)</a>
Which invokes:
"C:\bin\launchurl.exe ssh:somehost"
which will then in turn launch
"C:\PROGRA~1\Putty\putty -load "somehost"
And most importantly this will do all of this with no popups from explorer, complaining that it can't find the proper file! This method is completely extensible to any protocol. You just need to add it like I added ssh: above.
Here's the zip file. You need to install the launchurl.exe binary somewhere and then change the paths in the reg file to match that path. Also, double check your paths in the URL Protocol Launcher key.
Super Customizing your Active Desktop
As I'm playing around with layout and links on my active desktop page, I'm finding that support for launching apps or content out of HTML files is...limited to put it kindly. Currently there are two ways to solve this problem.
- Your choices are:
- File Type Associations via file: URL Protocol Handler
- New URL Protocol Handlers, like ssh:hostname
Both of these have problems.
File Associations: These are standard extensions to the file type model of Windows. In this method you simply put your link in your HTML file as a file: link. The system figures out which app to launch for that type and does so.
<a target="_top" href="file:C:\myfile.txt">My File</a>With this method, you have to have a pre-existing type association for .txt files, which is very common, so you're probably good. In fact this is great for any type of content editing. If you have a file you commonly edit and a known editor, this is great. This model breaks however whenever you want a application to behave in a certain way though. Let's say that you want to open a command window in a certain directory. Well, you can't do it directly in the HTML file. You'll have to have a secondary .bat or .cmd file which does the path change and any other default actions. This is where URL Protocol Handlers come in. If you install a special URL protocol for command windows like "cmdshell:". Then you can stipulate the path that you'd like to open directly in your HTML file.
<a target="_top" href="cmdshell:C:\TEMP">CMD in C:\TEMP</a>Cool, huh? Turns out there are a few default URL protocol handlers for windows which make life easier. They are:
- http(s): Web pages.
- ftp: FTP sites.
- gopher: Gopher Sites (if you know what that means)
- file: The standard file "open" method.
- telnet: Opens your default telnet app and connects you to the client which was the parameter.
- ssh:hostname - The Secure Shell connection
- cmdshell:dir - Open a command window in the provided directory.
- vnc:hostname - Open a VNC connection to the host.
- ue:file - Force an open with UltraEdit.
- google:search - Query Google with the provided term.
Now you could try to solve this problem by using file types and the file: URL and create a custom type which when launched acheives the same end goal as the URL protocol handler. This is tricky and will probably require another custom cmd file or app.
Once I have the utility running (without that dang popup) I'll post a link to the source and the registry edits you'll have to make in order for it to work.
Posted in Howto | no comments |
Active Desktop & XBox 360 Live
<html>
<head>
<title>
My friends's XBox 360 Live Cards
</title>
</head>
<body bgcolor="#0077FF">
<iframe src="http://gamercard.xbox.com/sobokhan.card" scrolling="no" frameBorder="0" height="140" width="204">Sobokhan.</iframe>
<br />
<-- Add more cards here -->
<br />
<iframe src="http://gamercard.xbox.com/globalreset.card" scrolling="no" frameBorder="0" height="140" width="204">GlobalReset.</iframe>
</body>
</html>
Posted in Howto | no comments |
