<?xml version="1.0"?>
<rss version="2.0"><channel><title>Smoof Blog</title>
<link>http://elder-gods.org/~larry/blog/</link>
<description>Smoof Blog archives for category Technology</description>
<language>en</language>
<item><title>pwexport</title>
<link>http://elder-gods.org/~larry/blog/display/113</link>
<pubdate>Sat, 30 Jan 2010 05:22:48 GMT</pubdate>
<description>I made a command line &lt;a href=/~larry/pwexport.tgz&gt;password exporter&lt;/a&gt; for firefox.</description>
</item>
<item><title>The Thing That Should Not Be</title>
<link>http://elder-gods.org/~larry/blog/display/111</link>
<pubdate>Tue, 17 Feb 2009 23:55:20 GMT</pubdate>
<description>

&lt;p&gt;This may be the most abominable and utterly insane function I have ever
had the misfortune to write.&lt;/p&gt;

&lt;pre&gt;
function oct = octify (n) 
    oct = sscanf (sprintf ('%o', n), '%d');
end
&lt;/pre&gt;

&lt;a href='http://www.mathworks.com/access/helpdesk/help/toolbox/comm/index.html?/access/helpdesk/help/toolbox/comm/ref/poly2trellis.html'
&gt;Thanks Matlab&lt;/a&gt;!</description>
</item>
<item><title>Customizing Firefox (without sputtering with rage)</title>
<link>http://elder-gods.org/~larry/blog/display/104</link>
<pubdate>Wed, 13 Aug 2008 21:45:49 GMT</pubdate>
<description>

&lt;p&gt;

If you have ever tried to figure out how to add a custom keybind to Firefox, 
you know it is a frustrating, infuriating, and futile task.  There is no reasonable way to do it.
There's a way that seems to have worked six years ago, and requires you to edit the firefox installation
instead of your profile.  There's extensions that might add the keybinds you want, but they all suck 
in one way or another.  There's an extension that lets you add keybinds with the GUI, but it stores them 
in your user prefs so there's no way to sync them between machines.  You could make your own extension, but 
then you have to figure out all the stupid boilerplate that extensions require and reinstall it every time you
make a change.

&lt;p&gt;

All I really want is a text file somewhere I can edit.  When I add a binding to emacs, I add a single line to a single 
text file.  The file is in a git repository, so syncing changes is easy.  This blissful state of affairs actually can be achieved 
in firefox; and here's how you do it:

&lt;p&gt; 
Firefox can load an extension from a path outside the profile directory.  So you just create an extension with your personal
customizations, and just edit it directly.  After you make a change you just restart firefox.  There's no need to make a XPI 
and install it. I keep mine in &lt;em id="code"&gt;~/config/dot-firefox&lt;/em&gt;.  
Aside from the boilerplate, there's just two files. 

&lt;p&gt;
&lt;em id="code"&gt;overlay.js&lt;/em&gt; for your javascript:
&lt;pre&gt;
// from mozless
function tabRelativeSelect(delta)
{
  var oldTab = gBrowser.selectedTab;
  var newTab = null;
  var length = gBrowser.tabContainer.childNodes.length;
  var index;
  for (index=0; index&amp;lt;length; index++) {
    if (gBrowser.tabContainer.childNodes[index] == oldTab) {
      var new_index = index + delta;
      if (new_index &amp;lt; 0) new_index += length;
      else if (new_index &gt;= length) new_index -= length;
      newTab = gBrowser.tabContainer.childNodes[new_index];
      break;
    }
  }
  if (newTab &amp;&amp; newTab != oldTab)
    gBrowser.selectedTab = newTab;
}
&lt;/pre&gt;


&lt;p&gt; and &lt;em id="code"&gt;overlay.xul&lt;/em&gt; for your XUL:

&lt;pre&gt;
&amp;lt;?xml version="1.0"?&gt;

&amp;lt;overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"&gt;
  &amp;lt;script src="overlay.js"/&gt;
  &amp;lt;keyset id="mainKeyset"&gt;
    &amp;lt;key key="k" oncommand="goDoCommand('cmd_scrollLineUp')" /&gt;
    &amp;lt;key key="h" oncommand="goDoCommand('cmd_scrollLeft')" /&gt;
    &amp;lt;key key="j" oncommand="goDoCommand('cmd_scrollLineDown')" /&gt;
    &amp;lt;key key="l" oncommand="goDoCommand('cmd_scrollRight')" /&gt;
    &amp;lt;key key="d" oncommand="goDoCommand('cmd_scrollPageDown')" /&gt;
    &amp;lt;key key="u" oncommand="goDoCommand('cmd_scrollPageUp')" /&gt;
    &amp;lt;key modifiers="shift" key="B" oncommand="BrowserBack()" /&gt;
    &amp;lt;key modifiers="shift" key="F" oncommand="BrowserForward()" /&gt;
    &amp;lt;key key="." oncommand="tabRelativeSelect(1)" /&gt;
    &amp;lt;key key="," oncommand="tabRelativeSelect(-1)" /&gt;
  &amp;lt;/keyset&gt;
&amp;lt;/overlay&gt;
&lt;/pre&gt;

&lt;p&gt; 
To get firefox to load it: 

&lt;pre&gt;
$ echo ~/config/dot-firefox &gt; $firefox_profile_dir/extensions/dot-firefox@elder-gods.org
&lt;/pre&gt;


&lt;p&gt;
 If you wanna see/copy the boilerplate, it's all in &lt;a href=http://elder-gods.org/~larry/repos/config&gt;this git repo&lt;/a&gt;.

</description>
</item>
<item><title>Great Little Programs</title>
<link>http://elder-gods.org/~larry/blog/display/89</link>
<pubdate>Tue, 03 Jul 2007 02:45:12 GMT</pubdate>
<description>
I often discover some opensource utility that solves a problem 
I've had for years, and I just say to myself "wow.  why didn't i 
know about this already?"  there's so much stuff out there
it's easy to overlook great programs even when they're exactly what
you need.  Here are a few that come to mind
&lt;dl&gt;
&lt;dt&gt; &lt;a href=http://www.gnu.org/software/findutils/&gt;xargs&lt;/a&gt;
&lt;dd&gt; move strings from it's standard input to the argument list of a command
&lt;dt&gt; &lt;a href=http://www.methylblue.com/filelight/&gt;filelight&lt;/a&gt;
&lt;dd&gt; visualize disk usage
&lt;dt&gt; &lt;a href=http://packages.debian.org/unstable/admin/apt-file&gt;apt-file&lt;/a&gt;
&lt;dd&gt; search for .deb packages that contain certain file names
&lt;dt&gt; &lt;a href=http://hgbook.red-bean.com/hgbookch12.html#x16-26500012&gt;Mercurial Queues&lt;/a&gt;
&lt;dd&gt; manage and version control a set of patches against an upstream codebase
&lt;dt&gt; &lt;a href=http://k3b.plainblack.com/&gt;k3b&lt;/a&gt;
&lt;dd&gt; burn a cd without having to think about it
&lt;dt&gt; &lt;a href=http://amarok.kde.org/&gt;amarok&lt;/a&gt;
&lt;dd&gt; manage your music collection
&lt;/dd&gt;



</description>
</item>
</channel>
</rss>
