<?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>jamesoff.net &#187; Linux</title>
	<atom:link href="http://jamesoff.net/site/category/sysadmin/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://jamesoff.net/site</link>
	<description>you heard</description>
	<lastBuildDate>Thu, 01 Sep 2011 17:39:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>vim as a man-page reader</title>
		<link>http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/</link>
		<comments>http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/#comments</comments>
		<pubDate>Thu, 06 Mar 2008 16:56:09 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/</guid>
		<description><![CDATA[Sure, why not :) This goes in your zshrc: vman&#40;&#41; &#123; if &#91; $# -eq 0 &#93;; then /usr/bin/man else if man -w $* &#62;/dev/null 2&#62;/dev/null then /usr/bin/man $* &#124; col -b &#124; vim -c 'set ft=man nomod' - else echo No man page for $* fi fi &#125; alias man='vman' And this goes in [...]]]></description>
			<content:encoded><![CDATA[<p>Sure, why not :)</p>

<p>This goes in your zshrc:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  vman<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
      <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span>
    <span style="color: #000000; font-weight: bold;">else</span>
      <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #660033;">-w</span> <span style="color: #007800;">$*</span> <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
      <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">man</span> <span style="color: #007800;">$*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">col</span> <span style="color: #660033;">-b</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">vim</span> <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'set ft=man nomod'</span> -
      <span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> No <span style="color: #c20cb9; font-weight: bold;">man</span> page <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #007800;">$*</span>
      <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
  <span style="color: #7a0874; font-weight: bold;">&#125;</span>
  <span style="color: #7a0874; font-weight: bold;">alias</span> <span style="color: #007800;">man</span>=<span style="color: #ff0000;">'vman'</span></pre></div></div>


<p>And this goes in your vimrc (in a suitable <code>augroup</code>):</p>

<pre lang="">
  autocmd FileType man setlocal ro nonumber nolist fdm=indent fdn=2 sw=4 foldlevel=2 | nmap q :quit<CR>
</pre>

<p>Now you&#8217;ll get nicely highlighted man pages with folded sections, and you can hit <code>q</code> to quit just like <code>less</code>.</p>

<p><img src='http://jamesoff.net/site/wp-content/uploads/2008/03/vim-manpage.png' alt='Vim as a manpage viewer' /></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2008/03/06/vim-as-a-man-page-reader/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Detecting memory type on FreeBSD</title>
		<link>http://jamesoff.net/site/2007/10/29/detecting-memory-type-on-freebsd/</link>
		<comments>http://jamesoff.net/site/2007/10/29/detecting-memory-type-on-freebsd/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 21:45:12 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[my stuff]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2007/10/29/detecting-memory-type-on-freebsd/</guid>
		<description><![CDATA[If you need to upgrade your RAM on a Windows machine, you can just use the Crucial Memory Advisor wotsit, which scans your computer using the power of, er, power to find out what your motherboard is, what RAM you already have, and then can tell you which overpriced Crucial RAM to buy. On FreeBSD, [...]]]></description>
			<content:encoded><![CDATA[<p>If you need to upgrade your RAM on a Windows machine, you can just use the <a href="http://www.crucial.com/uk/">Crucial</a> Memory Advisor wotsit, which scans your computer using the power of, er, power to find out what your motherboard is, what RAM you already have, and then can tell you which overpriced Crucial RAM to buy.</p>

<p>On FreeBSD, this doesn&#8217;t work so well. However, you can tell manually tell the Crucial site what motherboard you have and it will tell you exactly what sort of RAM is best.</p>

<p>This is fine if you know what motherboard you have.</p>

<p>if you don&#8217;t, the answer is <code>dmidecode(8)</code> (<code>/usr/ports/sysutils/dmidecode</code>). This utility grabs the same information which the Crucial thingy does, so all you need to do is find the info you need.</p>

<p><span id="more-300"></span></p>

<p>This is pretty easy:</p>

<pre><code># dmidecode -t baseboard
SMBIOS 2.3 present.

Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
        Manufacturer: ABIT &lt;http ://www.abit.com.tw&gt;
        Product Name: 694X-686B (VP6)
        Version: v1.0 ~
        Serial Number:
</code></pre>

<p>Not masses of useful information returned from my old system, but still enough to identify the motherboard as an Abit VP6. This is all I need to know to find out what memory I should be buying.</p>

<p>I already know what size sticks of RAM I have, but just incase you need to check:</p>

<pre><code># dmidecode -t memory
SMBIOS 2.3 present.
...
Handle 0x0021, DMI type 17, 21 bytes
Memory Device
    Array Handle: 0x0020
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: 512 MB
    Form Factor: DIMM
    Set: None
    Locator: BANK_0
    Bank Locator: Bank0/1
    Type: Unknown
    Type Detail: None
</code></pre>

<p>Again, not the most useful information ever seen, but enough to tell me I have a 512MB stick in bank 0. (On my newer desktop, I get much more useful information like the speed and voltage of the RAM.)
</http></p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2007/10/29/detecting-memory-type-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Firefox Addressbar Select-on-click</title>
		<link>http://jamesoff.net/site/2007/05/01/firefox-addressbar-select-on-click/</link>
		<comments>http://jamesoff.net/site/2007/05/01/firefox-addressbar-select-on-click/#comments</comments>
		<pubDate>Tue, 01 May 2007 10:33:48 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2007/05/01/firefox-addressbar-select-on-click/</guid>
		<description><![CDATA[In Windows, clicking on the addressbar in Firefox selects the existing URL so you can type to replace or paste to replace. In FreeBSD, clicking on the addressbar doesn&#8217;t do that. However, when you manually select the URL so you can replace it, it overwrites the contents of your clipboard and makes it so much [...]]]></description>
			<content:encoded><![CDATA[<p>In Windows, clicking on the addressbar in Firefox selects the existing URL so you can type to replace or paste to replace.</p>

<p>In FreeBSD, clicking on the addressbar doesn&#8217;t do that. However, when you manually select the URL so you can replace it, it overwrites the contents of your clipboard and makes it so much harder to paste the URL you were about to look at.</p>

<p>Luckily, you can fix this :) Browse to <code>about:config</code> and stick <code>urlbar</code> in the filter box. Find the <code>browser.urlbar.clickSelectsAll</code> setting and change it (by double-clicking) to true.</p>

<p>To paste, you&#8217;ll probably have best success with Ctrl-V as middlemouse seems to paste the clipboard without overwriting the previous contents.</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2007/05/01/firefox-addressbar-select-on-click/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>VMware Server&#8217;s httpd</title>
		<link>http://jamesoff.net/site/2006/10/02/vmware-servers-httpd/</link>
		<comments>http://jamesoff.net/site/2006/10/02/vmware-servers-httpd/#comments</comments>
		<pubDate>Mon, 02 Oct 2006 08:03:59 +0000</pubDate>
		<dc:creator>jamesoff</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://jamesoff.net/site/2006/10/02/vmware-servers-httpd/</guid>
		<description><![CDATA[After a brief powercut at work this morning the machine running VMware Server restarted. It came up fine, but wouldn&#8217;t start the VMware Apache server for the web interface. In /var/log/vmware-mui/error_log it was complaining: [Mon Oct 2 08:37:46 2006] [error] ModVmdb load: Address of ModVmdb_InitCore: 0xb7c745a0\n [Mon Oct 2 08:37:46 2006] [error] Failed to create [...]]]></description>
			<content:encoded><![CDATA[<p>After a brief powercut at work this morning the machine running VMware Server restarted. It came up fine, but wouldn&#8217;t start the VMware Apache server for the web interface. In <code>/var/log/vmware-mui/error_log</code> it was complaining:</p>

<pre><code>[Mon Oct  2 08:37:46 2006] [error] ModVmdb load: Address of ModVmdb_InitCore: 0xb7c745a0\n
[Mon Oct  2 08:37:46 2006] [error] Failed to create named-pipe directory:
  /var/run/vmware//httpd/3854: No such file or directory\n
[Mon Oct  2 08:37:46 2006] [error] VMWARE PANIC: \nNOT_IMPLEMENTED F(4023):707\n
[Mon Oct  2 08:37:46 2006] [error] Panic: Could not allocate temporary context.\n
</code></pre>

<p>This is apparently a known problem on Ubuntu (which is what I&#8217;m running it on), and <a href="http://www.vmware.com/community/message.jspa?messageID=439558">someone came up with this fix</a> on the VMware community forums. However, I&#8217;m not entirely happy with setting a directory to <code>777</code> so instead I created the <code>httpd</code> directory and changed the owner to <code>www-data</code>, which is who the VMware Apache server runs as. That meant I could set the permissions to <code>700</code>.</p>

<pre><code># mkdir /var/run/vmware/httpd
# chown www-data /var/run/vmware/httpd
# chmod 700 /var/run/vmware/httpd
</code></pre>

<p>Seems to be working fine now. I didn&#8217;t modify the startup script as suggested in the forum post yet, so I&#8217;ll see when I next restart this machine if I need to do that. (Possibly Ubuntu clears <code>/var/run</code> when it starts, which would explain it.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jamesoff.net/site/2006/10/02/vmware-servers-httpd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

