Category Archives: Tools

List of Favorite OS X Web Developer Apps

The following tools are either open source, shareware or freeware. For shareware, I will post freeware alternatives.DEVELOPMENT* JetBrains RubyMine (for Ruby and Rails development)

DEBUGGING
* Charles Proxy
* PHP xdebug with remote_enable = true

* SourceTree (if you use git)
* Cornerstone (if you use svn)

PRODUCTIVITY
* iTerm2
* Zshell with Oh My Zsh
* BetterSnapTool
* Mou (Markdown Editor)
* Tabs Outliner extension for Chrome

OTHER
* LittleSnitch
* Skitch
* Dropbox
* SuperDupr! or Time Machine
* RescueTime
* Solarized Theme (for shell, TextMate, etc.)

Remote repository hosting
* BitBucket.org
* GitHub.com
* GitLab.com

A dedicated IDE or Editor. Pimping Your IDE will be in another post. Here are my most used editors/workflows (not in any specific order. Usually the right one for the job.)

MacVim with solarized (light) BG but I’m constantly tweaking the colorscheme. Font is one of Anonymous, Source Code Pro, Consolas, Inconsolata, all patched for powerline (optional.)

I use NeoBundle to manage my vim packages. Here are my current bundles:

" After install, exec ~/.vim/bundle/vimproc, (n,g)make -f your_machines_makefile</pre>
NeoBundle 'Shougo/vimproc'
NeoBundle 'Shougo/vimshell'
NeoBundle 'kien/ctrlp.vim.git'
NeoBundle 'honza/writer.vim'
NeoBundle 'vim-ruby/vim-ruby'
NeoBundle 'plasticboy/vim-markdown'
NeoBundle 'juvenn/mustache.vim'
NeoBundle 'tpope/vim-rails'
NeoBundle 'tpope/vim-fugitive'
NeoBundle 'tpope/vim-unimpaired'
NeoBundle 'tpope/vim-abolish'
NeoBundle 'tpope/vim-surround'
NeoBundle 'tpope/vim-bundler'
NeoBundle 'tpope/vim-surround'
NeoBundle 'tpope/vim-characterize'
NeoBundle 'tpope/vim-haml'
NeoBundle 'tpope/vim-rake'
NeoBundle 'Lokaltog/vim-easymotion'
NeoBundle 'jeetsukumaran/vim-buffergator'
NeoBundle 'tilljoel/vim-automatic-ctags'
NeoBundle 'git://github.com/kchmck/vim-coffee-script.git'
NeoBundle 'altercation/vim-colors-solarized'
NeoBundle 'vim-scripts/Vim-R-plugin'
NeoBundle 'vim-scripts/R-MacOSX'
NeoBundle 'vim-scripts/vim-mou'
NeoBundle 'vim-scripts/ShowMarks'
NeoBundle 'vim-scripts/dbext.vim'
NeoBundle 'vim-scripts/Txtfmt-The-Vim-Highlighter'
NeoBundle 'vim-scripts/mru.vim'
NeoBundle 'vim-scripts/YankRing.vim'
NeoBundle 'majutsushi/tagbar'
NeoBundle 'mileszs/ack.vim'
NeoBundle 'ervandew/screen'
NeoBundle 'L9'
NeoBundle 'Gundo'
NeoBundle 'mattn/zencoding-vim'
NeoBundle 'scrooloose/nerdtree'
NeoBundle 'scrooloose/nerdcommenter'
NeoBundle 'jistr/vim-nerdtree-tabs'
NeoBundle 'nathanaelkane/vim-indent-guides'
NeoBundle 'git://git.wincent.com/command-t.git'
NeoBundle 'git://github.com/Lokaltog/vim-powerline.git'
NeoBundle 'http://svn.macports.org/repository/macports/contrib/mpvim/'
<pre>

Tmux + vim

Installing Alan Storm’s LayoutViewer in Magento (works with 1.7!)

I use the debug toolbar but nothing beats Alan Storm’s configviewer and layoutviewer. Unfortunately the only archive of this on Alan’s site is missing a module config file to activate it. Below is a simple shell script to download, install and activate the LayoutViewer in any version of Magento. I can confirm it works flawlessly in Magento 1.7. If you’d like to manually install this module, read the “manual installation” section below.

Script

#!/bin/sh

#VIEWER_HTTP_DOWNLOAD="http://alanstorm.com/2005/projects/MagentoLayoutViewer.tar.gz"
VIEWER_HTTP_DOWNLOAD="http://biodegradablegeek.com/MagentoLayoutViewer.tar.gz"

# If in root, go to app/code/local
if [ -f "index.php" ]; then
    cd app/code/local;
fi

echo "Using curl to download Magento LayoutViewer"
curl -so - $VIEWER_HTTP_DOWNLOAD | tar xvzf -

echo "Writing app/etc/modules/ config file"
(
cat <<'ConfigFile'
<?php xml version="1.0"?>
<config>
<modules>
 <Alanstormdotcom_Layoutviewer>
   <active>true</active>
   <codePool>local</codePool>
 </Alanstormdotcom_Layoutviewer>
</modules>
</config>
ConfigFile
) > ../../etc/modules/Alanstormdotcom_Layoutviewer.xml

echo "Done. Visit any page with ?showLayout=page"

Save this to a file and run “sh” in your Magento root.

Manual Installation

Download the MagentoLayoutViewer and extract the Alanstormdotcom folder to [magento-root]/app/code/local/

Create a new config file in app/etc/modules/ named Alanstormdotcom_Layoutviewer.xml  and paste in it the following:

<?php xml version="1.0"?>
<config>
<modules>
 <Alanstormdotcom_Layoutviewer>
   <active>true</active>
   <codePool>local</codePool>
 </Alanstormdotcom_Layoutviewer>
</modules>
</config>

Done. See usage below.

Module Usage

Visit any URL with ?showLayout=page (or handle or package) to retrieve the layouts XML

The module also accepts a showLayoutFormat=text argument if you’d like plain text instead of XML.

Example: http://my-store.cxm/product/123?showLayout=page&showLayoutFormat=text

Small Vim Shortcut for PHP Tags

The short tags in PHP have been deprecated as of 5.3.0. Short tags provided a shorter alternative to the annoying-to-type <?php and <?php echo. Instead, you could use <? and <?= respectively. This was great but it caused problems when working with XML files, and the short_tags option was disabled in the PHP config by default on some implementations.

To make life easier, I created this vim mapping that will expand <? to <?php and <?? to <?php echo. You may change the abbreviation as you see fit. Simply place this in your .vimrc

inoremap <??    <?php echo  ?><Left><Left><Left>
inoremap <?     <?php  ?><Left><Left><Left>

Re-open vim or type use :source ~/.vimrc to reload the config. Now just type <? or <?? in insert mode.

How to Block AIM’s Annoying ‘AOL System Msg’ in Pidgin

The following plugin for Pidgin will block the incredibly annoying and useless notifications from AOLSystemMsg on AIM.

“AOL System Msg: Your screen name (mrEman) is now signed into AOL(R) Instant Messenger (TM) in 2 locations. Click here for more information.”

To use, paste code in file, save file as blockaolsystemmsg.pl in ~/.purple/plugins/ and then open (or re-open) Pidgin and go to Tools -> Plugins (or press CTRL+U), and enable “Block AOLSystemMsg.” That should be it!

If you’re having any trouble, try going to Help -> Debug to open up Pidgin’s debug console.

#!/usr/bin/perl
# BlockAOLSystemMsg plugin tested on Pidgin 2.5.5. Put in ~/.purple/plugins/ and enable
use Purple;
our $target = 'AOL System Msg'; # case-insensitive
our $plugin_name = 'Block AOLSystemMsg'; 

%PLUGIN_INFO = (
  perl_api_version => 2,
  name => $plugin_name,
  version => "0.1",
  summary => "Blocks the screen name 'AOL System Msg'",
  description => "Ignore annoying 'your SN has signed on at 2 locations' AIM message",
  author => "Isam ",
  url => "http://biodegradablegeek.com",
  load => "plugin_load",
  unload => "plugin_unload"
);

sub loginfo { Purple::Debug::info($plugin_name, " @_\n"); }
sub minimize {
  my $r = lc($_[0]);
  $r =~ s/ //g;
  return $r;
}

sub plugin_init { return %PLUGIN_INFO; }

sub plugin_load {
  my $plugin = shift;
  $target = minimize($target);
  loginfo("Sight set on '$target'");
  Purple::Signal::connect(Purple::Conversations::get_handle(),
                          'receiving-im-msg', $plugin, \&callback, '');
}

sub plugin_unload {
  my $plugin = shift;
  loginfo('Block AOLSystemMsg Unloaded.');
}

sub callback {
  my ($acc, $sender, $msg, $flags) = @_;
  if (minimize($sender) eq $target) {
    loginfo("(BLOCKED) <$sender> $msg");
    return 1
  };
}

update: Fixed the botched code. Thanks.

I Can’t Live Without My vim Config

I have updated the vim page with my vimrc/gvimrc configs. Instead of repeating myself, I will quote some parts of the page ..

More details and the vim config itself here

I recommend turning backups on if you have them off. I personally hate having the ~ files all over my OS, so I keep them along with the .swp files in 1 backup dir in ~/.vim/

The programming language skeleton stuff will detect what files you are editing and change options in vim by inheriting the specified files which I put in ~/.vim/skeletons and ~/.vim/inherit.

The skeletons are automatically inserted in new files that vim is aware of. For example, in my own config, I have ~/.vim/inherit/c which has all the usual includes and int main() code. When I make a new C file (“gvim hello.c”), the new file begins with the skeleton code already present. Neat huh?

The inherit files can be used to set specific options for each language. This can mean different bindings, whitespace options, themes, etc depending on what language you’re working with, automatically.

See the vim page

What options have helped you the most?

How to Maintain Static Sites with Git & Jekyll

Static sites in this context just means non-database driven sites. Your static site can be an elaborate PHP script or just a few markup and image files. For this I am using Jekyll – A neat Ruby gem that makes your static sites dynamic. It lets you create layouts and embed custom variables in your HTML (this is a “prototype” of the site).

Jekyll tackles all the nuisances involved in creating static pages (I used to add just enough PHP to make a layout). It works by running your prototype through some parsers and outputs plain static HTML/XML (RSS feeds) etc. It’s perfect for lightweight sites that would be impractical on WordPress, like a few static pages of information, landing pages, portfolio/resume pages, and parked domains.

Git takes care of keeping your development (local) and production (remote) environments synced. Git might be a little confusing if you’re learning it with the mindset that it works like Subversion.

I’ll update this post when the guide is done. For now, the following will assume you’re familiar with Jekyll (or at least have an empty file in the prototype directory) and git. This Bash script simplifies creating the remote git repository:

** please read through the code and make sure you know what this does, and what you’re doing. As of now, this is bias towards my own Apache/vhost setup. It’s trivial to edit for your specific needs. You’re using this at your own risk.

(direct link – repogen.sh)

#!/bin/sh
# 
# 04/01/2009 | http://biodegradablegeek.com | GPL 
# 
# You should be in site (NOT public) root (be in same dir as public/ log/ etc)
# proto/ is created and will house the jekyll prototype
# public/ will be the generated static site
# the public/ folder will be REMOVED and regenerated on every push
# 

if [ -z "$1" ]; then
  echo "Usage: ./repogen.sh domain.comn"
  exit
fi

# optional. will make it easier to copy/paste cmd to clone repo 
SSHURL="ssh.domain.com"
URL="$1"

echo "** creating tmp repo"
mkdir proto
cd proto
git init 
touch INITIAL
git add INITIAL
git commit -a -m "Initial Commit"

echo "** creating bare repo"
cd ..
git clone --bare proto proto.git
mv proto proto.old
git clone proto.git
rm -rf proto.old

echo "** generating hook"
HOOK=proto.git/hooks/post-update

mv $HOOK /tmp
echo '#!/bin/sh' &gt;&gt; $HOOK
echo '# To enable this hook, make this file executable by "chmod +x post-update".' &gt;&gt; $HOOK
echo '#exec git-update-server-info' &gt;&gt; $HOOK
echo '' &gt;&gt; $HOOK
echo '' &gt;&gt; $HOOK
echo 'URL='"$URL" &gt;&gt; $HOOK
echo 'PROTO="/home/$USER/www/$URL/proto"' &gt;&gt; $HOOK
echo 'PUBLIC="/home/$USER/www/$URL/public"' &gt;&gt; $HOOK
echo  '' &gt;&gt; $HOOK
echo 'export GIT_DIR="$PROTO/.git"' &gt;&gt; $HOOK
echo 'pushd $PROTO &gt; /dev/null' &gt;&gt; $HOOK
echo 'git pull' &gt;&gt; $HOOK
echo 'popd &gt; /dev/null' &gt;&gt; $HOOK
echo '' &gt;&gt; $HOOK
echo "echo -----------------------------" &gt;&gt; $HOOK
echo "echo '** Pushing changes to '$URL" &gt;&gt; $HOOK
echo "echo '** Moving current public to /tmp'" &gt;&gt; $HOOK
echo 'mv "$PUBLIC" "/tmp/'$URL'public-`date '+%m%d%Y'`"' &gt;&gt; $HOOK
echo 'echo "** Generating new public"' &gt;&gt; $HOOK
echo 'jekyll "$PROTO" "$PUBLIC"' &gt;&gt; $HOOK

echo "** enabling hook"
chmod a+x $HOOK 

echo "** clone repo on local machina. example:"
echo "git clone ssh://$USER@$SSHURL/~$USER/www/$SSHURL/proto.git"

Usage

Your site structure might be different. repogen.sh is made by pasting the above code in a new file, and then chmod a+x to make it executable. This should be done on the remote server.

cd www/domain.com/
ls
public/ private/ log/ cgi-bin/

./repogen.sh domain.com

Now on your local machine, clone the new repo, move your files in, and push:

git clone ssh://[username]@ssh.domain.com/~[username]/www/domain.com/proto.git
cd proto/
cat "hello, world" &gt; index.htm
git add index.htm
git commit -a -m 'first local commit'
git push

After you push your changes, the post-update hook will delete the public/ directory (the root of the site). This dir and its contents are automatically generated and will get wiped out on EVERY push. Keep this in mind. All your changes and content should reside in proto/.

The proto/ repo will pull in the new changes, and then Jekyll will be invoked to generate the updated site in public/ from the prototype.

Should you need to edit it, the post-update hook is in the bare git repo (proto.git/hooks/)

Thanks to the authors in the posts below for sharing ideas. I first read this git method on dmiessler’s site.

Resources:
dmiessler.com – using git to maintain static pages
toroid.org – using git to manage a web site
Jekyll @ GitHub
git info
more git info

Top 10 Firefox Extensions that Enhance Usability

All of these extensions work on Firefox 3.x

Firebug


What can I say.. Firebug is indispensable. It’s quite possibly the greatest piece of software since Firefox itself. It’s a *must* have if you do any sort of XHTML/CSS/Javascript/AJAX/er.. anything!

You can edit code on any site, live. Hate the annoying background on a specific site? Get rid of it. Ugly font? Change it. No contrast between colors? No problem. The changes aren’t permanent, of course (that’s what Greasemonkey‘s for).

There’s no better AJAX/CSS debugger. It even has a console you can use to interact with the site. Works with AJAX libraries (since they’re essentially just Javascript), and jQuery can output text to the Firebug console. No more alerts()!I won’t even go into the neat array of plugins it has.

Just get it. Tip: F12 toggles Firebug, and ctrl+F12 opens it in its own window.


Open In Browser

This should be built into Firefox.

FF Save as.. dialog

It’s still experimental, so you need to register to install it, but it’s well worth it. Sometimes when you’re viewing images or ASCII files (like source code) online, you want them viewed in the browser, but the site forces you to download them.

One example any Google Images Surfer is aware of is the fact that images hosted on Blogger cannot be viewed in the browser. Very annoying – unless you have this extension installed. It adds an option to open files in the browser to the file download dialog.


Tabs Open Relative

This should not only be built into Firefox, it should be the default behavior.

Causes new tabs to open next to the current tab, instead of launching after the last tab you have open.


Download Statusbar

What’s more annoying than tabs opening a thousand pixels away? The Firefox download dialog. It’s big and too intrusive to keep open permanently, and I get annoyed when the download is done and it suddenly vanishes. Solution? Download to the desktop and don’t use the download dialog.

Another solution? Use this extension. In mini-mode (full-mode is too bloated IMO), it displays the number of files still in progress on the bottom-right of the browser, and a single click on this opens a little “drop up” menu that displays your downloads and their status. Hovering over the filename reveals all the info you need about that download. Double clicking the file opens it and removes it from the download list.

And the ctrl+Y default download dialog is still available and functions normally (if you want to use it).


Ubiquity

Ubiquity is to Firefox what Quicksilver is to OS X, what Gnome Do is to Linux. From its Wikipedia page:

Ubiquity’s main goal is to take a disjointed web and bring everything the user needs to them. This is accomplished through a command-line-like interface which is based on natural language commands. These commands are supplied both by Mozilla and by individual users. Commands are written in Javascript and either directly typed into the command editor that comes with Ubiquity or subscribed to. Commands to which a user subscribes are automatically updated when the author updates the code.

I won’t go in-depth about this because Aza has done so already.




NoScript

This extension is initially unappealing because it seems to break most sites. What it does is disable Javascript (and by default, Flash) on any new sites you visit, until you explicitly teach NoScript that they’re trustworthy.

Besides nuisance and security reasons, one huge benefit is the fact that you can block/unblock specific domains per site. So you can enable JS on a site but keep Google Analytics or some annoying JS ads being loaded remotely, disabled.

I used NoScript on and off, but finally settled on making it permanent by changing some options to make it less annoying to me. These settings work good for my own browsing habits; YMMV.

  • Stop auto-page reload – I prefer doing this manually.
  • Forbid everything except Flash and IFRAME – nspluginwrapper crashes Flash all the time anyway :P
  • Show Status bar icon (not label)
  • Place blocked-scripts message on the bottom instead of top
  • Hide message after 3 seconds – I don’t even need this. I’m aware that JS is off by default now
  • Allow local links – Good if you develop

The main turn-off people have towards NoScript is the fact that you need to get used to unblocking sites you’ve been visiting hassle-free for years, but after a few days you’ll notice that, since you only need to allow a site once (permanently), nearly every site you visit on a regular basis will be whitelisted and will work as it always had.

My whitelist has hundreds of items, and I do view new sites on a daily basis, but in the past few days the only site I recall turning JS on for was InventiveLabs’, to see the crazy js light-switch effect.


Stealther

Stealther has plenty of uses, one of which is being able to quickly see what your site will look like for users with cookies disabled, but it’s not a very versatile porn-mode. A lot of sites require cookies to be enabled, including Google Images (to keep the filter option saved), but Stealther has be fine tuned.

Hiding your history can also be achieved by using ctrl+H, sorted by Last Visited, and just hitting DEL on the top few links (why can’t you ctrl/shift select?) you visited. It doesn’t remove everything, but removes enough.


Gmail Notifier

This is not the same as Google’s Gmail Notifier Toolbar.

I’ve tried a bunch of Gmail notifiers for browsers, Gnome, KDE, etc. Nothing compares to Firefox’ Gmail Notifier. First, who only has 1 email address anymore? A notifier needs to allow multiple accounts. Second, I’d like to be notified of unread messages only until I actually visit my inbox and decide whether I want to read them or not. Many notifiers will continue to bug me until I mark the emails read or explicitly tell the notifier to stop.


Adblock Plus

I like ads. Well placed ads, not the Adsense box in the middle of an article, or sites that have more ads than content, like About.com. Ads are downplayed and taken for granted, but some are brilliant, and they still work, even on us geeks. But people hate them, and so we have Adblock.

I initially couldn’t stand this extension because it kept blocking legitimate images. That was way-back-when, and I was re-introduced to adblock when I picked up Swiftweasel. Actually, I don’t know if re-introduced is the right word. I just happened to notice it was available and was too lazy to remove it.

Install it, set it on the easy-filter and forget about it. If curious, here is the difference between Adblock vs Adblock Plus.


TimeTracker

I have a bad habit of losing track of my time when browsing the web (I’m literally addicted to the Internet). This extension helps shed light on this fact. . It keeps track of how long you’ve been using wasting your life browsing the web.

Has a useful filter option to disregard specific sites (i.e., editing your router settings, doing job related work, etc). However, in practice, I usually forget I have it installed and don’t notice it. What I really want is a timer that will alert me every N minutes I’m viewing a site. So if I’m on Wikipedia for more than 10 minutes, it’ll bring me back to Earth and make me realize that I should be working instead of holding ctrl and clicking every in-site link on the Wikipedia page.

The extension is actively being developed, and a lot of nice features are planned (see this thread).

(Honorable mention)

Vimperator

Vimperator is amazing. You know those crazy ideas you get sometimes that you think are brilliant in a humorous, “if only,” sarcastic, sort of way, like “Why can’t everything in life have a vim-like interface and bindings?” — yeah, that’s exactly what Vimperator does with Firefox.

Opera users may check out this page.




What Firefox extensions do you recommend?


Spy on your Enemies and Loved Ones for Fun and Profit

The following is a stealthy keylogger I wrote in C a few years ago called LogThatShit (LTS). It was written on and for Windows XP, and probably works on Vista, but User Account Access (UAC) might prompt the user for a password. It began as a complete Remote Administration Tool (RAT) named Overdose. I realized that the keylogger is the most important part of the RAT and decided to branch that off into a separate project.

As of 09/09/08, LTS remains undetectable by anti-virus software. It bypassed the heuristic analysis engines of its time, but the more advanced ones today might pick it up.

I am releasing the source code under the GPL license, with no warranty whatsoever, for educational purposes only. I don’t use it, and I don’t suggest you use it. Usage might be illegal where you live, if not just unethical. I will not compile/send out any binaries. I don’t even know if it’ll compile out of the box.

Feature set (This was written a long time before the app was complete, and was never updated)

A key stroke logger for Windows 9X/NT/2K/XP

  • Hijacks a process, meaning it will not show up on the task manager.
  • Bypasses heuristics engines.
  • Starts up automatically on boot. Does not show up in msconfig.
  • Logs OS, timestamp, Windows username, and the title and path of the window that currently has focus.
  • Can be updated or removed from the victim’s computer remotely.
  • Ability to download and and launch an executable silently from an FTP site.
  • Does not show up on the task manager on both 9X and NT platforms.
  • CPU and memory usage do not increase. No noticeable performance or memory hit.

Geeky Details:

  • Written in ANSI C89
  • Developed on XP SP1. Tested for Windows 2000 and XP SP2. Code includes some windows 9X stuff, but it was winged and never tested.
  • Uses a system-wide hook (WH_KEYBOARD).
  • Editor used was gvim (win32) with no plugins and mappings, but with some custom commands added to Windows’ right click context menus, and a bunch of batch (.bat) and Makefiles.
  • Compiled using GNU make and other ported utilities.

The following was somewhat of a list of things I never got around to doing:

  • TODO: Need thorough testing on 9X
  • TODO: Restart feature
  • TODO: Change INFINITE to 1000ms
  • TODO: Don’t use general permissions on mappings / mutex.
  • TODO: Load self into memory and poll for presence, rewrite files if not available (persistence mode).

Technical:
The following is written off the top of my head. When executed, the keylogger may display a customized error message to fool the victim into thinking the program is simply broken or outdated. This is to deter suspicion that the program is malicious, which is the reaction most people have when nothing happens as they sit there trying to open an application.

The logger than copies itself to the SYSTEM32 folder (name is set in the ini config file) and adds itself to system startup. It uses several methods to do this, depending on the OS, but the preferred method is to register itself as an ActiveX object. This hides it deep in the registry, under a unique key, and keeps it out of the msconfig -> startup tab. It also keeps it out of most apps that display programs that launch on system startup.. or at least it did at the time. I think HijackThis and its ilk have caught up now.

When configured, the ‘Stub’ (EXE file) is appended with two DLL files; Hook and Injection. At this point, the stub injects a DLL (injection.dll) into explorer.exe (it also looks for the default browser to use as a backup). This is called DLL injection, and is used to bypass firewalls that only allow trusted programs access to the Internet, else the firewall will give a “notepad2.exe wants to access the Internet. Are you sure you want to allow this?” warning.

Nowadays, firewalls will prompt the user that a program has been altered or has loaded new DLLs (especially if they aren’t in the same folder as the application), but nearly every user will just click “ALLOW” without caring – especially when the application in question is Explorer.exe or Firefox.exe.This also means the user will not notice much in the process manager (ctrl+alt+delete).

Stub remains open but idle; Closing it will unload the DLLs. Most of the work now is done inside Hook.dll. Keys are intercepted at a low level, logged, and then sent where they’re supposed to go. This is better than other loggers that just poll for keys, since it is very efficient and will not cause a memory/performance hit.

The logfile will store the title and file path of the application that has focus, and every keyboard key sent to that application. Capslock, backspace, enter, tab, shift, “special keys” and so forth are also logged and labeled. I.e., Shift might be [LSHIFT] or [RSHIFT]. All timestamped.

An example would be:

Biodegradable Geek > Login – WordPress – Firefox (c:programsfirefoxfirefox.exe)
——————————————————————————-
[04:39:93] [RSHIFT]Isam[TAB]password123[ENTER]

There’s a few more features and technical details. View the source below:

// This software file (the "File") is distributed under the terms of the
// GNU General Public License Version 3, (the "License"). You may use,
// redistribute and/or modify this File in accordance with the terms and
// conditions of the License, a copy of which is available along with the
// File in the license.txt file or by writing to
//  Free Software Foundation, Inc.,
//  59 Temple Place,
//  Suite 330, Boston, MA, 02111-1307
//
//  or on the Internet at http://www.gnu.org/licenses/gpl.txt.

// THE FILE IS DISTRIBUTED AS-IS, WITHOUT WARRANTY OF ANY KIND. THE AUTHOR
// DOES NOT TAKE ANY RESPONSIBILITY FOR ANY DAMAGE OR LEGAL ISSUES YOU MAY
// FACE WHEN USING THIS APPLICATION. PLEASE NOTE THAT LTS WAS WRITTEN AND
// RELEASED FOR *EDUCATIONAL* PURPOSES ONLY AND IS NOT INTENDED TO BE USED
// FOR ANYTHING THAT MAY BE AGAINST THE LAW WHERE YOU LIVE. IF YOU DO NOT
// WANT THAT RESPONSIBILITY, PLEASE DONT COMPILE OR USE THIS APPLICATION.

View the source here: http://code.biodegradablegeek.com/LogThatShit/

Easily Installing Vim 7.2 From Source

Vim 7.2 beta was released last month, and 7.2 is now stable. First check to see if your distro offers a package, and if not, follow these simple instructions on how to install it from source, from the vim7.2 subversion branch.

cd /tmp/
svn co https://vim.svn.sourceforge.net/svnroot/vim/branches/vim7.2
cd vim7.2/
./configure --with-features=huge --enable-gui=gnome2 --enable-cscope --enable-pythoninterp
make

Now you can use sudo make install and you’re done,…but

I suggest using checkinstall (sudo apt-get install checkinstall) to keep track of the installed files, create a package, and have the option of easily removing whatever you installed easily (i.e., dpkg -r vim7.2).

sudo checkinstall -D

If the above command doesn’t work, you aren’t alone. It recently began giving me these errors:

cp vim /usr/local/bin/vim
chmod 755 /usr/local/bin/vim: setting permissions for `/usr/local/bin/vim': No such file or directory
make[1]: Leaving directory
… etc …
**** Installation failed. Aborting package creation.

I dug up some info about the problem, along with a solution:

There seems to be a bug in the filesystem translation code which has been
biting people using newer versions of glibc found in most recent linux
distributions. It is being worked on. If you find weird install errors
when running checkinstall but your software installs fine without
checkinstall then you can work around the bug by disabling the fs
translation code and forcing checkinstall to install the package. Use the
–fstrans=no and –install=yes command line options:

checkinstall <options> –fstrans=no –install=yes <install_command>

Source: http://oclug.on.ca/archives/oclug/2004-May/038916.html

From the man page:

–install Toggle installation of the created package.
–fstrans Enable/disable filesystem translation. Filesystem translation
enabled causes the install to proceed in a  temporary  directory, thus not actually touching your system.

sudo checkinstall --fstrans=no --install=yes

You can also have checkinstall create a package by passing in one of these flags:

–type  Choose packaging system. Can be one of ’slackware’,  ’debian’ or ’rpm’.
-D        Create a Debian package.
-R        Create a RPM package.
-S        Create a Slackware Package.

For example, to create a Debian package, I would do this:

sudo checkinstall --fstrans=no --install=yes -D:

Done. The new package has been installed and saved to
/home/mr.Gvim/vim7.2/vim7.2_20080824_amd64.deb

To see the changes from 7.1, use :help version-7.2

Has vim/rails.vim been crashing lately? Here’s why.

If you are experiencing segmentation faults with vim and rails.vim, it may be due to this bug, which appeared after 1.7.127, but has been resolved in 1.7.147 (patch log).

To check if your installation has this bug, type the following (cred goes to Ralph) in vim: :r ~fo<tab> (’fo’ being the start of a username present on the system, i.e., fo for foo, or kirb for kirby). This does not require having rails.vim installed.

You can check whether your distro has updated vim, or install vim from source (see this post on how to do that).