<?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>brucetimberlake.com &#187; System administration</title>
	<atom:link href="http://brucetimberlake.com/blog/category/sysadmin/feed/" rel="self" type="application/rss+xml" />
	<link>http://brucetimberlake.com/blog</link>
	<description></description>
	<lastBuildDate>Fri, 30 Jul 2010 16:07:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Keyboard mapping problem in Ubuntu VNC session</title>
		<link>http://brucetimberlake.com/blog/2009/11/12/keyboard-mapping-problem-in-ubuntu-vnc-session/</link>
		<comments>http://brucetimberlake.com/blog/2009/11/12/keyboard-mapping-problem-in-ubuntu-vnc-session/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 17:16:04 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[System administration]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[tightvnc]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vnc]]></category>
		<category><![CDATA[vnc4server]]></category>

		<guid isPermaLink="false">http://brucetimberlake.com/blog/2009/11/12/keyboard-mapping-problem-in-ubuntu-vnc-session/</guid>
		<description><![CDATA[New hard drive in my home PC = upgrade to/new install of Ubuntu 9.10 last night. I set up tightvncserver and all worked fine from home when I tested it last night. Today from my Macbook at work, though, odd keyboard mapping prevented using a VNC session. A little searching online reveals that tightvncserver is [...]]]></description>
			<content:encoded><![CDATA[<p>New hard drive in my home PC = upgrade to/new install of Ubuntu 9.10 last night.</p>
<p>I set up tightvncserver and all worked fine from home when I tested it last night. Today from my Macbook at work, though, odd keyboard mapping prevented using a VNC session.</p>
<p>A little searching online reveals that tightvncserver is apparently built with an old version of XFree.  Removing tightvncserver and using vnc4server instead solved the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://brucetimberlake.com/blog/2009/11/12/keyboard-mapping-problem-in-ubuntu-vnc-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting sendmail file pairs based on content</title>
		<link>http://brucetimberlake.com/blog/2009/09/02/deleting-sendmail-files-based-on-string-content/</link>
		<comments>http://brucetimberlake.com/blog/2009/09/02/deleting-sendmail-files-based-on-string-content/#comments</comments>
		<pubDate>Thu, 03 Sep 2009 03:28:13 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[System administration]]></category>

		<guid isPermaLink="false">http://brucetimberlake.com/blog/?p=33</guid>
		<description><![CDATA[This one-liner will identify files containing a string, and then use some bash string manipulation to generate a wildcard for the pair of files sendmail creates for each message (dfn for message content, and Qfn for headers). This assumes you&#8217;re running it in the mail queue directory (/var/spool/mqueue for example). for f in `grep -l [...]]]></description>
			<content:encoded><![CDATA[<p>This one-liner will identify files containing a string, and then use some bash string manipulation to generate a wildcard for the pair of files sendmail creates for each message (dfn for message content, and Qfn for headers).  This assumes you&#8217;re running it in the mail queue directory (/var/spool/mqueue for example).</p>
<p><code><br />
for f in `grep -l -i viagra *`; do t=${f:10:6}; rm -f *${t}; done<br />
</code></p>
<p>The <code>${f:10:6}</code> extracts the last 6 characters of the filename, then the <code>rm</code> command prepends that with the wildcard.</p>
<p>Some sample output:</p>
<p><code><br />
[root@mail mqueue]# grep -l -i cialis *<br />
dfn7U8Rc3X020530<br />
dfn7UD7BUh015512<br />
dfn7VELCbV031687<br />
</code></p>
<p>But there are actually six files:</p>
<p><code><br />
[root@mail mqueue]# ls -l | egrep "020530|015512|031687"<br />
-rw-------  1 root smmsp    2062 Aug 30 01:27 dfn7U8Rc3X020530<br />
-rw-------  1 root smmsp    2232 Aug 30 06:07 dfn7UD7BUh015512<br />
-rw-------  1 root smmsp    2069 Aug 31 07:21 dfn7VELCbV031687<br />
-rw-------  1 root smmsp     825 Aug 30 01:27 Qfn7U8Rc3X020530<br />
-rw-------  1 root smmsp     837 Aug 30 06:07 Qfn7UD7BUh015512<br />
-rw-------  1 root smmsp     810 Aug 31 07:21 Qfn7VELCbV031687<br />
</code></p>
<p>So we run the command, using cialis:</p>
<p><code><br />
for f in `grep -l -i cialis *`; do t=${f:10:6}; rm -f *${t}; done<br />
</code></p>
<p>Then there are no more files <img src='http://brucetimberlake.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><code><br />
[root@mail mqueue]# for f in `grep -l -i cialis *`; do t=${f:10:6}; rm -f *${t}; done<br />
[root@mail mqueue]# grep -l -i cialis *<br />
[root@mail mqueue]#<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://brucetimberlake.com/blog/2009/09/02/deleting-sendmail-files-based-on-string-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One-liner to count current IP connections</title>
		<link>http://brucetimberlake.com/blog/2009/09/02/one-liner-to-count-current-ip-connections/</link>
		<comments>http://brucetimberlake.com/blog/2009/09/02/one-liner-to-count-current-ip-connections/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 14:57:52 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[System administration]]></category>

		<guid isPermaLink="false">http://brucetimberlake.com/blog/?p=29</guid>
		<description><![CDATA[A quick one-liner to show the IP addresses with an established connection to your server, sorted in order: netstat -ant &#124; grep ESTABLISHED &#124; awk '{print $5}' &#124; awk -F: '{print $1}' &#124; sort &#124; uniq -c &#124; sort -nr If you care only about a certain TCP port, say 80 for web traffic, the [...]]]></description>
			<content:encoded><![CDATA[<p>A quick one-liner to show the IP addresses with an established connection to your server, sorted in order:</p>
<p><code>netstat -ant | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -nr</code></p>
<p>If you care only about a certain TCP port, say 80 for web traffic, the command becomes:</p>
<p><code>netstat -ant | grep :80 | grep ESTABLISHED | awk '{print $5}' | awk -F: '{print $1}' | sort | uniq -c | sort -nr</code></p>
<p>Output would look like:</p>
<p><code><br />
36 14.21.23.10<br />
8 14.21.23.107<br />
7 14.21.23.114<br />
6 14.21.2.34<br />
5 14.21.23.108<br />
5 14.21.23.106<br />
5<br />
2 14.21.13.120<br />
1 14.21.2.23<br />
1 14.21.13.147<br />
1 14.21.13.130<br />
1 14.21.13.128<br />
1 14.21.13.122<br />
1 14.21.13.118<br />
1 14.21.13.112</p>
<p></code><span id="more-29"></span></p>
]]></content:encoded>
			<wfw:commentRss>http://brucetimberlake.com/blog/2009/09/02/one-liner-to-count-current-ip-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>sudo and local passwords vs SSH</title>
		<link>http://brucetimberlake.com/blog/2009/02/12/sudo-and-local-passwords-vs-ssh/</link>
		<comments>http://brucetimberlake.com/blog/2009/02/12/sudo-and-local-passwords-vs-ssh/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 16:49:34 +0000</pubDate>
		<dc:creator>Bruce</dc:creator>
				<category><![CDATA[System administration]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://brucetimberlake.com/blog/?p=17</guid>
		<description><![CDATA[Just tracked down a problem with sudo at work. The error message sudo: pam_authenticate: Module is unknown would show up when doing &#8220;sudo su -&#8221; An initial strace shows that libkeyutils was being looked for: open("/lib64/tls/x86_64/libkeyutils.so.1", O_RDONLY) = -1 ENOENT (No such file or directory) stat("/lib64/tls/x86_64", 0x7fffe8902810) = -1 ENOENT (No such file or directory) [...]]]></description>
			<content:encoded><![CDATA[<p>Just tracked down a problem with sudo at work. The error message</p>
<p><code>sudo: pam_authenticate: Module is unknown</code></p>
<p>would show up when doing &#8220;sudo su -&#8221;</p>
<p>An initial strace shows that libkeyutils was being looked for:</p>
<pre>
open("/lib64/tls/x86_64/libkeyutils.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls/x86_64", 0x7fffe8902810) = -1 ENOENT (No such file or directory)
open("/lib64/tls/libkeyutils.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/tls", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
open("/lib64/x86_64/libkeyutils.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
stat("/lib64/x86_64", 0x7fffe8902810)   = -1 ENOENT (No such file or directory)
</pre>
<p>but was not installed on the server. A &#8220;correct&#8221; server shows:</p>
<pre>
[root@host ~]# rpm -qa | grep keyutils|sort
keyutils-libs-1.2-1.el5
keyutils-libs-1.2-1.el5
keyutils-libs-devel-1.2-1.el5
keyutils-libs-devel-1.2-1.el5
</pre>
<p>Without keyutils installed, the SSH keys we had set up weren&#8217;t able to be processed. PAM then fell back to local passwords, which was not set for the particular user in question.</p>
<p>Anyway, just hoping this helps someone else in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://brucetimberlake.com/blog/2009/02/12/sudo-and-local-passwords-vs-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
