<?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>Open Source Operations</title>
	<atom:link href="http://blog.opensourceconsulting.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.opensourceconsulting.com</link>
	<description>The business and tech of running FLOSS based operations</description>
	<lastBuildDate>Sun, 01 Aug 2010 17:50:19 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8216;less&#8217; the youngest file in the dir that is not a dot file</title>
		<link>http://blog.opensourceconsulting.com/?p=105</link>
		<comments>http://blog.opensourceconsulting.com/?p=105#comments</comments>
		<pubDate>Sun, 01 Aug 2010 17:48:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash tips]]></category>
		<category><![CDATA[bash tricks]]></category>
		<category><![CDATA[commandline productivity]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=105</guid>
		<description><![CDATA[# less the youngest file in the dir that is not a dot file.
function lless () {
less `ls -Art1&#124;tail -1`
}


]]></description>
			<content:encoded><![CDATA[<p># less the youngest file in the dir that is not a dot file.<br />
function lless () {<br />
less `ls -Art1|tail -1`<br />
}<br />
<code class="codecolorer bash default"><span class="bash"><span class="br0"><br />
</span></span></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=105</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Admin: How to turn Hyperthreading on and off on CentOS 5.3 (and likely all 2.6 kernels) without a reboot</title>
		<link>http://blog.opensourceconsulting.com/?p=133</link>
		<comments>http://blog.opensourceconsulting.com/?p=133#comments</comments>
		<pubDate>Sun, 01 Aug 2010 17:45:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=133</guid>
		<description><![CDATA[Hyperthreading is back in Intel Processors. We use MatLab which apparently doesn&#8217;t like to see 16 cores when there are really only 8.
Here&#8217;s a script to flip procs 8-and-up  on and off. Change the perl &#8216;&#62;= 8&#8242;   part to set it for your environment.
Thanks to http://dag.wieers.com/blog/is-hyper-threading-enabled-on-a-linux-system for
#!/bin/bash

if [ ! -z $1 ]
then
 # fancy [...]]]></description>
			<content:encoded><![CDATA[<p>Hyperthreading is back in Intel Processors. We use MatLab which apparently doesn&#8217;t like to see 16 cores when there are really only 8.</p>
<p>Here&#8217;s a script to flip procs 8-and-up  on and off. Change the perl &#8216;&gt;= 8&#8242;   part to set it for your environment.</p>
<pre>Thanks to http://dag.wieers.com/blog/is-hyper-threading-enabled-on-a-linux-system for</pre>
<pre>#!/bin/bash

if [ ! -z $1 ]
then
 # fancy bash block method of doing if else;
 $(echo $1 | grep -qi "^on$") &amp;&amp; {
 echo turning CPU from 8 up ON ;
 CPU_VALUE=1 ;
}

$(echo $1 | grep -qi "^off$") &amp;&amp;  {
 echo turning CPU from 8 up OFF ;
 CPU_VALUE=0 ;
}

for i in $(find /sys/devices/system/node -name "cpu[0-9]*" |perl -ne  '($i)= m{u(\d+)$}xms; if ($i &gt;= 8){print}; undef $i;' )
do
 if [ -d $i  ]
 then
 echo $i
 echo "$CPU_VALUE"  &gt; $i/online 2&gt; /dev/null
 else
 echo $i is not a dir
 fi

done

else
 echo "must give an argument of 'on' or 'off'"
fi

echo Running processors
cat /proc/cpuinfo|egrep '^processor'</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=133</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Double pasting in X11 or VNC using True X-mouse on Microsoft</title>
		<link>http://blog.opensourceconsulting.com/?p=135</link>
		<comments>http://blog.opensourceconsulting.com/?p=135#comments</comments>
		<pubDate>Tue, 02 Mar 2010 20:21:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=135</guid>
		<description><![CDATA[## gold txmouse setup for fixing the hightlight-paste annoyance in vnc and vmware
REGEDIT4
[HKEY_CURRENT_USER\Software\&#60;appro@fy.chalmers.se&#62;\TXMouse]
&#8220;AutoRaiseDelay&#8221;=dword:0
&#8220;ExemptedClasses&#8221;=&#8221;rfb::win32::DesktopWindowClass*;WindowsForms10.Window.8.app.0.3*;EXCEEDW:*;XWinClass;cygwin/x*;vncviewer*;tightVNC*;wMFService*;UIMainClass;TSSHELLWND;MSPaintApp;Basilisk*;tty;&#8221;
&#8220;ExemptedModules&#8221;=&#8221;vmware.exe;msrdp.ocx;mstscax.ocx;wfica.ocx;&#8221;
&#8220;RapidClickInterval&#8221;=dword:0000014d
&#8220;TwoButtons&#8221;=dword:0
I&#8216;m a huge fan of the Windows app TXMouse
By default it avoids a set of apps it doesn&#8217;t interact well with. As of early 2010 it does not work correctly with an X11 session running on RealVNC. The symptoms are:
- double-pastes in xterms
- [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">## gold txmouse setup for fixing the hightlight-paste annoyance in vnc and vmware</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">REGEDIT4</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">[HKEY_CURRENT_USER\Software\&lt;appro@fy.chalmers.se&gt;\TXMouse]</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8220;AutoRaiseDelay&#8221;=dword:0</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8220;ExemptedClasses&#8221;=&#8221;rfb::win32::DesktopWindowClass*;WindowsForms10.Window.8.app.0.3*;EXCEEDW:*;XWinClass;cygwin/x*;vncviewer*;tightVNC*;wMFService*;UIMainClass;TSSHELLWND;MSPaintApp;Basilisk*;tty;&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8220;ExemptedModules&#8221;=&#8221;vmware.exe;msrdp.ocx;mstscax.ocx;wfica.ocx;&#8221;</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8220;RapidClickInterval&#8221;=dword:0000014d</div>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">&#8220;TwoButtons&#8221;=dword:0</div>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;">I</span>&#8216;m a huge fan of the Windows app <a href="http://fy.chalmers.se/~appro/nt/TXMouse/" target="_blank"><span style="color: #000000;">TXMouse</span></a></p>
<p>By default it avoids a set of apps it doesn&#8217;t interact well with. As of early 2010 it does not work correctly with an X11 session running on RealVNC. The symptoms are:</p>
<p>- double-pastes in xterms</p>
<p>- anything mouse highlighted in emacs immediately pastes into the buffer</p>
<p>The TXMouse site has a way to figure out what is going on, here&#8217;s what I found for newer RealVNC viewer:</p>
<pre>REGEDIT4</pre>
<pre>[HKEY_CURRENT_USER\Software\&lt;appro@fy.chalmers.se&gt;\TXMouse]
"AutoRaiseDelay"=dword:0
"ExemptedClasses"="rfb::win32::DesktopWindowClass*;WindowsForms10.Window.8.app.0.3*;EXCEEDW:*;XWinClass;cygwin/x*;vncviewer*;tightVNC*;wMFService*;UIMainClass;TSSHELLWND;MSPaintApp;Basilisk*;tty;"
"ExemptedModules"="vmware.exe;msrdp.ocx;mstscax.ocx;wfica.ocx;"
"RapidClickInterval"=dword:0000014d
"TwoButtons"=dword:0</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=135</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automatic MySQL backup with emails off-site and clean up</title>
		<link>http://blog.opensourceconsulting.com/?p=123</link>
		<comments>http://blog.opensourceconsulting.com/?p=123#comments</comments>
		<pubDate>Fri, 18 Sep 2009 04:33:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=123</guid>
		<description><![CDATA[I was talking with some friends about automating MySQL backups &#8211; here&#8217;s a script to backup my wordpress mysql database and mail it to a gmail account for safekeeping. It cleans up after itself too.
I run it from cron every 4th day:
0 4 */4 * * /usr/local/bin/wordpress_backup.bash
-Tony
#!/bin/bash

# This requires 'nail' which takes attachments from the [...]]]></description>
			<content:encoded><![CDATA[<p>I was talking with some friends about automating MySQL backups &#8211; here&#8217;s a script to backup my wordpress mysql database and mail it to a gmail account for safekeeping. It cleans up after itself too.</p>
<p>I run it from cron every 4th day:</p>
<p>0 4 */4 * * /usr/local/bin/wordpress_backup.bash</p>
<p>-Tony</p>
<pre>#!/bin/bash

# This requires 'nail' which takes attachments from the command line. Available
# with "sudo yum install -y nail" 

DUMP_DIR=/home/USER/wordpress_backup
BASE_FILE_NAME=OSC_wordpress_db

# if the dir does not exist create it
if [ ! -d $DUMP_DIR  ]
then
 mkdir -p $DUMP_DIR
fi

# generate a file name with todays date
DUMP_FILE=$DUMP_DIR/${BASE_FILE_NAME}_`date +%Y-%m-%d`.sql.bz2

# run the mysqldump, pipe it through bzip2 and redirect it to the filename
mysqldump --add-drop-table -h localhost -u nnnnnn -pxxxxxx wp_dbase |
 bzip2  -c &gt; ${DUMP_FILE}

# generate an email body, pipe to nail with the bz2 dump attached
(echo; echo; echo "#########"; echo "###" ;date +%Y-%m-%d; echo "autogenerated blog dumpfile $DUMP_FILE" ) |
nail -a ${DUMP_FILE} -s "blog dumpfile $DUMP_FILE" MAILID+blogbackup@gmail.com

if [ ! -z ${BASE_FILE_NAME} -o ! -d $DUMP_DIR ]
 then
 cd ${DUMP_DIR}
 # look for files that match the dump files that are older than 3 days
 # and remove them
 find $DUMP_DIR -name "${BASE_FILE_NAME}*" -mtime +3 |xargs -i rm -v {}
 else
 echo "not doing a find/delete"
fi</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=123</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>adding your id_[dr]sa.pub to authorized_keys the easy way</title>
		<link>http://blog.opensourceconsulting.com/?p=103</link>
		<comments>http://blog.opensourceconsulting.com/?p=103#comments</comments>
		<pubDate>Sat, 01 Aug 2009 16:21:10 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash tricks]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=103</guid>
		<description><![CDATA[Whenever I start a new gig I have to key all the boxes &#8211; it&#8217;s tedious at best. Here&#8217;s a bash function to put a key on a far box. I always make sure I have an &#8220;eval `ssh-agent`&#8221; and &#8220;ssh-add&#8221; in my shell before running &#8216;keybox&#8217;.
Usage:
   keybox [user@]box
Example:
   keybox root@hammerforge
Warnings:
Uses [...]]]></description>
			<content:encoded><![CDATA[<p>Whenever I start a new gig I have to key all the boxes &#8211; it&#8217;s tedious at best. Here&#8217;s a bash function to put a key on a far box. I always make sure I have an &#8220;eval `ssh-agent`&#8221; and &#8220;ssh-add&#8221; in my shell before running &#8216;keybox&#8217;.</p>
<p>Usage:<br />
   keybox [user@]box<br />
Example:<br />
   keybox root@hammerforge</p>
<p>Warnings:<br />
Uses &#8216;mktemp&#8217; which might not be on every OS. Assumes a POSIXy shell at both   ends. Tested with bash and zsh.</p>
<p><code lang="bash"><br />
##############################<br />
##########<br />
# Thu May 28 13:57:25 2009<br />
# will key a box for you<br />
# use like "keybox foobar" OR "keybox user@foobar" it will take<br />
# ~/.ssh/id_dsa.pub (change for your keytype) and write it to the far<br />
# $USER/.ssh/authorized_keys file. Assumes you are using ssh-agent, ssh-add<br />
# for passwdless logins.<br />
#-Tony Thu May 28 16:59:22 2009</p>
<p>function keybox () {</p>
<p># correct for your keytype<br />
SSH_PUB_KEY=~/.ssh/id_dsa.pub<br />
#SSH_PUB_KEY=~/.ssh/id_rsa.pub<br />
###</p>
<p># see is we got user@box, key the 'user' (ie root@hammerforge will<br />
# have your key added to ~root/.ssh/authorized_Keys)<br />
if (echo $1|grep -q @)<br />
then<br />
    USER_TO_KEY=`echo $1|cut -f1 -d'@'`<br />
    MACHINE_TO_KEY=`echo $1|cut -f2 -d'@'`<br />
else<br />
      USER_TO_KEY=$USER<br />
      MACHINE_TO_KEY=$1<br />
fi</p>
<p>    AUTH_KEYS=.ssh/authorized_keys<br />
    if [ -f ${SSH_PUB_KEY} ]<br />
        then<br />
        echo found ${SSH_PUB_KEY}<br />
    else<br />
        echo "did not file a public key, generating a new dsa key"<br />
        ssh-keygen -t dsa<br />
        echo<br />
        echo "continuing to keybox $MACHINE_TO_KEY"</p>
<p>    fi<br />
    LOCAL_KEY=`cat ${SSH_PUB_KEY}`</p>
<p>    TEMP_FILE=`mktemp -u`<br />
    # use some ssh options so it doesn't complain about known_hosts.<br />
         ssh -o  StrictHostKeyChecking=no ${USER_TO_KEY}@${MACHINE_TO_KEY} "cp ~${USER_TO_KEY}/${AUTH_KEYS} ~${USER_TO_KEY}/.ssh/hold_authorized_keys ;echo  \"$LOCAL_KEY\" > $TEMP_FILE ; cat  $TEMP_FILE >> ~${USER_TO_KEY}/${AUTH_KEYS}"<br />
    # do another ssh to confirm you can get back to the box<br />
    # Batchmode causes ssh it quit if the autologin doesn't work<br />
    ssh -o BatchMode=yes ${USER_TO_KEY}@${MACHINE_TO_KEY} "hostname; date ; rm -v  $TEMP_FILE"</p>
<p>}</p>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=103</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Network management: Netomata &#8211; Single source, machine generated network configs</title>
		<link>http://blog.opensourceconsulting.com/?p=93</link>
		<comments>http://blog.opensourceconsulting.com/?p=93#comments</comments>
		<pubDate>Tue, 14 Apr 2009 18:06:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT operations management]]></category>
		<category><![CDATA[Network Management Tools]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=93</guid>
		<description><![CDATA[I love the idea of Netomata! I haven&#8217;t used it yet, but have often lamented the lack of structure around networking configs. This is not just a great idea for the implementation level, but also for management. If you run your shop with this, a director/manager can learn the tool and get visibility into the [...]]]></description>
			<content:encoded><![CDATA[<p>I love the idea of <a href="http://www.netomata.com" target="_blank">Netomata</a>! I haven&#8217;t used it yet, but have often lamented the lack of structure around networking configs. This is not just a great idea for the implementation level, but also for management. If you run your shop with this, a director/manager can learn the tool and get visibility into the entire networking infrastructure rather than having to trace through the decentralized networking equipment configs.</p>
<p>It&#8217;s also makes the networking piece of Disaster Recovery significantly easier.</p>
<p>The <a href="http://www.netomata.com/benefits" target="_blank">benefits </a>and <a title="Why" href="https://www.netomata.com/faq/products/why" target="_blank">why </a>pages are great summaries of why to use centrally generated configs for all machine management. One of the points is &#8220;Providing a limited kind of process documentation.&#8221; This massivly sells the process short. It would be better to say &#8220;Provides unequivocally and 100% repeatable process documentation.&#8221;</p>
<p>If you&#8217;ve got experience with it, please post a trip report.</p>
<p>-Tony</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=93</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Operations management: Transitioning projects from groups outside operations</title>
		<link>http://blog.opensourceconsulting.com/?p=73</link>
		<comments>http://blog.opensourceconsulting.com/?p=73#comments</comments>
		<pubDate>Fri, 27 Mar 2009 03:25:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IT operations management]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.opensourceconsulting.com/?p=73</guid>
		<description><![CDATA[A necessary piece of operations is riding herd on home grown applications and projects from the corporate wilds. These things come to you late in their lifecycle with little to say about how their technology or composition. Often the expectation is that you&#8217;ll just take them over and &#8220;make them work.&#8221; Sometimes that&#8217;s doable, but [...]]]></description>
			<content:encoded><![CDATA[<p>A necessary piece of operations is riding herd on home grown applications and projects from the corporate wilds. These things come to you late in their lifecycle with little to say about how their technology or composition. Often the expectation is that you&#8217;ll just take them over and &#8220;make them work.&#8221; Sometimes that&#8217;s doable, but most time there are support limitations.</p>
<p>Here&#8217;s the interview and explanation process I use to work with groups outside of Ops to set realistic expectations and about what can and and can&#8217;t do for them. It is step 0 of a project plan work. I like to avoid surprised and clearly set expectations about Operations can and can&#8217;t do.</p>
<p><strong>How to have Ops take ownership for systems or processes or programs:</strong></p>
<ol>
<li> What is the business justification for this process?</li>
<li> Who sponsors the process (outside of operations)?</li>
<li> When will the process be turned over to operations?</li>
<li> How will your group know the process is in place and being monitored?</li>
<li> What are Operations obligations and responsibilities?</li>
<li> What are the  sponsoring groups obligations and responsibilities?</li>
</ol>
<p>System category:</p>
<ol>
<li>Requires full/half/quarter time staff member.</li>
<li>Existing process needs monitoring and response plan.</li>
<li>Trivial process that doesn’t require monitoring.</li>
<li>Trivial process that needs monitoring.</li>
<li>Ops can monitor but not trouble shoot.</li>
<li>Ops can troubleshoot at level 1/2/3 but cannot fix.</li>
</ol>
<p>Why would ops decline to accept your system, process or program:</p>
<ol>
<li> There may be no way to support the process (for instance it involves on-going manual work – in this case the process likely needs to start at Engineering).</li>
<li> It will incur resource costs beyond reasonable levels (i.e. network usage beyond our current capacity, etc.)</li>
<li> The sponsoring group does not provide ongoing budgetary support.</li>
</ol>
<p>What you should expect from us.</p>
<ol>
<li>Integrity and discipline in all our work.</li>
<li>A consulting approach to putting your process into production. This means being an organization that is committed to your success and wants to put your work into production.</li>
<li>A “closed loop” system that has clear responsibility, reporting, troubleshooting and escalation procedures.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=73</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Admin: dhcpd and tftpd setup</title>
		<link>http://blog.opensourceconsulting.com/?p=17</link>
		<comments>http://blog.opensourceconsulting.com/?p=17#comments</comments>
		<pubDate>Tue, 20 Jan 2009 17:46:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[bash tips]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux admin]]></category>
		<category><![CDATA[operations]]></category>
		<category><![CDATA[server farm]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[tftpd]]></category>
		<category><![CDATA[Add new tag]]></category>

		<guid isPermaLink="false">http://new.opensourceconsulting.com/?p=17</guid>
		<description><![CDATA[Using tcpdump for tftp trouble shooting: tcpdump -n -i eth0 -vvv port tftp]]></description>
			<content:encoded><![CDATA[<p>I setup dhcpd and tfpt just infrequently enough to forget the details. I&#8217;m putting my gottchas here so I don&#8217;t forget them.</p>
<p>syslinux package &#8216;pxelinux&#8217;:<br />
pxelinux loads and gets the right IP, then it fails trying to<br />
getting the error &#8220;tftp server does not support tsize option&#8221;</p>
<p>Fix:</p>
<p>in file /etc/dhcpd.conf:</p>
<blockquote>
<pre># absolutly critical to have the next-server line for tftp booting
# when you get "tftp server does not support tsize option" error,
#it's because your missing the config line, Double check with:
#          grep next-server     /etc/dhcpd.conf
#    - Tony 10/17/08
next-server 192.168.0.50;</pre>
</blockquote>
<p>Troubleshooting:</p>
<p>1] for setting up tftpd you have to make sure there are not entries like<br />
this in /etc/hosts file</p>
<pre>127.0.1.1      joust.famemobile.com joust</pre>
<p>if so you have to change them to this.</p>
<pre>192.168.1.155   joust.famemobile.com joust</pre>
<p>2] Using tcpdump for tftp trouble shooting</p>
<p>The fact that loading pxelinux.0 succeeds made me think everything else should work.</p>
<p>The pxelinux.0 loads fine, but the config file &#8216;pxelinux.cfg/01-00-0c-29-c4-b0-5a&#8217;  does not.</p>
<p>05:27:20.882329 IP (tos 0&#215;0, ttl  20, id 2, offset 0, flags [none], proto: UDP (17), length: 55) 192.168.0.51.ah-esp-encap &gt; 192.168.0.50.tftp: [udp sum ok]  27 RRQ &#8220;pxelinux.0&#8243; octet tsize 0<br />
05:27:20.893400 IP (tos 0&#215;0, ttl  20, id 4, offset 0, flags [none], proto: UDP (17), length: 60) <span style="font-weight: bold;">192.168.0.51.acp-port &gt; 192.168.0.50.tftp</span>: [udp sum ok]  32 RRQ &#8220;pxelinux.0&#8243; octet blksize 1456<br />
05:27:20.953322 IP (tos 0&#215;0, ttl  20, id 29, offset 0, flags [none], proto: UDP (17), length: 91) <span style="font-weight: bold;">192.168.0.51.57089 &gt; 0.0.0.0.tftp</span>:  63 RRQ &#8220;pxelinux.cfg/01-00-0c-29-c4-b0-5a&#8221; octet tsize 0 blks<br />
&#8230; stuff cut out&#8230;<br />
05:27:20.972168 IP (tos 0&#215;0, ttl  18, id 44911, offset 0, flags [none], proto: UDP (17), length: 54) <span style="font-weight: bold;">0.0.0.0.tftp &gt; 192.168.0.51.57089</span>: [udp sum ok]  26 ERROR tftp-err-#8 &#8221; tsize option required&#8221;</p>
<p>The &#8220;0.0.0.0.tftp&#8221; is the indicator there is something wrong.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basic Admin: Adding Blogger.com IP to iptables for SFTP</title>
		<link>http://blog.opensourceconsulting.com/?p=23</link>
		<comments>http://blog.opensourceconsulting.com/?p=23#comments</comments>
		<pubDate>Tue, 20 Jan 2009 04:29:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ipcalc]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[linux admin]]></category>

		<guid isPermaLink="false">http://new.opensourceconsulting.com/?p=23</guid>
		<description><![CDATA[I use blogger and host the files on my server, after I edit a post it has to sftp the files so they appear here. This is the process for adding them.
Adding the Blogger sftp servers to iptables.
Blogger.com lists their outbound ip&#8217;s here.  (It was current Jan 19, 2009)
# always check the addresses are [...]]]></description>
			<content:encoded><![CDATA[<p>I use blogger and host the files on my server, after I edit a post it has to <a href="http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol">sftp</a> the files so they appear here. This is the process for adding them.</p>
<p>Adding the Blogger sftp servers to iptables.</p>
<p>Blogger.com lists their outbound ip&#8217;s <a href="http://help.blogger.com/bin/answer.py?hl=en-ca&amp;answer=41422">here</a>.  (It was current Jan 19, 2009)</p>
<pre># always check the addresses are correct and the link above.
for i in 66.102.15.83 216.34.7.186 64.233.178.192/28  64.233.178/28
  do
             echo iptables -A INPUT -i eth0 -s $i -p tcp --dport ssh -j ACCEPT
  done</pre>
<pre>### Output
iptables -A INPUT -i eth0 -s 66.102.15.83 -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -i eth0 -s 216.34.7.186 -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -i eth0 -s 64.233.178.192/28 -p tcp --dport ssh -j ACCEPT
iptables -A INPUT -i eth0 -s 64.233.178/28 -p tcp --dport ssh -j ACCEPT</pre>
<p>######## Other notes<br />
I cheated and used <a href="http://jodies.de/ipcalc">ipcalc</a> to the get the subnet calculations:</p>
<pre>  ipcalc 64.233.178.192 - 64.233.178.207</pre>
<pre>  64.233.178.192/28</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=23</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Basic Admin: working with iptables logging</title>
		<link>http://blog.opensourceconsulting.com/?p=22</link>
		<comments>http://blog.opensourceconsulting.com/?p=22#comments</comments>
		<pubDate>Tue, 20 Jan 2009 03:00:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[iptables]]></category>
		<category><![CDATA[iptables LOG]]></category>
		<category><![CDATA[iptables logging]]></category>
		<category><![CDATA[linux admin]]></category>

		<guid isPermaLink="false">http://new.opensourceconsulting.com/?p=22</guid>
		<description><![CDATA[How to test if your rules are being activated:
# logging just the first packet - this shows an external host is reaching you,
# but does not flood messages with notices for every packet.
# Insert at the top of the INPUT chain a request to log only NEW connections
iptables -I INPUT -m state &#8211;state NEW -j [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:times new roman;">How to test if your rules are being activated:</span></p>
<pre># logging just the first packet - this shows an external host is reaching you,
# but does not flood messages with notices for every packet.</pre>
<p># Insert at the top of the INPUT chain a request to log only NEW connections<br />
iptables -I INPUT -m state &#8211;state NEW -j LOG</p>
<p>Turning off logging on iptables:</p>
<p># find the logging entry, use &#8211;line-number so you know which rule to delete.<br />
iptables -L INPUT &#8211;line-number |egrep &#8216;Chain|LOG&#8217;<br />
<span style="font-family:times new roman;">Chain INPUT (policy DROP)</span><br />
<span style="font-family:times new roman;">1    LOG        all  &#8212;  anywhere             anywhere            LOG level warning </span></p>
<p># delete it<br />
<span style="font-family:times new roman;">iptables &#8211;delete INPUT 1</span></p>
<p>## here&#8217;s a quicky perl script to get the same info and generate (but not execute) the delete line.</p>
<pre>#!/usr/bin/perl

my $CHAIN_NAME;
my $RULE_NUM;

# grab the iptables output
#@iptables_output = qx{iptables -L -n --line-numbers } ;

@iptables_output = qx{~/tmp/iptables -L -n --line-numbers } ;

# cut off the newlines
chomp @iptables_output;

for my $iptables_output_line (@iptables_output) {
    ( $TMP_CHAIN_NAME ) =  $iptables_output_line =~ m/
                      \A         # at the beginning of the line
                      Chain      # match chain
                      \s+
                      (\w+(-)?\w+)
                      /xms
                          and $CHAIN_NAME = $TMP_CHAIN_NAME;

    ($RULE_NUM) = $iptables_output_line =~ m/
                                             \A # at the beginning of the line
                                             (\d)+ # match any number of numbers
                                             \s+   # some space
                                             LOG    # the literal 'LOG'
                                             /xms
                                                 and print "found a log line for $CHAIN_NAME, delete it with:\n",
                                                     "\tiptables --delete $CHAIN_NAME $RULE_NUM\n";

}</pre>
<p>######### END perl script #######</p>
<p>#A couple of bash helper functions:<br />
function iptshow () {<br />
iptables -L $1 &#8211;line-numbers<br />
}</p>
<p>iptedit () {<br />
vi /etc/sysconfig/iptables<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.opensourceconsulting.com/?feed=rss2&amp;p=22</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
