<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shell Person</title>
	<atom:link href="http://www.shellperson.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shellperson.net</link>
	<description>Help me keep the shell people alive.</description>
	<lastBuildDate>Sun, 06 Feb 2011 03:28:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Install Adobe Reader 9.4 in Debian Lenny</title>
		<link>http://www.shellperson.net/install-adobe-reader-in-lenny/</link>
		<comments>http://www.shellperson.net/install-adobe-reader-in-lenny/#comments</comments>
		<pubDate>Sun, 06 Feb 2011 03:28:39 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[adobe reader]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lenny]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=471</guid>
		<description><![CDATA[This is so easy it's hardly worth writing, but perhaps it will be of some value.  Here's how I installed Adobe Reader 9.4 in Debian Lenny (32 bit, x86). Download Adobe Reader 9.4 from http://get.adobe.com/reader/.  Alternatively, I think you could use this direct link with wget: http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.0/enu/AdbeRdr9.4-1_i486linux_enu.bin Make the installation binary file executable: chmod +x [...]]]></description>
			<content:encoded><![CDATA[<p>This is so easy it's hardly worth writing, but perhaps it will be of some value.  Here's how I installed Adobe Reader 9.4 in Debian Lenny (32 bit, x86).</p>
<ol>
<li>Download Adobe Reader 9.4 from <a href="http://get.adobe.com/reader/">http://get.adobe.com/reader/</a>.  Alternatively, I think you could use this direct link with wget: <a href="http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.0/enu/AdbeRdr9.4-1_i486linux_enu.bin">http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.0/enu/AdbeRdr9.4-1_i486linux_enu.bin</a></li>
<li>Make the installation binary file executable:<br />
chmod +x AdbeRdr9.4-1_i486linux_enu.bin</li>
<li>Start the installation (as su or sudo):<br />
sudo ./AdbeRdr9.4-1_i486linux_enu.bin</li>
<li>Tell the installer where you want Reader installed.  It suggests /opt, which is a fine place to put it.</li>
<li>You're done.  Open a PDF with:<br />
acroread filename.pdf</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/install-adobe-reader-in-lenny/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Oracle SQL Developer: Enter the full pathname for java.exe</title>
		<link>http://www.shellperson.net/oracle-sql-developer-enter-the-full-pathname-for-java-exe/</link>
		<comments>http://www.shellperson.net/oracle-sql-developer-enter-the-full-pathname-for-java-exe/#comments</comments>
		<pubDate>Mon, 17 Jan 2011 17:14:03 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=466</guid>
		<description><![CDATA[I encountered the following message repeatedly when trying to start SQL Developer from my installation of Oracle Database 11g Enterprise: Enter the full pathname for java.exe. No matter how many times I browsed to the correct path, I kept being presented with the exact same dialog box. This was in Windows 7, and the solution [...]]]></description>
			<content:encoded><![CDATA[<p>I encountered the following message repeatedly when trying to start SQL Developer from my installation of Oracle Database 11g Enterprise: <strong>Enter the full pathname for java.exe</strong>.</p>
<p>No matter how many times I browsed to the correct path, I kept being presented with the exact same dialog box.  This was in Windows 7, and the solution was to right-click on the SQL Developer icon and select "Run as administrator".  I then used this path: <strong>C:\app\shellperson\product\11.1.0\db_1\jdk\jre\bin\java.exe</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/oracle-sql-developer-enter-the-full-pathname-for-java-exe/feed/</wfw:commentRss>
		<slash:comments>33</slash:comments>
		</item>
		<item>
		<title>Notes on Preventing Screen Blanking</title>
		<link>http://www.shellperson.net/prevent-screen-blanking/</link>
		<comments>http://www.shellperson.net/prevent-screen-blanking/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 16:05:58 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[screen blanking]]></category>
		<category><![CDATA[screensaver]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[x.org]]></category>
		<category><![CDATA[xorg]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=450</guid>
		<description><![CDATA[Here are a few notes I've made on keeping the the screen from blanking in linux. I generally am using Ratpoison (and sometimes just the console), so these are notes on how to disable screen blanking in X and console situations, not the higher-level GNOME or KDE screensaver. I've come up with a configuration that [...]]]></description>
			<content:encoded><![CDATA[<p>Here are a few notes I've made on keeping the the screen from blanking in linux.  I generally am using Ratpoison (and sometimes just the console), so these are notes on how to disable screen blanking in X and console situations, not the higher-level GNOME or KDE screensaver.  I've come up with a configuration that works to keep my screen from ever turning off, but I don't have an in-depth understanding of exactly what's being done.  Some of this may be redundant.<span id="more-450"></span></p>
<h3>Turn off the screensaver in X</h3>
<p>You can turn off X's screensaver by adding the following code to your .xinitrc:</p>
<pre class="brush: plain; title: ; notranslate">xset s off</pre>
<p>And you can verify that it worked by noting that the timeout is zero with "xset q":</p>
<pre class="brush: plain; highlight: [5]; title: ; notranslate">
james@tv:~$ xset q
...
Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  0    cycle:  600
...
</pre>
<h3>Turn off DPMS in X</h3>
<p>DPMS (<a href="http://en.wikipedia.org/wiki/VESA_Display_Power_Management_Signaling">VESA Display Power Management Signaling</a>) is what turns off an idle monitor to save energy.  To disable it, add the following to .xinitrc:</p>
<pre class="brush: plain; title: ; notranslate">xset -dpms</pre>
<p>and verify that it worked:</p>
<pre class="brush: plain; highlight: [5]; title: ; notranslate">
james@tv:~$ xset q
...
DPMS (Energy Star):
  Standby: 1200    Suspend: 1800    Off: 2400
  DPMS is Disabled
...
</pre>
<h3>Screen blanking terminal attributes</h3>
<p>This command is almost certainly important, although honestly I don't know the details of it very well.  The commands themselves seem pretty obvious, but I've done no research as to whether they are redundant.  I've add this to my .xinitrc as well:</p>
<pre class="brush: plain; title: ; notranslate">setterm -blank 0 -powersave off -powerdown 0</pre>
<h3>Additional note</h3>
<p>While I was trying to figure this stuff out, I came across this command as well, and wanted to at least make note of it:</p>
<pre class="brush: plain; title: ; notranslate">xset s blank</pre>
<p>As far as I can tell, this doesn't control <i>whether</i> the screen will blank, but <i>how</i> it will blank.  From the xset man page:</p>
<pre class="brush: plain; title: ; notranslate">
...The blank flag sets the preference to blank the video (if the hardware can do so) rather than display a background pattern, while noblank sets the preference to display a pattern rather than blank the video....
</pre>
<p>I'm pretty sure that using the "noblank" parameter will cause X's default grey crisscross pattern to display when the screensaver is activated, instead of just blanking the screen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/prevent-screen-blanking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shortcut Script for Sprunge Pastebin</title>
		<link>http://www.shellperson.net/sprunge-pastebin-script/</link>
		<comments>http://www.shellperson.net/sprunge-pastebin-script/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 20:00:24 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[pastebin]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sprunge]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=439</guid>
		<description><![CDATA[I discovered the scripting-friendly pastebin http://sprunge.us a few days ago via One Thing Well. It's extremely convenient to use, but in my laziness I've tried to make it even easier. Here is a script that will upload to sprunge and return the URL. It accepts piped data, STDIN redirection, filenames as arguments, and text strings [...]]]></description>
			<content:encoded><![CDATA[<p>I discovered the scripting-friendly pastebin <a href="http://sprunge.us">http://sprunge.us</a> a few days ago via <a href="http://onethingwell.org/post/892931666/sprunge">One Thing Well</a>.  It's extremely convenient to use, but in my laziness I've tried to make it even easier.  Here is a script that will upload to sprunge and return the URL.  It accepts piped data, STDIN redirection, filenames as arguments, and text strings as arguments.  <b>EDIT: while using the script, I just realized that using either form of STDIN input (pipe or redirection) will treat tabs as spaces.  While this will occasionally break code, it will almost always make it less legible.  So, if you need to preserve tab whitespace, I suggest using a filename as an argument to the script (e.g. sprunge myscript.txt).</b>  (Click "show source")<br />
<span id="more-439"></span></p>
<pre class="brush: bash; collapse: true; light: false; title: ; toolbar: true; notranslate">
#!/bin/bash

usage() {
description | fmt -s &gt;&amp;2
}

description() {
cat &lt;&lt; HERE

DESCRIPTION
  Upload data and fetch URL from the pastebin http://sprunge.us

USAGE
  $0 filename.txt
  $0 text string
  $0 &lt; filename.txt
  piped_data | $0

NOTES
--------------------------------------------------------------------------
* INPUT METHODS *
$0 can accept piped data, STDIN redirection [&lt;filename.txt], text strings following the command as arguments, or filenames as arguments.  Only one of these methods can be used at a time, so please see the note on precedence.  Also, note that using a pipe or STDIN redirection will treat tabs as spaces, or disregard them entirely (if they appear at the beginning of a line).  So I suggest using a filename as an argument if tabs are important either to the function or readability of the code.

* PRECEDENCE *
STDIN redirection has precedence, then piped input, then a filename as an argument, and finally text strings as an arguments.

  EXAMPLE:
  echo piped | &quot;$0&quot; arguments.txt &lt; stdin_redirection.txt

In this example, the contents of file_as_stdin_redirection.txt would be uploaded. Both the piped_text and the file_as_argument.txt are ignored. If there is piped input and arguments, the arguments will be ignored, and the piped input uploaded.

* FILENAMES *
If a filename is misspelled or doesn't have the necessary path description, it will NOT generate an error, but will instead treat it as a text string and upload it.
--------------------------------------------------------------------------

HERE
exit
}

if [ -t 0 ]; then
  echo Running interactively, checking for arguments... &gt;&amp;2
  if [ &quot;$*&quot; ]; then
    echo Arguments present... &gt;&amp;2
    if [ -f &quot;$*&quot; ]; then
      echo Uploading the contents of &quot;$*&quot;... &gt;&amp;2
      cat &quot;$*&quot;
    else
      echo Uploading the text: \&quot;&quot;$*&quot;\&quot;... &gt;&amp;2
      echo &quot;$*&quot;
    fi | curl -F 'sprunge=&lt;-' http://sprunge.us
  else
    echo No arguments found, printing USAGE and exiting. &gt;&amp;2
    usage
  fi
else
  echo Using input from a pipe or STDIN redirection... &gt;&amp;2
  while read -r line ; do
    echo $line
  done | curl -F 'sprunge=&lt;-' http://sprunge.us
fi
</pre>
<p>So, for example, any of the following commands would work (I cleverly named the script "sprunge" and put it in my $PATH):</p>
<pre class="brush: plain; title: ; notranslate">
ls -lA | sprunge
cat .bashrc | sprunge
sprunge &lt; .bashrc
sprunge .bashrc
sprunge 'if [ -f ~/.bashrc ]; then echo &quot;everything after the word sprunge will be uploaded as a text string&quot;; fi'
## note that the last line needs to be surrounded by single quotes, because of the semicolons.
</pre>
<p>And here's the short description and usage (which is included above, but maybe more readable here):</p>
<pre class="brush: plain; light: true; title: ; notranslate">
DESCRIPTION
  Upload data and fetch URL from the pastebin http://sprunge.us

USAGE
  ./sprunge filename.txt
  ./sprunge text string
  ./sprunge &lt; filename.txt
  piped_data | ./sprunge

NOTES
--------------------------------------------------------------------------
* INPUT METHODS *
./sprunge can accept piped data, STDIN redirection [&lt;filename.txt], text
strings following the command as arguments, or filenames as arguments.
Only one of these methods can be used at a time, so please see the note
on precedence.

* PRECEDENCE *
STDIN redirection has precedence, then piped input, then a filename as
an argument, and finally text strings as an arguments.

  EXAMPLE:
  echo piped | &quot;./sprunge&quot; arguments.txt &lt; stdin_redirection.txt

In this example, the contents of file_as_stdin_redirection.txt would
be uploaded. Both the piped_text and the file_as_argument.txt are
ignored. If there is piped input and arguments, the arguments will be
ignored, and the piped input uploaded.

* FILENAMES *
If a filename is misspelled or doesn't have the necessary path
description, it will NOT generate an error, but will instead treat it
as a text string and upload it.
--------------------------------------------------------------------------
</pre>
<p>Appropriately, I used the script to upload the script to sprunge.  <a href="http://sprunge.us/cXjM">http://sprunge.us/cXjM</a> is the URL, but you can add "?bash" to the end of it to get line numbers and syntax highlighting, like so: <a href="http://sprunge.us/cXjM?bash">http://sprunge.us/cXjM?bash</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/sprunge-pastebin-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Identifying a Program&#8217;s Package in Debian</title>
		<link>http://www.shellperson.net/find-origin-package/</link>
		<comments>http://www.shellperson.net/find-origin-package/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 09:13:50 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[dpkg]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=435</guid>
		<description><![CDATA[If you need to discover from which package a particular program came from, you can use this command (note that that is a capital "S"): Here's an example: This was necessary because I apparently deleted /usr/bin/sensible-browser (which is a script that determines which web browser should be the default). To replace it, I needed to [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to discover from which package a particular program came from, you can use this command (note that that is a capital "S"):</p>
<pre class="brush: plain; title: ; notranslate">
dpkg -S /usr/bin/file_i_am_curious_about
</pre>
<p>Here's an example:</p>
<pre class="brush: plain; title: ; notranslate">
james@tv:~$ dpkg -S /usr/bin/sensible-browser
debianutils: /usr/bin/sensible-browser
</pre>
<p>This was necessary because I apparently deleted /usr/bin/sensible-browser (which is a script that determines which web browser should be the default).  To replace it, I needed to know the original package name, which turned out to be debianutils.  From there it was a simple matter to do:</p>
<pre class="brush: plain; title: ; notranslate">
sudo apt-get install --reinstall debianutils
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/find-origin-package/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Changing Debian&#8217;s sensible-editor</title>
		<link>http://www.shellperson.net/change-sensible-editor/</link>
		<comments>http://www.shellperson.net/change-sensible-editor/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 09:01:00 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[sensible-browser]]></category>
		<category><![CDATA[sensible-editor]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=431</guid>
		<description><![CDATA[Debian uses the symlink /usr/bin/sensible-editor to point to the default text editor to use. This is controlled by the Debian Alternatives system, which will work automatically if you want it to. If, however, you want to change the auto-selected "sensible editor", you can do so with this command: This will let you select one of [...]]]></description>
			<content:encoded><![CDATA[<p>Debian uses the symlink /usr/bin/sensible-editor to point to the default text editor to use.  This is controlled by the Debian Alternatives system, which will work automatically if you want it to.  If, however, you want to change the auto-selected "sensible editor", you can do so with this command:</p>
<pre class="brush: plain; title: ; notranslate">
sudo update-alternatives --config editor
</pre>
<p>This will let you select one of your installed text editors from a list that will look something like this:</p>
<pre class="brush: plain; title: ; notranslate">
There are 5 alternatives which provide `editor'.

  Selection    Alternative
-----------------------------------------------
          1    /bin/ed
 +        2    /bin/nano
          3    /usr/bin/vim.tiny
          4    /usr/bin/mcedit-debian
*         5    /usr/bin/vim.basic

Press enter to keep the default[*], or type selection number:
</pre>
<p>The "+" indicates the editor that would be selected if Debian had to choose, the "*" indicates your current choice.</p>
<p>Debian also maintains symlinks for sensible-browser and sensible-pager.  You can change those easily as well:</p>
<pre class="brush: plain; title: ; notranslate">
sudo update-alternatives --config x-www-browser
sudo update-alternatives --config pager
</pre>
<p>If you find that your favorite program is not included in the list (most likely because it wasn't installed from a .deb package), you can add it like so:</p>
<pre class="brush: plain; title: ; notranslate">
sudo update-alternatives --install x-www-browser x-www-browser /usr/local/src/firefox/firefox 900
</pre>
<p>In English, this means install into the category x-www-browser, using the symlink named x-www-browser (found in /etc/alternatives), which points to the binary at /usr/local/src/firefox/firefox, and give it a numerical priority of 900.  The priority determines which program Debian would select if set to auto.  The largest number wins.  This is how I added firefox into the list of potential sensible-browser selections.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/change-sensible-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Keyboard Hotkeys with Debian Lenny</title>
		<link>http://www.shellperson.net/keyboard-hotkeys/</link>
		<comments>http://www.shellperson.net/keyboard-hotkeys/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 14:51:53 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hotkey]]></category>
		<category><![CDATA[xbindkeys]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=416</guid>
		<description><![CDATA[Here are some notes on assigning functions to those special keys that come on so many keyboards. My Gateway SK-9920 has 12 of these hotkeys: volume up, down, and mute; play, stop, next, and last track; internet, help, mail, shopping cart (?), and back (presumably). I don't even know what the creators of this keyboard [...]]]></description>
			<content:encoded><![CDATA[<p>Here are some notes on assigning functions to those special keys that come on so many keyboards.  My Gateway SK-9920 has 12 of these hotkeys: volume up, down, and mute; play, stop, next, and last track; internet, help, mail, shopping cart (?), and back (presumably).  I don't even know what the creators of this keyboard envisioned for the "shopping cart" key.  Often these keys aren't recognized out-of-the-box in Windows, much less in Linux.</p>
<p>Like usual, there are almost certainly specific GNOME or KDE tools to accomplish this goal.  Since I'm not running those, however, I'll stick to tools available in almost any X.Org environment (I happen to be using Ratpoison).<span id="more-416"></span></p>
<p>First, some terminology.  A <strong>scancode</strong> is the lowest level of identification for a key.  If your key doesn't have a scancode, you're out of luck - the kernel doesn't recognize the key at all.  A <strong>keycode</strong> is the next level of identification.  If your key's scancode is identified with a keycode, then there's just one more step to make it do what you want.  The last level of identification is a <strong>symbol</strong>.  A scancode is mapped to a keycode, which is mapped to a symbol (for example, the letter "e" or "Caps Lock").</p>
<h1>Keycodes</h1>
<p>Starting out, none of my hotkeys were mapped to symbols, some were mapped to keycodes, and some only had scancodes (thankfully there were no completely "dead" keys).  You can check if a key has a keycode by using <code>xbindkeys</code>.  In a terminal (in X - not a console) type </p>
<pre class="brush: plain; title: ; notranslate">xbindkeys -k</pre>
<p>followed by the key you want to check.  Here's an example of the output from my "Back" hotkey (before I bound it using xbindkeys, but after I assigned a keycode to the scancode, as described at the end of this post):</p>
<pre class="brush: plain; title: ; notranslate">
james@tv:~$ xbindkeys -k
Press combination of keys or/and click under the window.
You can use one of the two lines after &quot;NoCommand&quot;
in $HOME/.xbindkeysrc to bind a key.
&quot;(Scheme function)&quot;
    m:0x10 + c:211
    Mod2 + NoSymbol
</pre>
<h1>Binding keycodes to actions</h1>
<p>Using the output from <code>xbindkeys -k</code>, it's easy to bind a key to an action.  This will be configured in the <code>~/.xbindkeysrc</code> file (you may need to create it).  It will take effect when you run <code>xbindkeys</code>.  You'll probably want to call it in your <code>~/.xinitrc</code> file.  Here's an example of the format from my <code>.xbindkeysrc</code>:</p>
<pre class="brush: plain; title: ; notranslate">
# internet key
&quot;firefox&quot;
  m:0x10 + c:178

# play/pause key
&quot;mpc toggle&quot;
  m:0x10 + c:162

# stop key
&quot;mpc stop&quot;
  m:0x10 + c:164

# previous track key
&quot;mpc prev&quot;
  m:0x10 + c:144

# next track key
&quot;mpc next&quot;
  m:0x10 + c:153

# volume up key
&quot;amixer set 'Headphone' 1%+ ; amixer set 'PCM' 1%+&quot;
  m:0x10 + c:176

# volume down key
&quot;amixer set 'Headphone' 1%- ; amixer set 'PCM' 1%-&quot;
  m:0x10 + c:174

# mute key
&quot;amixer set 'Headphone' toggle ; amixer set 'PCM' toggle&quot;
  m:0x10 + c:160
</pre>
<p>It's a pretty simple format.  Obviously the "#" precedes a comment (and is optional, but recommended).  The next line is the command you want the hotkey to run (surrounded by quotes).  You'll recognize the final line from the output of <code>xbindkeys -k</code>.  I'm not sure if you can use either output line (or both) but mine works fine with just the first line following the <code>"(Scheme function)"</code> line.</p>
<p>That's all there is to it... unless your key does not have a keycode.</p>
<h1>Mapping scancodes to keycodes</h1>
<p>If <code>xbindkeys -k</code> does not recognize your key, it's probably not associated with a keycode.  You can check if the key has a scancode (in other words, if the kernel recognizes the key) by pressing the key and then checking <code>dmesg</code> to see if the key was mentioned.  Here's an example of what it will look like (from pushing my "Back" hotkey, before I assigned it to a keycode):</p>
<pre class="brush: plain; title: ; notranslate">
james@tv:~$ dmesg | tail -4
[   48.274918] atkbd.c: Unknown key pressed (translated set 2, code 0x83 on isa0060/serio0).
[   48.274918] atkbd.c: Use 'setkeycodes e003 &lt;keycode&gt;' to make it known.
[   48.789832] atkbd.c: Unknown key released (translated set 2, code 0x83 on isa0060/serio0).
[   48.789832] atkbd.c: Use 'setkeycodes e003 &lt;keycode&gt;' to make it known.
</pre>
<p>If you get similar output, you're key has a scancode (and is not mapped to a keycode).  You can use <code>setkeycodes</code> to assign a keycode to the key.  Before doing this, however, you're going to want to make sure that you don't assign it to a keycode that's already in use.  You can find this out by looking at your keymap.</p>
<pre class="brush: bash; title: ; notranslate">
james@tv:~$ cp /etc/console/boottime.kmap.gz .
james@tv:~$ gunzip boottime.kmap.gz
james@tv:~$ less boottime.kmap
</pre>
<pre class="brush: plain; title: ; notranslate">
-- SNIP --

keycode  81 = KP_3
        altgr   keycode  81 = Hex_3
        alt     keycode  81 = Ascii_3
keycode  82 = KP_0
        altgr   keycode  82 = Hex_0
        alt     keycode  82 = Ascii_0
keycode  83 = KP_Period
        altgr   control keycode  83 = Boot
        control alt     keycode  83 = Boot
keycode  84 = Last_Console
keycode  85 =
keycode  86 = less             greater          bar
        alt     keycode  86 = Meta_less
        shift   alt     keycode  86 = Meta_greater
keycode  87 = F11              F23              Console_23       F35
        alt     keycode  87 = Console_11
        control alt     keycode  87 = Console_11
keycode  88 = F12              F24              Console_24       F36
        alt     keycode  88 = Console_12
        control alt     keycode  88 = Console_12
keycode  89 =
keycode  90 =
keycode  91 =
keycode  92 =
keycode  93 =
keycode  94 =
keycode  95 =
keycode  96 = KP_Enter
        altgr   keycode  96 = Hex_F
keycode  97 = Control
keycode  98 = KP_Divide
        altgr   keycode  98 = Hex_B
keycode  99 = Control_backslash
        alt     keycode  99 = Meta_Control_backslash
        shift   alt     keycode  99 = Meta_Control_backslash
        control alt     keycode  99 = Meta_Control_backslash
keycode 100 = AltGr
keycode 101 = Break
keycode 102 = Find            

-- SNIP --
</pre>
<p>You can see that some keycodes are not being used (89-95, for example), so those are safe to use.  (By the way, I've heard that you're supposed to pick a keycode between 1-127, but I don't know why, or what happens if you don't - I've never used one outside of that range).</p>
<p>You can then assign a scancode to one of these unused keycodes using <code>setkeycodes</code> (as root).</p>
<pre class="brush: plain; title: ; notranslate">setkeycodes 0x83 89</pre>
<p>The above code assigns the scancode from my "Back" hotkey to the unused keycode "89".  Once that's been done, you can use <code>xbindkeys -k</code> (as described above) to get the correct identifier to bind the key using <code>xbindkeys</code>.</p>
<p>Assuming you want to use this binding after you reboot, you'll want to add the <code>setkeycodes</code> command to <code>/etc/rc.local</code>.  Here's an example of mine:</p>
<pre class="brush: bash; title: ; notranslate">
james@tv:~$ cat /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will &quot;exit 0&quot; on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

## James added to map the &quot;back&quot;, &quot;shopping cart&quot;, and &quot;?&quot; keys on Gateway keyboard
setkeycodes 0x83 89 &amp;
setkeycodes 0x81 90 &amp;
setkeycodes 0x82 91 &amp;

exit 0
</pre>
<p>Please feel free to mention better or alternate ways, or anything that I've got wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/keyboard-hotkeys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Support EFF: Play Video Games</title>
		<link>http://www.shellperson.net/video-games-support-eff/</link>
		<comments>http://www.shellperson.net/video-games-support-eff/#comments</comments>
		<pubDate>Sat, 08 May 2010 04:28:54 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[childs play]]></category>
		<category><![CDATA[eff]]></category>
		<category><![CDATA[games]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=408</guid>
		<description><![CDATA[For three more days you can buy a bundle of 5 indie video games, and you can pay whatever you want. Furthermore, you can designate where your money goes, between the five game developers, EFF (the Electronic Frontier Foundation), and the Childs Play charity (video games for hospitals). Also, all of the games are cross [...]]]></description>
			<content:encoded><![CDATA[<p>For three more days you can buy a bundle of 5 indie video games, and you can pay whatever you want.  Furthermore, you can designate where your money goes, between the five game developers, EFF (the <a href="http://www.eff.org/">Electronic Frontier Foundation</a>), and the <a href="http://www.childsplaycharity.org/">Childs Play</a> charity (video games for hospitals).  Also, all of the games are cross platform; linux, mac, and windows.</p>
<p>The games are:</p>
<ul>
<li><a href="http://2dboy.com/games.php">World of Goo</a></li>
<li><a href="http://www.bit-blot.com/aquaria/">Aquaria</a></li>
<li><a href="http://www.crypticsea.com/gish/">Gish</a></li>
<li><a href="http://www.wolfire.com/lugaru">Lugaru</a></li>
<li><a href="http://www.penumbragame.com/">Penumbra: overture</a></li>
</ul>
<p>You can buy the bundle here: <a href="http://www.wolfire.com/humble">http://www.wolfire.com/humble</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/video-games-support-eff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install Google Chrome in Debian Lenny</title>
		<link>http://www.shellperson.net/install-chrome-in-lenny/</link>
		<comments>http://www.shellperson.net/install-chrome-in-lenny/#comments</comments>
		<pubDate>Sat, 08 May 2010 03:29:33 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[lenny]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=400</guid>
		<description><![CDATA[This is simple. First, get the package Go to http://www.google.com/chrome/eula.html and select the 32-bit .deb for Debian/Ubuntu, then click "Accept and Install". This will download google-chrome-beta_current_i386.deb. Optional: Prevent Chrome from adding the Google repository If you want Chrome to keep itself up-to-date, don't do this step. However, if you just want to check Chrome out [...]]]></description>
			<content:encoded><![CDATA[<p>This is simple.</p>
<h4>First, get the package</h4>
<p>Go to <a href="http://www.google.com/chrome/eula.html">http://www.google.com/chrome/eula.html</a> and select the 32-bit .deb for Debian/Ubuntu, then click "Accept and Install".  This will download google-chrome-beta_current_i386.deb.</p>
<h4>Optional: Prevent Chrome from adding the Google repository</h4>
<p>If you want Chrome to keep itself up-to-date, don't do this step.  However, if you just want to check Chrome out without changing too much, you might want to type the following command at the command line:<span id="more-400"></span></p>
<pre class="brush: bash; highlight: [1]; light: true; title: ; notranslate">sudo touch /etc/default/google-chrome</pre>
<h4>Install with DPKG</h4>
<p>In the directory where you downloaded Chrome:</p>
<pre class="brush: bash; highlight: [1]; light: true; title: ; notranslate">sudo dpkg --install google-chrome-beta_current_i386.deb</pre>
<p>In my case, I didn't have the necessary dependencies, so I got the following errors:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
james@tv:~$ sudo dpkg --install google-chrome-beta_current_i386.deb
Selecting previously deselected package google-chrome-beta.
(Reading database ... 24475 files and directories currently installed.)
Unpacking google-chrome-beta (from google-chrome-beta_current_i386.deb) ...
dpkg: dependency problems prevent configuration of google-chrome-beta:
 google-chrome-beta depends on libgconf2-4; however:
  Package libgconf2-4 is not installed.
 google-chrome-beta depends on libxslt1.1; however:
  Package libxslt1.1 is not installed.
 google-chrome-beta depends on libxss1; however:
  Package libxss1 is not installed.
 google-chrome-beta depends on xdg-utils (&gt;= 1.0.1); however:
  Package xdg-utils is not installed.
dpkg: error processing google-chrome-beta (--install):
 dependency problems - leaving unconfigured
Processing triggers for menu ...
Processing triggers for man-db ...
Errors were encountered while processing:
 google-chrome-beta
</pre>
<p>You can fix that with apt-get, like so:</p>
<pre class="brush: bash; highlight: [1]; light: true; title: ; notranslate">sudo apt-get -f install</pre>
<p>This will grab all of the dependencies Chrome needs.  Here's the output (you'll need to type "y" when prompted):</p>
<pre class="brush: bash; collapse: true; gutter: false; light: false; title: ; toolbar: true; notranslate">
james@tv:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  gconf2-common libgconf2-4 libidl0 liborbit2 libxslt1.1 libxss1 shared-mime-info xdg-utils
Suggested packages:
  desktop-file-utils libgnome2-0 exo-utils libgnomevfs2-bin kdelibs4c2a konqueror
The following NEW packages will be installed:
  gconf2-common libgconf2-4 libidl0 liborbit2 libxslt1.1 libxss1 shared-mime-info xdg-utils
0 upgraded, 8 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 3047kB of archives.
After this operation, 11.1MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get:1 http://ftp.us.debian.org lenny/main gconf2-common 2.22.0-1 [1532kB]
Get:2 http://ftp.us.debian.org lenny/main libidl0 0.8.10-0.1 [87.6kB]
Get:3 http://ftp.us.debian.org lenny/main liborbit2 1:2.14.13-0.1 [249kB]
Get:4 http://ftp.us.debian.org lenny/main libgconf2-4 2.22.0-1 [242kB]
Get:5 http://ftp.us.debian.org lenny/main libxslt1.1 1.1.24-2 [227kB]
Get:6 http://ftp.us.debian.org lenny/main libxss1 1:1.1.3-1 [11.9kB]
Get:7 http://ftp.us.debian.org lenny/main xdg-utils 1.0.2-6.1 [54.3kB]
Get:8 http://ftp.us.debian.org lenny/main shared-mime-info 0.30-2 [644kB]
Fetched 3047kB in 7s (433kB/s)
Selecting previously deselected package gconf2-common.
(Reading database ... 24798 files and directories currently installed.)
Unpacking gconf2-common (from .../gconf2-common_2.22.0-1_all.deb) ...
Selecting previously deselected package libidl0.
Unpacking libidl0 (from .../libidl0_0.8.10-0.1_i386.deb) ...
Selecting previously deselected package liborbit2.
Unpacking liborbit2 (from .../liborbit2_1%3a2.14.13-0.1_i386.deb) ...
Selecting previously deselected package libgconf2-4.
Unpacking libgconf2-4 (from .../libgconf2-4_2.22.0-1_i386.deb) ...
Selecting previously deselected package libxslt1.1.
Unpacking libxslt1.1 (from .../libxslt1.1_1.1.24-2_i386.deb) ...
Selecting previously deselected package libxss1.
Unpacking libxss1 (from .../libxss1_1%3a1.1.3-1_i386.deb) ...
Selecting previously deselected package xdg-utils.
Unpacking xdg-utils (from .../xdg-utils_1.0.2-6.1_all.deb) ...
Selecting previously deselected package shared-mime-info.
Unpacking shared-mime-info (from .../shared-mime-info_0.30-2_i386.deb) ...
Processing triggers for man-db ...
Setting up gconf2-common (2.22.0-1) ...

Creating config file /etc/gconf/2/path with new version
Setting up libidl0 (0.8.10-0.1) ...
Setting up liborbit2 (1:2.14.13-0.1) ...
Setting up libgconf2-4 (2.22.0-1) ...
Setting up libxslt1.1 (1.1.24-2) ...
Setting up libxss1 (1:1.1.3-1) ...
Setting up xdg-utils (1.0.2-6.1) ...
Setting up google-chrome-beta (5.0.375.29-r46008) ...
Setting up shared-mime-info (0.30-2) ...
Processing triggers for menu ...
</pre>
<p>Now, I'm not sure if this last step is actually necessary, but I figured it couldn't hurt to repeat the original dpkg command, just to make sure it works with no errors (again, in the directory where you downloaded the .deb):</p>
<pre class="brush: bash; highlight: [1]; light: true; title: ; notranslate">sudo dpkg --install google-chrome-beta_current_i386.deb</pre>
<p>This time it worked fine:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
james@tv:~$ sudo dpkg --install google-chrome-beta_current_i386.deb
(Reading database ... 25041 files and directories currently installed.)
Preparing to replace google-chrome-beta 5.0.375.29-r46008 (using google-chrome-beta_current_i386.deb) ...
Unpacking replacement google-chrome-beta ...
Setting up google-chrome-beta (5.0.375.29-r46008) ...
Processing triggers for menu ...
Processing triggers for man-db ...
</pre>
<h4>Launch Chrome</h4>
<pre class="brush: bash; highlight: [1]; light: true; title: ; notranslate">google-chrome</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/install-chrome-in-lenny/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Using ls to Show Directory Size &#8211; Updated &amp; Explained</title>
		<link>http://www.shellperson.net/show-directory-size-with-ls/</link>
		<comments>http://www.shellperson.net/show-directory-size-with-ls/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 04:28:53 +0000</pubDate>
		<dc:creator>shell.person</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">http://www.shellperson.net/?p=370</guid>
		<description><![CDATA[Note - I've written about this before (here). In my opinion, this is a vast improvement over that earlier version. This title of this post is not entirely accurate. The post is actually about a script that will list files and directories in the same format as ls -l (the "long listing" format of the [...]]]></description>
			<content:encoded><![CDATA[<p><em>Note</em> - I've written about this before (<a href="http://www.shellperson.net/bash-get-size-of-directory-in-ls-l-output/">here</a>).  In my opinion, this is a vast improvement over that earlier version.</p>
<p>This title of this post is not entirely accurate.  The post is actually about a script that will list files and directories <em>in the same format</em> as <span style="font-family:courier;font-weight:bold;">ls -l</span> (the "long listing" format of the ls command), except it will correctly report the size of directories (and all of the files within them).  Technically, it is actually in the format of <span style="font-family:courier;font-weight:bold;">ls -lhL</span>.</p>
<p>This is functionally very different than the output of ls.  Typically ls lists the size of directories <i><b>not including their contents</b></i>.  This produces a very small number, which is the amount of disk space the directory's meta-data takes up (i.e. the names of files within the directory).  Here is an example:</p>
<pre class="brush: bash; light: true; title: ; notranslate">ls -lhL</pre>
<pre class="brush: plain; title: ; notranslate">
total 116K
drwxr-x--- 1 james users  44K 2010-04-22 17:21 movies
drwxr-x--- 1 james users  48K 2010-04-03 22:22 music
drwxr-x--- 1 james users    0 2009-12-11 16:20 photos
drwxr-x--- 1 james users 4.0K 2009-12-13 22:36 data
drwxr-x--- 1 james users  20K 2010-04-27 00:56 tv
</pre>
<p><span id="more-370"></span><br />
And here is an example of the output of the script (note the size of the directories):</p>
<pre class="brush: plain; title: ; notranslate">
drwxr-x--- 1 james users 178G 2010-04-22 17:21 movies
drwxr-x--- 1 james users  26G 2010-04-03 22:22 music
drwxr-x--- 1 james users 9.9G 2009-12-11 16:20 photos
drwxr-x--- 1 james users  27G 2009-12-13 22:36 data
drwxr-x--- 1 james users 135G 2010-04-27 00:56 tv
</pre>
<p>That's a pretty big difference.  Note that if all you're interested in is the permissions, modification time, and filename, using <span style="font-family:courier;font-weight:bold;">ls -lh</span> is a much better choice - it's extremely fast and gives you all the information you need.  However, if you want to know how much space the contents of each directory is using, you should use the following script:</p>
<pre class="brush: bash; gutter: true; title: ; notranslate">
#!/bin/bash
# script to display the sizes of files and directories in the format of ls -lhL
## note that large space on line 9 (the '	' that follows &quot;cut -d&quot;) is a tab, created in a terminal with CTRL+v then TAB
for x in *;
  do
    y=&quot;$(echo &quot;$x&quot; | sed -e 's/\[/\\[/g' -e 's/]/\\]/g')&quot;
    echo -e \
      &quot;$(ls -lL | grep &quot;[0-9]\{2\}:[0-9]\{2\} $y$&quot; | sed 's/[ ][ ]*/ /g' | cut -d ' ' -f 1-4) \
        $(du -sh &quot;$x&quot; | cut -d '	' -f 1)&quot; \
      &quot;$(ls -lL | grep &quot;[0-9]\{2\}:[0-9]\{2\} $y$&quot; | sed 's/[ ][ ]*/ /g' | cut -d ' ' -f 6-20 )&quot;;
  done \
| column -t \
| sed -e 's/[ ]\([ ][ ]*\)/\1/g' \
| sed -e 's/[ ][ ]*/ /8g' \
| sed 's/\([ ][ ]*\)\([^ ]*\)\([ ]\)\([ ]*\)\([^ ]*[ ]*[^ ]*[ ]*\)\([^ ]*\)\([ ]\)\([ ]*\)/\1\4\2\3\5\8\6\7/'
</pre>
<p><strong>NOTE</strong> - The script is not displayed entirely correctly in this post; on line 8, the multiple spaces in single-quotes (following <span style="font-family:courier;font-weight:bold;">cut -d</span>) should be a TAB.  Although it's displayed incorrectly on the page, if you use either the "view source" or "copy to clipboard" buttons (top-right of the script when you hover over it), it will use the correct character.  You can also produce this character in a terminal with CTRL+v followed by TAB.</p>
<p>This script should be named something convenient and saved somewhere in your $PATH.  I call the script <span style="font-family:courier;font-weight:bold;">lsd</span> and save it in "/home/james/bin".  </p>
<h4>How the script works</h4>
<p>If you're the kind of person who likes to know what a script does before copying it from the internet and running it, here's what's going on in this script.  Paragraphs are labeled by the script's line numbers.</p>
<p><em>Lines 4-11</em>.  This is a for loop that is run on every (non-hidden) file in your current directory (*).  $x is the variable that holds one of the directory's filenames per iteration.</p>
<p><em>Line 6</em>.  $y is a variable that equals $x, except brackets ("[" and "]") are replaced by escaped brackets ("\[" and "\]"), in order to avoid conflict with grep's regular expressions matching.</p>
<p><em>Lines 7-10</em>.  These lines are all part of a long echo command which arranges the data in the same format as <span style="font-family:courier;font-weight:bold;">ls -lhL</span>.  It is echoing three separate command substitution variables, separated by spaces.</p>
<p><em>Line 8</em>.  The first of three command substitutions.  Gets a long directory listing, greps out the single line that matches $x, removes extra spaces between sections, and then chops off the 2nd part of the line at the point where the directory size will be displayed.</p>
<p><em>Line 9</em>.  The second of three command substitutions.  Gets the size of $x using <span style="font-family:courier;font-weight:bold;">du -sh</span> and then chops off the end of the line, leaving only the size.</p>
<p><em>Line 10</em>.  The third of three command substitutions.  Gets a long directory listing, greps out the single line that matches $x, removes extra spaces between sections, and then chops off the 1st part of the line up to the point after where the directory size will be displayed.  Script lines 8, 9, and 10 will form a single line of output for each iteration of the for loop.</p>
<p><em>Lines 12-15</em>.  Each of these lines formats the script's output to match the style of <span style="font-family:courier;font-weight:bold;">ls -lhL</span>.</p>
<p><em>Line 12</em>.  Sorts the output into columns using <span style="font-family:courier;font-weight:bold;">column -t</span>.</p>
<p><em>Line 13</em>.  Removes extra spaces according to the following rule: for every group of 2 or more consecutive spaces, subtract one space from that group.</p>
<p><em>Line 14</em>.  Removes extra spaces from the last part of the lines, ensuring that filenames containing spaces do not have multiple consecutive spaces.</p>
<p><em>Line 15</em>.  Swaps certain groups of spaces around in order to match the justification style of <span style="font-family:courier;font-weight:bold;">ls -lhL</span>.  Specifically, user and group names are justified left, while file sizes are justified right.</p>
<p>Please leave a comment if you've tried this script and found any bugs in it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shellperson.net/show-directory-size-with-ls/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

