<?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>Mike&#039;s Musings</title>
	<atom:link href="http://www.mikespicer.net/wp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.mikespicer.net/wp</link>
	<description>There must be something useful here...</description>
	<lastBuildDate>Thu, 05 Aug 2010 00:46:41 +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>USB to Serial, Linux comes with built-in drivers!</title>
		<link>http://www.mikespicer.net/wp/?p=58</link>
		<comments>http://www.mikespicer.net/wp/?p=58#comments</comments>
		<pubDate>Thu, 05 Aug 2010 00:46:41 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=58</guid>
		<description><![CDATA[I was trying to communicate with a serial device today and found that Linux is much more resourceful than M$oft products (Obviously). I plugged in my USB to serial adapter, and typed in dmesg and saw it there in the list, ready to use. But now, how to use it? First determine where you USB ]]></description>
			<content:encoded><![CDATA[<p>I was trying to communicate with a serial device today and found that Linux is much more resourceful than M$oft products (Obviously).  I plugged in my USB to serial adapter, and typed in dmesg and saw it there in the list, ready to use.  But now, how to use it?</p>
<p>First determine where you USB device is located.  You can ls /dev/ and look for it&#8230; Since there are 700+ items there, I&#8217;ll give you a hint: ttyUSB is what it should start with.  Mine was /dev/ttyUSB0.</p>
<p>I found a tutorial of a little program called minicom.  Minicom is a lightweight terminal client that is quiet cool in my opinion.  Start minicom with the following:</p>
<p><code>minicom -s</code></p>
<p>This will put you in interactive configuration mode. Change your port information to what you discovered above and make sure to set the baud rate and other parameters.  Now choose to save the config as dfl (default) and away you go.</p>
<p>Thanks again Linux for being awesome!</p>
<p>-Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=58</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Qmail gets stuck, Qmail gets slow, and finally QMAIL GETS FIXED!!!</title>
		<link>http://www.mikespicer.net/wp/?p=52</link>
		<comments>http://www.mikespicer.net/wp/?p=52#comments</comments>
		<pubDate>Wed, 04 Aug 2010 06:24:42 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=52</guid>
		<description><![CDATA[Recently, I have been tasked to deal with a Qmail mail server that was very foreign to me. I have never administered a Qmail server before. Since I have experience with Postfix, Exchange Server, Xim and others, I figured Qmail couldn&#8217;t be too difficult right? Wow, I was wrong. Turns out Qmail is a culmination ]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been tasked to deal with a Qmail mail server that was very foreign to me.  I have never administered a Qmail server before.  Since I have experience with Postfix, Exchange Server, Xim and others, I figured Qmail couldn&#8217;t be too difficult right?  Wow, I was wrong.  Turns out Qmail is a culmination of many tools that do different things that enable it to be a complete software.  There are a large number of plugins and modifications one can make.  One forum I found suggested that a person install Qmail from source and get all the addons and plugins running they want and after it works, they will know how Qmail works.  One person I talked with said it is nearly impossible to troubleshoot complex issues with Qmail because each installation can be different.  </p>
<p><strong>The Problem</strong><br />
If the title wasn&#8217;t clear enough of what the problem was, I&#8217;ll completely explain here.  I was seeing issues with a queue that would never drop lower than 2000.  Also we were having problems with mail clients that would never complete the send process and messages would get stuck in peoples outboxes causing a large number of duplicate emails being sent to customers.  This issue also caused messages that were trying to be sent to our domain to be delayed or stuck&#8230; or worse duplicated.  </p>
<p><strong>The Solution</strong><br />
For this problem there was no simple fix.  It took a lot of testing and configuring to determine where and what was causing the issues.  First off, the guys at irc.freenode.net #qmail had a bunch of helpful suggestions that ultimately lead me to success.  Remember to check out IRC communities, and make sure you give back.  The next thing that really helped was Google.  Like most problems in life, someone else has probably done the exact same thing.  Google the issues and find the answers.</p>
<p>First part of this solution is to determine what exactly is wrong.  How do you know what is wrong?  Do predefined tests to see what works and what doesn&#8217;t.  In my case, I used a Qmail-inject tool, telnet, Thunderbird and Outlook.  I thought of each tool as a different level of mail sending so that I could eliminate where the problem was at.  Qmail-inject is very easy, just type the following at your root command line:</p>
<p><code> echo to: email@host.co | /var/qmail/bin/qmail-inject</code><br />
This will send the email directly to the Qmail queue and will tell you if you are able to send messages directly from the local machine/server.</p>
<p>The next tool is to connect to your server with telnet:<br />
<code>telnet host.co 25</code><br />
Here is a web site that explains how to do an Auth session and send mail beautifully!<br />
<a href="http://www.webpan.com/Customers/Email/SMTP_Authentication_Telnet_Test.htm">SMTP AUTH TELNET</a></p>
<p>If you have any problems with this process, send me a comment and I can help out.  Should be fairly easy to see this.</p>
<p>Ok, next you need to get qmHandle.  <a href="http://sourceforge.net/projects/qmhandle/">Go To Sourceforge Now</a></p>
<p>This tool is awesome.  It has a large number of features that can only be explained by the help: <code>./qmHandle</code></p>
<p>Next we have qfixq.  A brilliant program I found written by someone who was more frustrated than me.  <a href="http://qmail.jms1.net/scripts/qfixq.shtml">Go to qfixq.</a><br />
While you are at the qfixq site, be sure to poke around for other cool scripts and tips.  Lots of good information there.  I think I have tried out everyone of the scripts on his site now.  </p>
<p>qfixq is a script that will let you rebuild the Qmail queue if it gets jammed up.  Mine was very jammed up.  It also has a cool mode where it will empty everything as well.  It is a life saver.  </p>
<p>Next up is the logs.  I now know every meaningful log for Qmail.  Let me go through the important logs with you:</p>
<p><code>/var/log/qmail/qmail-smtpd/current</code><br />
This has information about SMTP connections into the server.  It will display current activity and can give you a status report.  For me, our server was maxed at 350/350 and remote concurrent connections were being blocked causing some of our issues.  </p>
<p><code>/var/log/qmail/qmail-send/current</code><br />
This has information about things being sent in the queue.  This is very helpful once items are dropped off from SMTP.  I was able to follow from the SMTP log to this log to track down what is happening to messages.  Check for local and remote delivery queues.  You can also see the state of messages that are trying to be delivered.  </p>
<p><code>/var/log/maillog</code><br />
This has information about Spamd and ClamAV.  You can see spam scores and scanning results here.  </p>
<p>Here are some important config files that you must keep in mind so that you can make sure things are setup correctly:</p>
<p><code>/var/qmail/supervise/qmail-smtpd/run</code><br />
This script has the run elements for the SMTPD daemon that is running.  When you edit this with a text editor, you see a lot of things happening here.  This was actually the fix for me.  Our issue originated from an overwhelming spam attack.  I was able to add some real time black lists (RBL&#8217;s) to thwart the evil spammers.  All I added was thet following:<br />
<code>/usr/local/bin/rblsmtpd -t 5 \<br />
-b -r b.barracudacentral.org \<br />
-b -r zen.spamhaus.org \<br />
</code><br />
I added this after the &#8220;smtp&#8221;  tag and the rest was history.  I reboot the server and there were very low connections to it.  Everything was getting blocked, like it should.  </p>
<p><strong>Summary</strong><br />
The moral of the story is to use strong black lists and watch your logs.  Things seem to be running quite well now.  I also ran qfixq to make sure there were not any issues with that. These steps to test, research and repair should be very helpful to anyone who was stumped like me.  Good luck!</p>
<p>Cheers,</p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=52</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AirOS Cool Commands</title>
		<link>http://www.mikespicer.net/wp/?p=50</link>
		<comments>http://www.mikespicer.net/wp/?p=50#comments</comments>
		<pubDate>Fri, 09 Jul 2010 07:10:27 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=50</guid>
		<description><![CDATA[AirOS is a custom Linux that is used on Ubiquiti equipment.  I have found some sweet commands that I didn&#8217;t want to forget. To make a script or command persistent use the following: /etc/persistent/rc.prestart /etc/persistent/rc.poststart /etc/persistent/rc.prestop /etc/persistent/rc.poststop Let me explain the execution of each of the scripts: rc.prestart &#8211; This happens before the standard bootup ]]></description>
			<content:encoded><![CDATA[<p>AirOS is a custom Linux that is used on Ubiquiti equipment.  I have found some sweet commands that I didn&#8217;t want to forget.</p>
<p>To make a script or command persistent use the following:</p>
<pre>
/etc/persistent/rc.prestart
/etc/persistent/rc.poststart
/etc/persistent/rc.prestop
/etc/persistent/rc.poststop
</pre>
<p>Let me explain the execution of each of the scripts:</p>
<ul>
<li><b>rc.prestart</b> &#8211; This happens before the standard bootup items are running.  Be careful when setting something here so that you have the proper prereq&#8217;s first.</li>
<li><b>rc.poststart</b> &#8211; This happens after the standard bootup items.</li>
<li><b>rc.prestop</b> &#8211; Before the shutdown command was executed.</li>
<li><b>rc.poststop</b> &#8211; After the shutdown command and after the shutdown items.</li>
<p>Here is a cool command that is directly from Linux that is very useful:</p>
<pre>
iwconfig
</pre>
<p>This is like ifconfig but gives information directly about the wireless connection.  </p>
<p>More to come soon.</p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=50</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bluehost with SVN</title>
		<link>http://www.mikespicer.net/wp/?p=41</link>
		<comments>http://www.mikespicer.net/wp/?p=41#comments</comments>
		<pubDate>Mon, 05 Jul 2010 21:21:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=41</guid>
		<description><![CDATA[Recently we have been tasked to provide SVN support with Bluehost.  Initially I was reading and found it was not possible to complete.  After a bit more searching I found that it was possible.  The steps here are not as simple as &#8220;apt-get install svn&#8221;, we actually have to compile it from source.  Since I ]]></description>
			<content:encoded><![CDATA[<p>Recently we have been tasked to provide SVN support with Bluehost.  Initially I was reading and found it was not possible to complete.  After a bit more searching I found that it was possible.  The steps here are not as simple as &#8220;apt-get install svn&#8221;, we actually have to compile it from source.  Since I have been extremely busy lately, I tasked my friend Henry for the job and then told him I could provide support when needed.</p>
<p>With the tutorial in hand, he went to work.  Here is the steps outlined in the tutorial:</p>
<pre dir="ltr">cd ~
mkdir src
cd ~/src
wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-util-1.2.12.tar.gz
wget http://www.gtlib.gatech.edu/pub/apache/apr/apr-1.2.12.tar.gz
wget http://subversion.tigris.org/downloads/subversion-1.5.4.tar.gz
wget http://www.webdav.org/neon/neon-0.28.0.tar.gz
tar -xzf apr-util-1.2.12.tar.gz
tar -xzf apr-1.2.12.tar.gz
tar -xzf subversion-1.5.4.tar.gz
tar -xzf neon-0.28.0.tar.gz
cd ~/src/apr-1.2.12
./configure --prefix=$HOME LDFLAGS="-L/lib64"
make
make install
cd ~/src/apr-util-1.2.12
./configure --prefix=$HOME --with-apr=$HOME LDFLAGS="-L/lib64"
make
make install
cd ~/src/neon-0.28.0
./configure --enable-shared --prefix=$HOME LDFLAGS="-L/lib64"
make
make install
cd ~/src/subversion-1.5.4
./configure --prefix=$HOME --without-berkeley-db  --with-ssl LDFLAGS="-L/lib64"
make
make install</pre>
<p>After making it through all of the above configuring and compiling, the binaries are sitting in ~/system/bin ready for use.</p>
<p>Now to add a new repo, type:</p>
<pre dir="ltr">svnadmin create /[dir]/[repo name]</pre>
<p>Now import files to the repo:</p>
<pre dir="ltr">svn import /[dir]/[repo name] [svn string, starting with svn://]</pre>
<p>Now the repo is ready to add files or to check them out.  But, you will soon learn that you need to add somethings to the path in order to properly execute.  Once I added the things to the path, it still didn&#8217;t work.  I found out that bluehost doesn&#8217;t allow execution of the .bashrc if it is a single execution item.  I found a work around:</p>
<p>First you will have to add a public key to the .ssh/authorized_keys from your system so that you can login without using a password.  If you need help with that, here is an awesome tutorial that works very well! <a href="http://linuxproblem.org/art_9.html">SSH Key Tutorial</a></p>
<p>Add the following before your rsa key in ~/.ssh/authorized_keys</p>
<pre dir="ltr">command="/home/USERNAME/system/bin/svnserve -t" ssh-rsa [KEY REMOVED]</pre>
<p>Now you should be able to login using the CLI for the system that you have added the key for and use SVN.</p>
<p>Now that you have everything else setup, it is time to get TurtoiseSVN client up and running.</p>
<p>First install Putty, if you need help with that, <a href="http://tinyurl.com/dkevqk">click here.</a></p>
<p>For those that didn&#8217;t click the link, click it for fun <img src='http://www.mikespicer.net/wp/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Next you are going to need to get WinSCP or Filezilla or some other program that can do file transfer over SSH.  I prefer Filezilla because it is Filezilla.  If you don&#8217;t have either of those, simply Google them and you&#8217;ll find them.</p>
<p>Ok, now you will need to log in to your Bluehost server with Putty.  Once you have logged in, type the following:</p>
<pre dir="ltr">
ssh-keygen -t rsa
</pre>
<p>This will create 2 files id_rsa and id_rsa.pub in the .ssh/ directory.  First you will want to copy the public key to make it so you can use this key on this server, type the following:</p>
<pre dir="ltr">
cp .ssh/id_rsa.pub .ssh/authorized_keys
</pre>
<p>Now I will assume you are using Filezilla.  Open Filezilla and then for the hostname, use &#8220;sftp://[domainname.com]&#8221; and your username and password.  Navigate to the ~/.ssh directory and download id_rsa to a directory on your computer of your choosing.</p>
<p>When you downloaded putty, you should have also downloaded PuttyGen.  Open PuttyGen and then select the Conversions menu and select Import Key.  Find the id_rsa file you just downloaded and import it.  After it is imported select the &#8220;Save Private Key&#8221; button and export the .PPK file to your choosing.  </p>
<p>Now we are going to open Putty and save a new session with our newly created key.  Once Putty is opened, go to SSH and then to AUTH and then select the private key you exported above.  After that go back to the sessions option and type the whole domainname (including .com/.net/.whatever) as the &#8220;Saved Session&#8221; and push the Save button.  It is important to save the session because Tortoise will use this in just a bit.  </p>
<p>You can test your SSH login to make sure it doesn&#8217;t ask for a password and you will know that you are on the right path.  </p>
<p>Next up, we have to make some changes to your Tortoise config file located at C:\Documents and Settings\YOUR_LOCAL_USERNAME\Application Data\Subversion\config<br />
If you have Vista or Win7, it will be located here:<br />
C:\Users\YOUR_LOCAL_USERNAME\AppData\Roaming\Subversion\config<br />
Now find the section called [tunnels] and add the following:</p>
<pre dir="lte">
ssh = c:\\Program\ Files\\TortoiseSVN\\bin\\TortoisePlink.exe
</pre>
<p>Link in Linux, you have to escape the backslashes with a backslash.</p>
<p>Ok, you should be ready to rock at this point. Time to install Tortoise if you haven&#8217;t already.  <a href="http://tortoisesvn.tigris.org/">Download it here.</a> Follow the installer, should be easy.  </p>
<p> Time to check something out.  Try to checkout a repo now by right clicking in Windows Explorer and choosing &#8220;SVN Checkout.&#8221;  Use the following string but add your own info:</p>
<pre dir="lte">
    svn+ssh://youraccount@[domain]/home/[your account]/[repo path]/[Project]
</pre>
<p>Hopefully everything worked, if it didn&#8217;t, hit me up and I&#8217;ll help out.</p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=41</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>More Fun With Trixbox and Skype &#8211; Dialing Skype Users</title>
		<link>http://www.mikespicer.net/wp/?p=38</link>
		<comments>http://www.mikespicer.net/wp/?p=38#comments</comments>
		<pubDate>Thu, 22 Apr 2010 20:05:43 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=38</guid>
		<description><![CDATA[Calling a Skype account with an IP/Soft phone is nearly impossible since phones traditionally only support numbers and not letters.  To make it possible to call Skype accounts, you simply add an extension that will call the Skype Account, here is how: Add a new extension, make sure to select &#8220;CUSTOM&#8221; type in the drop ]]></description>
			<content:encoded><![CDATA[<p>Calling a Skype account with an IP/Soft phone is nearly impossible since phones traditionally only support numbers and not letters.  To make it possible to call Skype accounts, you simply add an extension that will call the Skype Account, here is how:</p>
<ul>
<li>Add a new extension, make sure to select &#8220;CUSTOM&#8221; type in the drop down</li>
<li>Enter the extension you want to use fort he Skype Account</li>
<li>Enter the display name</li>
<li>Under Device Options, in the Dial box, enter the following: /SIP/[Skype Trunk Name]/[SkypeName]</li>
<li>Save and Apply</li>
</ul>
<p>You can now call that extension and it will forward to the Skype User.</p>
<p><em>NOTE: The steps above assume you already have an installed Skype Sip Trunk using SipToSis</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=38</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The War of the Cisco ASA VPN</title>
		<link>http://www.mikespicer.net/wp/?p=36</link>
		<comments>http://www.mikespicer.net/wp/?p=36#comments</comments>
		<pubDate>Sun, 28 Mar 2010 05:44:10 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=36</guid>
		<description><![CDATA[Over the last few weeks I have had an all out war with a Cisco ASA.  Typically ASA&#8217;s are not that hard to configure.  Some of the ACL&#8217;s can get tricky, but it is quite easy to determine if they are working or not.  Now when you are trying to figure out how to make ]]></description>
			<content:encoded><![CDATA[<p>Over the last few weeks I have had an all out war with a Cisco ASA.  Typically ASA&#8217;s are not that hard to configure.  Some of the ACL&#8217;s can get tricky, but it is quite easy to determine if they are working or not.  Now when you are trying to figure out how to make a VPN work and the other side has assured you that their configuration and configuration instructions are fine, it clouds the issues.  To begin, I will give you some background on the configuration.  This particular device is guarding the entry point for a network that has Remote-Access users and is also required for Site-to-Site to another companies network.  The remote access configuration was previously configured and working.  It was my responsibility to figure out the issue with the site-to-site and make the VPN work.<br />
Initially, it seemed simple, take traffic over the VPN, but then NAT it before it gets to the other side.  Easy right?  No No, this turned into a total mess.  The issue was that the instruction read that &#8220;you need to NAT interesting traffic to <strong>10.1.0.205/32</strong> (255.255.255.255).&#8221;  They also gave us the information that, &#8220;Your Local Network: <strong>10.1.0.205/32</strong> (255.255.255.255),&#8221; which is supposed to be our NAT side of the VPN.  Ok, so let me break this down&#8230;  You want me to take my network traffic (192.168.1.0/24) and then NAT it to 10.1.0.205/32 on the 10.1.0.205/32 network???  This is the assumption that was throwing me off course.  Their instructions should have been better to read, &#8220;Your Local Network: <strong>10.1.0.205/24</strong> (255.255.255.0)&#8221; which means that we have a host on a network, not a host on a host.</p>
<p>So anyways, here is the special modifications that got thing working for me:</p>
<p>access-list outside_cryptomap_1 extended permit ip host 10.1.0.205 192.168.50.0 255.255.255.0<br />
access-list outside_cryptomap_1 extended permit ip 192.168.1.0 255.255.255.0 192.168.50.0 255.255.255.0<br />
global (inside) 10 10.1.0.205<br />
nat (inside) 10 access-list outside_cryptomap_1<br />
crypto map outside_map 1 match address outside_cryptomap_1</p>
<p>These rules provided the meat to connect the site-to-site VPN.</p>
<p>In the process to the above solution I learned a number of very valuable things that will save me on future ASA configurations, like for example, when creating a Remote-Access VPN from the CLI, you must have the dynamic crypto map rules,  you must have crypto isakmp enabled, and you must define a crypto isakmp policy.  If you do not have any of these things the VPN will not negotiate.  If you are going to use DHCP, then you will need to have a dhcpd pool and it is also vital to have a group-policy.</p>
<p>Well, The war is over and I have won!  Many hours have been spent on this project, but I believe I can conquer nearly anything on the Cisco ASA!</p>
<p>-Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=36</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trixbox, VNCServer Skype, and SipToSis</title>
		<link>http://www.mikespicer.net/wp/?p=33</link>
		<comments>http://www.mikespicer.net/wp/?p=33#comments</comments>
		<pubDate>Sun, 07 Mar 2010 07:44:25 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=33</guid>
		<description><![CDATA[Today I was on a mission to get Skype and SipToSis to automatically start on boot. Since Trixbox only loads a web based GUI and everything else is command line, you have to include other packages to get Skype working. Another helpful fact is that Trixbox uses CentOS and the yum package manager. Yum has ]]></description>
			<content:encoded><![CDATA[<p>Today I was on a mission to get Skype and SipToSis to automatically start on boot.  Since Trixbox only loads a web based GUI and everything else is command line, you have to include other packages to get Skype working.  Another helpful fact is that Trixbox uses CentOS and the yum package manager.  Yum has a nice feature of the group install which will include all required packages and dependencies to get a group running.  Here is the command to get Gnome installed:</p>
<ul>
<li>yum groupinstall &#8220;GNOME Desktop Environment&#8221; &#8211;exclude=gimp-print &#8211;exclude=gimp-print-utils</li>
</ul>
<p>Once you get Gnome installed (you can choose KDE or another DM if you would like) you need to set the run level of your system so that it boots to the GUI, unless you don&#8217;t want that.  Crack open your favorite text editor (VIM for me) and edit your inittab:</p>
<ul>
<li>vi /etc/inittab</li>
</ul>
<p>You are looking for a line that says id:3:initdefault:, if you find it, make sure you change the 3 to a 5.  This could break your machine, so make sure you know what you are doing, or are at the machine when you make the change.   The init level is the run level for the machine.  Run level 5 is typically the GUI level.  This command just makes it so that items set to run on level 5 start on boot.</p>
<p>Next we have to start VNC on boot.  To do that use chkconfig.</p>
<ul>
<li>/sbin/chkconfig vncserver on</li>
</ul>
<p>To finish up vncserver, you have to edit the startup config in sysconfig.</p>
<ul>
<li>vi /etc/sysconfig/vncserver</li>
</ul>
<p>Make sure you uncomment</p>
<ul>
<li>VNCSERVERARGS[2]=&#8221;-geometry 800&#215;600 -nolisten tcp -nohttpd -localhost&#8221;</li>
</ul>
<p>and add:</p>
<ul>
<li>VNCSERVERS=&#8221;2:root&#8221;</li>
</ul>
<p>This will make the port 5902 since it will start vncserver on display 2.</p>
<p>To get Skype to startup on boot I just added skype to the path and then added skype to the session for Gnome.  Then to get SipToSis to startup on boot, I wrote the following bash script:</p>
<p>#!/bin/sh<br />
cd /root/siptosis/<br />
./SipToSis_linux &gt;&gt; /var/log/siptosis</p>
<p>This will give us the output in a log so that we can review it in case there are errors.</p>
<p>Alright, time to head to bed&#8230; Made some good progress with this.</p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=33</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Fun with Perl</title>
		<link>http://www.mikespicer.net/wp/?p=30</link>
		<comments>http://www.mikespicer.net/wp/?p=30#comments</comments>
		<pubDate>Mon, 22 Feb 2010 06:55:58 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Perl]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Perl Programming]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=30</guid>
		<description><![CDATA[Being a programmer by nature (and by degree) and I have dabbled with a lot of different computer languages. Some I fluently code in, others are nice for rapid development, and some are for someone else. I have been working on moving some Perl web applications to a new server. Typically this wouldn&#8217;t be too ]]></description>
			<content:encoded><![CDATA[<p>Being a programmer by nature (and by degree) and I have dabbled with a lot of different computer languages.  Some I fluently code in, others are nice for rapid development, and some are for someone else.  I have been working on moving some Perl web applications to a new server.  Typically this wouldn&#8217;t be too big of a deal.  You make sure you have all the modules, make sure you have the correct permissions, make sure you have Apache configured to do CGI, and then you move the files and everything should work.  In this instance, someone forgot to read &#8216;Modular Programming and Best Practices for the Perl language,&#8217; a book surely someone has written. The code I am working on does not make very much use of the CGI-BIN directory, it has Perl scattered all through out HTML files, and there are not any comments or direction.  The worst part is that the programmer chose to use Microsoft Visual C++ variable names to name Perl variables.  For example, a string in this script is $m_lpszData&#8230; This is wrong on so many levels.  The only thing I am going to point out is that Perl doesn&#8217;t explicitly use pointers, that&#8217;s all I&#8217;m going to say.  If this last piece doesn&#8217;t make sense to you, then you have had a very sheltered programming career.  </p>
<p>Now the main point of adding this entry is to have somethings in here that have been major breakthroughs for me.  The first is understanding that Internal Error 500 doesn&#8217;t mean anything at all.  In fact, it has to be the worst error message ever created.  Who would create a serious error message and then not give any detail as to why the error happened.  I understand on a production server, but offer some options to spew debugging madness.  </p>
<p>After much research it is apparent that the Internal Error doesn&#8217;t receive any data that would help with debugging.  Which is a sort of safe guard for the webserver.  As soon as the fatal error happens, it nukes the script and then spew that information.  Most of the time, the information in the logs (/var/log/apache/user/default.log if using virtualhosts or ISPCP) is not very helpful and quite vague.  </p>
<p>Despite the lack of information I figured I would use an old C trick to print out each line and variable to see where the issue was.  The problem is that with Internal Error 500, you don&#8217;t get any return at all.  So I did one better, I was able to use Carp, a debugging framework for Perl.  That with randomly place &#8216;die&#8217; statements I was able to follow the flow of code execution.  The issue is that I wasn&#8217;t able to track down the real reason for the software bug.  Finally I stumbled upon CGI::Debug.  This module rules.  It figured out a way to supersede the Apache Internal error and it gave me all the information about the running script and exactly where it died.  With this information I was able to see that I was never printing the header information out, which was never creating a proper webpage for Apache to serve up.  I added a few print statements and was able to get the expected functionality.  </p>
<p>Now as I continue on my journey of Perl debugging, I found a few other tips that are very helpful, use perl -wc [script name] to compile the script and check it.  Use perl -d [script name] to start the Perl debugger which allows you to step through code.  Lastly, you can use rm * -f if you get stuck&#8230; Just kidding, don&#8217;t do that unless you have a backup copy or know how to recover deleted files.  Hopefully I am able to wrap this project up, I am ready to be done with Perl.  In my opinion, PHP is much more flexible, intuitive, and powerful.  </p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=30</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trixbox, USB Stick, Grub, TDM card, what more could you want?</title>
		<link>http://www.mikespicer.net/wp/?p=27</link>
		<comments>http://www.mikespicer.net/wp/?p=27#comments</comments>
		<pubDate>Mon, 08 Feb 2010 06:54:12 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=27</guid>
		<description><![CDATA[I stumbled across Trixbox some time ago and thought it was an excellent replacement for Shortel and Switchvox. Trixbox is a PBX system that is built on top of Asterisks. It is much like Switchvox with its web interface and ease of use. The nice thing is that the Community Edition (CE) is completely free, ]]></description>
			<content:encoded><![CDATA[<p>I stumbled across Trixbox some time ago and thought it was an excellent replacement for Shortel and Switchvox.  Trixbox is a PBX system that is built on top of Asterisks.  It is much like Switchvox with its web interface and ease of use.  The nice thing is that the Community Edition (CE) is completely free, unsupported, but free.  For this adventure, I have been working with an Openvox TDM card, Trixbox on a USB Stick, and SATA RAID.  The reason I am using a USB stick is that when the RAID is active, you can not hook up a CDRom to the SATA controller.  Ok, this seems fine, but when you choose IDE for SATA in BIOS, it breaks the RAID and according to the controller, it must be &#8220;Rebuilt.&#8221;  I was able to get Trixbox to load onto a USB stick thanks to the people at Pendrivelinux.com and their MultibootISO application.  This application uses Grub4Dos to emulate a CD-Rom drive from an ISO file.  The only issue I had was when Trixbox installed the bootloader (Grub), it installed it to the MBR of the Flash drive.  I was able to get Trixbox to boot off of the Hard drive by using the kernel (hd0,0)/[dir to kernel] and initrd (hd0,0)/[dir to initrd].  Once I had it booted up, I was able to modify /etc/grub.conf to remove the Flash drive.  After that, I had to edit /boot/grub/menu.1st with the changed HD info.  I was able to fix the MBR by using the grub-install command on the SATA Raid device, which was in a strange place.  I think it was /dev/mapper/[name of RAID].  Once I referenced that, I was able to get Trixbox booting all by its self.  </p>
<p>Now it was time to configure the TDM card and the extensions.  I looked in the system config for the TDM card, but I didn&#8217;t see it.  For some reason, it was not recognized as Zaptel.  I am not entirely sure I understand the difference between the 2 device drivers/emulators, but all I knew is that the guide I was working from said I needed zaptel.  Openvox has Zaptel drivers on their website, but I didn&#8217;t feel like compiling from scratch.  </p>
<p>When I was on Openvox&#8217;s website, I noticed that the extra power connector on the TDM card was only needed for FXS ports.  The reason is that FXS provides voltage across and FXO receives voltage.  This helped explain why the all FXO card was being recognized as FXS.  Once I rebooted the system, the TDM card was not being recognized by Asterisk.  I tried to run the first_run scripts from Trixbox (/var/Trixbox/first_run&#8230;), but they couldn&#8217;t initialize the card.  Modprobe was failing with a FATAL message meaning it can&#8217;t find the driver.  </p>
<p>I tried to compile the driver from source, but not all of the Linux-Kernel Header files were included when I got the development files.  I then tried to uninstall Trixbox with &#8216;yum remove [trixbox package]&#8216; but that wasn&#8217;t very successful.  I tried to re-install Trixbox with Yum using the repository.  I had a bunch of issues and dependencies issues, but eventually got Trixbox installed and running again.  Now the only issue was that the system still didn&#8217;t recognize the TDM card.  Now I am going to do a fresh install from USB and then start from there.  </p>
<p>Wish me luck.</p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=27</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Awesome Commands for Linux</title>
		<link>http://www.mikespicer.net/wp/?p=20</link>
		<comments>http://www.mikespicer.net/wp/?p=20#comments</comments>
		<pubDate>Tue, 02 Feb 2010 06:11:17 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[linux commands]]></category>
		<category><![CDATA[rsync]]></category>

		<guid isPermaLink="false">http://www.mikespicer.net/wp/?p=20</guid>
		<description><![CDATA[I used to have a Wiki that I would keep track of all of the &#8220;Cool Commands&#8221; that I found or created.  But now that Wiki is down and I haven&#8217;t had the time to put it back up.  So, I need to keep track of commands so I don&#8217;t forget them.   Alright, starting off, ]]></description>
			<content:encoded><![CDATA[<p>I used to have a Wiki that I would keep track of all of the &#8220;Cool Commands&#8221; that I found or created.  But now that Wiki is down and I haven&#8217;t had the time to put it back up.  So, I need to keep track of commands so I don&#8217;t forget them.   Alright, starting off, have you ever wanted to change a few lines of text in a bunch of files?  I have.  I found a one line Perl script that will take care of it for you, and leave you a backup file for your trouble.</p>
<ul>
<li>
	perl -pi -i.bak -e &#8216;s/searchval/replaceval/&#8217; *.html</p>
</li>
</ul>
<p>This command can use regular expressions for the search value and the replace value.</p>
<p>This next command will sync your information and can be used to only keep updated copies of files.   There are lots of options too, this only scratches the surface.</p>
<ul>
<li><code>rsync -uav --progress /srcdir/ /dstdir/</code></li>
</ul>
<p>This command will will look at the srcdir and then determine if the dstdir file is newer, if it is, it won&#8217;t copy.  Very useful if you need to merge multiple copies of files, but don&#8217;t want duplicates.</p>
<p>This next command will find files for you based on all sorts of criteria:</p>
<ul>
<li><code>find . -mtime -10</code></li>
</ul>
<p>This command will look for files that are -10 days old.</p>
<p>You can combine rsync and find to search for files and then sync those files.</p>
<ul>
<li><code>find . -mtime -10 -print0 | rsync -av --progress --files-from=- -from0</code></li>
</ul>
<p>This command will first compile a list of files that meet the find criteria and then will port them to rsync.  Very helpful.</p>
<p>Ok, that is all the cool commands for today, I will probably find some more tomorrow.</p>
<p>Found more&#8230; This command will make a file of any size for you:</p>
<ul>
<li>dd if=/dev/zero of=file.out bs=1MB count=100</li>
</ul>
<p>This command will create a 100 meg dummy file.  Works great.</p>
<p>Mike</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mikespicer.net/wp/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
