<?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>Push cx &#187; Ubuntu</title>
	<atom:link href="http://push.cx/tag/ubuntu/feed" rel="self" type="application/rss+xml" />
	<link>http://push.cx</link>
	<description>A traveling geek&#039;s blog on development, games, and the web</description>
	<lastBuildDate>Fri, 14 Oct 2011 10:24:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>256-Color XTerms in Ubuntu</title>
		<link>http://push.cx/2008/256-color-xterms-in-ubuntu</link>
		<comments>http://push.cx/2008/256-color-xterms-in-ubuntu#comments</comments>
		<pubDate>Sun, 05 Oct 2008 23:56:23 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[256 colors]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[terminals]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[vim]]></category>
		<category><![CDATA[xterm]]></category>

		<guid isPermaLink="false">http://push.cx/?p=327</guid>
		<description><![CDATA[It&#8217;s not commonly used, but most Linux terminals can support 256 colors. It&#8217;s also a bit of a pain in the ass to set up if it doesn&#8217;t Just Work out of the box. Having spent a while today tinkering and searching and cursing and testing and trading mail/IM with folks who understand the eldritch [...]]]></description>
			<content:encoded><![CDATA[<p>
It&#8217;s not commonly used, but most Linux terminals can support 256 colors. It&#8217;s also a bit of a pain in the ass to set up if it doesn&#8217;t Just Work out of the box. Having spent a while today tinkering and searching and cursing and testing and trading mail/IM with folks who understand the eldritch depths of terminals better than I, I thought I&#8217;d write up my findings for anyone else who&#8217;d like spiffy colors.
</p>

<p>
Ncurses and other terminal programming libraries need to know what capabilities your terminal supports, like highlighting, underlining, blinking, and colors. This used to be done with <kbd>termcap</kbd> but now everyone uses <kbd>terminfo</kbd>, which hold the specifications in a set of files. The first thing to do is make sure you have a 256-color terminfo file for your terminal:
</p>

<pre>&nbsp;
$ find /lib/terminfo /usr/share/terminfo -name <span style="color: #ff0000;">"*256*"</span></pre>

<p>
What you need is to see a filed named <kbd><i>terminal</i>-256color</kbd>. For example, mine is <kbd>xterm-256color</kbd>. My first hassle was that Ubuntu doesn&#8217;t install this by default. I can&#8217;t guess what it will be named in your distribution (look for packages with &#8216;ncurses&#8217; or &#8216;term&#8217; in their names), but in Ubuntu it&#8217;s just a quick:
</p>

<pre>&nbsp;
$ sudo aptitude install ncurses-term</pre>

<p>
Xterm needs a little more configuration, edit <kbd>~/.Xdefaults</kbd> to add:
</p>

<pre>
*customization: -color
XTerm*termName:  xterm-256color
</pre>

<p>
To make this apply to new terminals (so you don&#8217;t have to log out and back in), run:
</p>

<pre>&nbsp;
$ xrdb -merge ~/.Xdefaults
<span style="color: #808080; font-style: italic;"># you'll also want to add this to your ~/.xsession so it happens every time you log in:</span>
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#91;</span> -f <span style="color: #0000ff;">$HOME</span>/.Xdefaults <span style="color: #66cc66;">&#93;</span>; <span style="color: #b1b100;">then</span>
  xrdb -merge <span style="color: #0000ff;">$HOME</span>/.Xdefaults
<span style="color: #b1b100;">fi</span></pre>

<p>
One tricky thing about xterm is that is supports 256 colors via ANSI escape sequences, but they won&#8217;t be available to programs without the right terminfo file. So <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5mcmV4eC5kZS94dGVybS0yNTYtbm90ZXMv">popular test scripts</a> will work while ncurses-based programs will fail. I spent a lot of time catching on to this one. This config file will tell xterm to enable 256 colors and set the TERM environment variable to &#8216;xterm-256color&#8217; so the right terminfo file is used. You can test this with:
</p>

<pre>&nbsp;
$ tput colors
<span style="color: #cc66cc;">256</span>
$ <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$TERM</span>
xterm-256color</pre>

<img src="http://push.cx/wp-content/uploads/2008/10/xterm-colortest.png" alt="Xterm color test" title="xterm-colortest" width="544" height="209" class="size-full wp-image-330 important" />

<p>
At this point, you&#8217;re all set. Individual applications may need some configuring to use 256-color schemes. In vim, <kbd>:set t_Co</kbd> should now report that you have 256 colors available. Run <kbd>locate vim | grep 256</kbd> to find the color schemes available, and <kbd>:colo desert256</kbd> to use one. If none of those suit you, there are <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jcy5jbXUuZWR1L35tYXZlcmljay9WaW1Db2xvclNjaGVtZVRlc3Q=">plenty more</a> available. I put a little code in my <kbd>~/.vimrc</kbd> to only load it when I have colors available, because sometimes I use different terminals.
</p>

<pre>
colorscheme desert
if &amp;t_Co &gt; 2 || has(&quot;gui_running&quot;)
  syntax on
endif
if &amp;t_Co == 256
  colorscheme inkpot
endif
</pre>

<img src="http://push.cx/wp-content/uploads/2008/10/vim-256.png" alt="Vim in 256 colors with colorscheme &#039;inkpot&#039;" title="vim-256" width="478" height="378" class="size-medium wp-image-331 important" />

<p>
GNU screen needs a hint to use 256 colors. You can add the following to your <kbd>~/.screenrc</kbd>, or just wait for Ubuntu Intrepid Ibex later this month to <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly9idWdzLmxhdW5jaHBhZC5uZXQvdWJ1bnR1Lytzb3VyY2Uvc2NyZWVuLytidWcvODc5NjY=">include it by default</a>:
</p>

<pre>&nbsp;
<span style="color: #808080; font-style: italic;"># terminfo and termcap for nice 256 color terminal</span>
<span style="color: #808080; font-style: italic;"># allow bold colors - necessary for some reason</span>
attrcolor b <span style="color: #ff0000;">".I"</span>
<span style="color: #808080; font-style: italic;"># tell screen how to set colors. AB = background, AF=foreground</span>
termcapinfo xterm <span style="color: #ff0000;">'Co#256:AB=<span style="color: #000099; font-weight: bold;">\E</span>[48;5;%dm:AF=<span style="color: #000099; font-weight: bold;">\E</span>[38;5;%dm'</span>
<span style="color: #808080; font-style: italic;"># erase background with current bg color</span>
defbce <span style="color: #ff0000;">"on"</span> 
<span style="color: #808080; font-style: italic;"># set TERM</span>
term screen-256color-bce</pre>

<p>
This was all (of course) an hours-long session of <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3Byb2plY3RzLmNzYWlsLm1pdC5lZHUvZ3NiL29sZC1hcmNoaXZlL2dzYi1hcmNoaXZlL2dzYjIwMDAtMDItMTEuaHRtbA==">yak shaving</a> because I&#8217;m playing around with a secret project I&#8217;m not yet ready to announce<a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3JvZ3VlYmFzaW4ucm9ndWVsaWtlZGV2ZWxvcG1lbnQub3JnL2luZGV4LnBocD90aXRsZT1NYWluX1BhZ2U=" style=\"text-decoration: none; color: #0000ff\">.</a>
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=327" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2008/256-color-xterms-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Epson Perfection V100 in Ubuntu</title>
		<link>http://push.cx/2007/epson-perfection-v100-in-ubuntu</link>
		<comments>http://push.cx/2007/epson-perfection-v100-in-ubuntu#comments</comments>
		<pubDate>Mon, 19 Feb 2007 01:51:51 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Epson]]></category>
		<category><![CDATA[GIMP]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[sane]]></category>
		<category><![CDATA[scanner]]></category>
		<category><![CDATA[scanning]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[v100]]></category>

		<guid isPermaLink="false">http://push.cx/2007/epson-perfection-v100-in-ubuntu</guid>
		<description><![CDATA[I just bought an Epson Perfection V100 scanner and wanted to post about how I got it working in Ubuntu for anyone else who noticed it doesn&#8217;t Just Work. The drivers are binary-only, so you have to dick around a little to get them installed &#8212; the SANE folks have said they&#8217;d integrate them if [...]]]></description>
			<content:encoded><![CDATA[<p>
<img class="decoration"  src="http://push.cx/wp-content/uploads/2007/02/epson-v100.jpg" alt="Epson v100" />
I just bought an Epson Perfection V100 scanner and wanted to post about how I got it working in Ubuntu for anyone else who noticed it doesn&#8217;t Just Work. The drivers are binary-only, so you have to dick around a little to get them installed &#8212; the SANE folks have said they&#8217;d integrate them if they were open source, but most hardware companies fail to provide source and doom their hardware to early obsolescence. Tangent aside, here&#8217;s how to get your scanner working:
</p>

<ol>
  <li>By default, only root will be able to play with your new scanner. Run <kbd>sudo addgroup `whoami` scanner</kbd>. Log out and back in, and you&#8217;ll be able to scan without being root.</li>
  <li><a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5hdmFzeXMuanAvZW5nbGlzaC9saW51eF9lL2RsX3NjYW4uaHRtbA==">Download the iscan and iscan-plugin-gt</a> rpms from the provider. By playing with the URLs on the file I was able to find version 2.5.0, but I don&#8217;t know that you need it or why the page hasn&#8217;t been updated.
  <li>Run:
    <pre>&nbsp;
$ sudo alien iscan-<span style="color: #cc66cc;">2</span>.<span style="color: #cc66cc;">3</span>.<span style="color: #cc66cc;">0</span>-<span style="color: #cc66cc;">1</span>.c2.i386.rpm
$ sudo alien iscan-plugin-gt-s600-<span style="color: #cc66cc;">2</span>.<span style="color: #cc66cc;">0</span>.<span style="color: #cc66cc;">0</span>-<span style="color: #cc66cc;">1</span>.c2.i386.rpm
$ sudo apt-get install iscan_<span style="color: #cc66cc;">2</span>.<span style="color: #cc66cc;">3</span>.<span style="color: #cc66cc;">0</span>-<span style="color: #cc66cc;">1</span>_i386.deb
$ sudo apt-get install iscan-plugin-gt-s600_<span style="color: #cc66cc;">2</span>.<span style="color: #cc66cc;">0</span>.<span style="color: #cc66cc;">0</span>-<span style="color: #cc66cc;">2</span>_i386.deb</pre>
  </li>
  <li>Run <kbd>sane-find-scanner</kbd> to see your scanner detected, and <kbd>scanimage -L</kbd> to hear it whir a little as sane checks that it can command it.</li>
</ol>

<p>
That&#8217;s all the setup I had to do. You should now be able to use xsane or Gimp to grab images off your scanner. I don&#8217;t know how to make the buttons on the scanner do anything, even <kbd>xev</kbd> reported nothing.
</p>

<p>
If you have problems, you should post on the <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5zYW5lLXByb2plY3Qub3JnLw==">SANE mailing list</a>, not here, because I don&#8217;t really know anything about SANE and can&#8217;t help you.
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=218" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2007/epson-perfection-v100-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Which Vista Version?</title>
		<link>http://push.cx/2007/which-vista-version</link>
		<comments>http://push.cx/2007/which-vista-version#comments</comments>
		<pubDate>Tue, 30 Jan 2007 14:53:58 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Vista]]></category>

		<guid isPermaLink="false">http://push.cx/2007/which-vista-version</guid>
		<description><![CDATA[Today Windows Vista is available to customers in seven versions, and I&#8217;ve had some friends and family ask which they should buy: Windows Vista Starter Edition Windows Vista Home Basic Edition Windows Vista Home Premium Edition Windows Vista Professional Edition Windows Vista Small Business Edition Windows Vista Enterprise Edition Windows Vista Ultimate Edition There&#8217;s two [...]]]></description>
			<content:encoded><![CDATA[<p>
Today <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy53aW5kb3dzdmlzdGEuY29t">Windows Vista</a> is available to customers in seven versions, and I&#8217;ve had some friends and family ask which they should buy:
</p>

<ul>
  <li>Windows Vista Starter Edition</li>
  <li>Windows Vista Home Basic Edition</li>
  <li>Windows Vista Home Premium Edition</li>
  <li>Windows Vista Professional Edition</li>
  <li>Windows Vista Small Business Edition</li>
  <li>Windows Vista Enterprise Edition</li>
  <li>Windows Vista Ultimate Edition</li>
</ul>

<p>
There&#8217;s two answers to this question, one for the geeks and one for everyone else.
</p>

<h2>If you&#8217;re not a geek</h2>

<img class="decoration" src="http://push.cx/wp-content/uploads/2007/01/osx.thumbnail.jpg" alt="OS X Logo" />

<p>
Buy an Apple computer with OS X. Seriously. You&#8217;d have to buy a new computer for Vista anyways (this applies to you even if you bought a computer this week). The Intel-based macs are excellent machines, OS X is easy, reliable, and can do everything you want do with your computer. You can even set them up to run XP alongside OS X for that one last program you can&#8217;t get your files out of.
</p>

<p>
If you don&#8217;t want OS X because you&#8217;re a gamer, you <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5nYW1laW5mb3JtZXIuY29tL1ByaW50RnJpZW5kbHkuYXNweD97NTIyNkFGQzYtMTcxQS00ODNCLUIzNDgtOERGMjMyNTc3RkQ3fQ==">don&#8217;t want Vista either</a>. Just get a mac and a Wii.
</p>

<h2>If you&#8217;re a geek</h2>

<img class="decoration" src="http://push.cx/wp-content/uploads/2007/01/ubuntu.thumbnail.png" alt="Ubuntu Logo" />
<p>
You want <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy51YnVudHUuY29t">Ubuntu Linux</a>. It&#8217;s darn easy, it&#8217;s great on laptops, and you can make it sit up and do tricks. I don&#8217;t need to elaborate on this one: you know Linux is the hands-down best OS for geeks, and Ubuntu is a great distribution.
</p>

<h2>Either way&#8230;</h2>

<p>
I&#8217;m not going to be supporting Windows Vista for my friends and family. I&#8217;ve limped along with a little XP knowledge, but I&#8217;ve never used it for anything but testing and a few games so I&#8217;ve never really learned my way around it. I&#8217;ll put up with Vista professionally, but I won&#8217;t be able to help you solve the problems you&#8217;ll have with it.
</p>

<p>
And you will have problems. It&#8217;s <em>built</em> to have problems: the <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3d3dy5jcy5hdWNrbGFuZC5hYy5uei9+cGd1dDAwMS9wdWJzL3Zpc3RhX2Nvc3QuaHRtbA==">anti-piracy protections</a> will have it lowering image and sound quality, turning off features, and disabling itself altogether if it decides you&#8217;re doing anything hinky, whether or not you are. Editing your home movies may trigger it to think you&#8217;re editing Hollywood&#8217;s movies, and it&#8217;ll lock down on you. You don&#8217;t want a product that&#8217;s defective by design anywhere near your important files.
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=207" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2007/which-vista-version/feed</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Dual-Head on the 13&#8243; Macbook</title>
		<link>http://push.cx/2006/dual-head-on-the-13-macbook</link>
		<comments>http://push.cx/2006/dual-head-on-the-13-macbook#comments</comments>
		<pubDate>Sat, 04 Nov 2006 01:39:41 +0000</pubDate>
		<dc:creator>Peter Harkins</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[dual-head]]></category>
		<category><![CDATA[edgy]]></category>
		<category><![CDATA[MacBook]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[X]]></category>
		<category><![CDATA[Xorg]]></category>

		<guid isPermaLink="false">http://push.cx/2006/dual-head-on-the-13-macbook</guid>
		<description><![CDATA[Since Ubuntu Edgy came out last week I decided to spend some more time tinkering with getting dual-head display working, and this time it took. Feast your eyes on the 1280&#215;1824 goodness: The division between monitors is that little gap just under the huge code window. I keep what I&#8217;m working on up on the [...]]]></description>
			<content:encoded><![CDATA[<p>
Since <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cHM6Ly93aWtpLnVidW50dS5jb20vRWRneUVmdA==">Ubuntu Edgy</a> came out last week I decided to spend some more time tinkering with getting dual-head display working, and this time it took.
</p>

<p>
Feast your eyes on the 1280&#215;1824 goodness:
</p>

<a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3B1c2guY3gvd3AtY29udGVudC91cGxvYWRzLzIwMDYvMTEvc2NyZWVuc2hvdC5wbmc="><img class="content" src="http://push.cx/wp-content/uploads/2006/11/screenshot.thumbnail.png" alt="dual-head macbook screenshot" /></a>

<p>
The division between monitors is that little gap just under the huge code window.
</p>

<p>
I keep what I&#8217;m working on up on the top monitor &#8212; a nice big vim code window (usually :split into multiple windows) and a browser for viewing the output. Down on the bottom is IRC, <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=aHR0cDovL3NpbXVkLm9yZy9mZWF0dXJlcw==">SIMud</a>, mail, and any docs I need.
</p>

<p>
My desktop theme is deliberately very plain and subdued. I figure any time I notice how pretty my desktop is I&#8217;m being distracted from what I&#8217;m doing, so I have no animations, transparency, or other bits of frippery.
</p>

<p>
If you&#8217;re curious, here&#8217;s my <a href="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?url=L3dwLWNvbnRlbnQvdXBsb2Fkcy8yMDA2LzExL3hvcmcuY29uZg==">xorg.conf</a>. Of course, now that I&#8217;ve got it working I&#8217;m tempted to get a nice 23&#8243; display (the 13&#8243; Macbook can run an external display at up to 1900&#215;1200).
</p> <img src="http://push.cx/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=189" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://push.cx/2006/dual-head-on-the-13-macbook/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

