<?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>ComputerAnt Blog</title>
	<atom:link href="http://blog.computerant.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.computerant.com</link>
	<description>ComputerAnt Blog</description>
	<lastBuildDate>Sat, 10 Nov 2012 03:20:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>dd quick and easy</title>
		<link>http://blog.computerant.com/2012/02/16/dd-quick-and-easy/</link>
		<comments>http://blog.computerant.com/2012/02/16/dd-quick-and-easy/#comments</comments>
		<pubDate>Thu, 16 Feb 2012 19:42:31 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=996</guid>
		<description><![CDATA[Here is a link to lots of interesting things to do with dd, but what I want to use was taken from this site. Prepare your target; if using locally attached removeable storage Unplug your usb drive or removealbe storage device and boot the system from a linux removeable media. I suggest TRK get to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/">Here is a link </a>to lots of interesting things to do with dd, but what I want to use was <a href="http://www.linuxweblog.com/dd-image">taken from this site</a>.<br />
<span id="more-996"></span></p>
<p><B><BIG><BIG>Prepare your target; if using locally attached removeable storage</B></BIG></BIG></p>
<p>Unplug your usb drive or removealbe storage device and boot the system from a linux removeable media. I suggest <a href="http://trinityhome.org/">TRK</a> get to a shell and type ls /dev/sd* make a note of what is there as your internal sata drives. Then plug in the removable storage and type the command again. What has changed, that is your removable media. For example, the first time you typed ls /dev/sd* you may have seen the output of<br />
<code>sda sda1 sda2 sdb sdb1</code><br />
And the second time, after plugging in the usb drive you would see<br />
<code>sda sda1 sda2 sdb sdb1 sdc sdc1</code> sdc1 is your first partition on that drive. That will be what you type in the mount command below.</p>
<p>Most likely it is an ntfs partitioned drive. You can verify that by fdisk -l and while fdisk -l is open, figure out what your source drive is. Most likely it is sda or hda.</p>
<p><code><br />
mkdir /mnt/backupmedia -p<br />
mount -t ntfs-3g /dev/sdwhateveritis /mnt/backupmedia<br />
</code></p>
<p>you can verify the mounted target with<br />
<code><br />
ls /mnt/backupmedia<br />
</code><br />
You should see the contents of your removable media.</p>
<p><B><BIG><BIG><B>Prepare your target; if using remote samba/windows share</B></BIG></BIG></B></p>
<p>Get the windows share servers IP address and arm yourself with login credentials with write access to the share.<br />
<code><br />
mkdir /mnt/backupmedia -p<br />
mount -t smbfs //IPAddress/ShareName /mnt/backupmedia<br />
</code><br />
you can verify the mounted target with an<br />
<code><br />
ls /mnt/backupmedia<br />
</code></p>
<p><B><BIG><BIG>To backup&#8230;</BIG></BIG></B><br />
<code><br />
dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c  > /mnt/backupmedia/myharddrive.img.gz<br />
</code></p>
<p><B><BIG><BIG>to restore&#8230;</BIG></BIG></B><br />
Note; If you have the wrong /dev/hd or /dev/sd in the folllowing command then <strong>you will destroy whatever you target</strong> with this command. Be very very very certain you get the correct /dev/hd or /dev/sd. If you don&#8217;t feel comfortable, dont&#8217; do it.<br />
<code><br />
gunzip -c /mnt/backupmedia/myharddrive.img.gz | dd of=/dev/hda conv=sync,noerror bs=64K<br />
</code><br />
Note: you can only restore to a hard drive of equal or greater size than the original hard drive. Not the img size.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2012/02/16/dd-quick-and-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webmin Firewall</title>
		<link>http://blog.computerant.com/2011/03/18/webmin-firewall/</link>
		<comments>http://blog.computerant.com/2011/03/18/webmin-firewall/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 18:37:59 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=920</guid>
		<description><![CDATA[install webmin At first rampart used webmin for its firewall. But I descided to go a different way with it. But since I had to scour the internet looking for webmin firewall/router information, and I already had the documentation for it, I descided to put the documentation here for anyone who might be needing it. [...]]]></description>
			<content:encoded><![CDATA[<p><strong>install webmin</strong><br />
At first rampart used webmin for its firewall. But I descided to go a different way with it. But since I had to scour the internet looking for webmin firewall/router information, and I already had the documentation for it, I descided to put the documentation here for anyone who might be needing it.<br />
<span id="more-920"></span></p>
<p>There are several tutorials out there for installation of webmin on ubuntu. In a nut shell&#8230;<br />
<code><small><br />
sudo apt-get install –y libnet-ssleay-perl libauthen-pam-perl libio-pty-perl perl5 libnet-ssleay-perl<br />
cd /usr/local/src<br />
sudo wget http://prdownloads.sourceforge.net/webadmin/webmin_1.530_all.deb<br />
sudo dpkg -i webmin_1.530_all.deb<br />
</code></small></p>
<p><strong>Routing</strong></p>
<p>Webmin will set up our routing for us. Goto Webmin ->  Network -> Network Interfaces. Routing and Gateways Icon.</p>
<p>Default Router tick &#8220;None (or from DHCP)&#8221; more than likely your ISP is dhcp. Be certain eth0 is the interface specified.</p>
<p><a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_defroute.jpg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_defroute.jpg" alt="default route from dhcp" title="rampart_defroute" width="326" height="31" class="aligncenter size-full wp-image-810" /></a></p>
<p>Webmin -> Network -> Network Interfaces. Routing and Gateways Icon. Active configuration tab.<br />
<a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_routing.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_routing.jpeg" alt="rampart routing" title="rampart_routing" width="682" height="465" class="aligncenter size-full wp-image-812" /></a><br />
Verify that interfaces entered above are present and that the default route looks right and is assigned to the correct interface. Notice that the destination networks are associated with the correct interface. And that there is only one default gateway. I suppose one could have more than one default gateway, but we aren&#8217;t covering that in this tutorial.</p>
<p>Test: Perform a connectivity test by plugging a device into an interface (with a mini switch) and assigning it a static IP in that range. (because we haven’t configured dhcp yet) In the example obove, using eth2 I plugged in a device and gave it the IP of 192.168.3.19 and the gateway 192.168.3.1. Then ping the gateway. Try pinging other IPs. Because we haven’t configured our firewall, we are only going to sweat if our gateway ping fails.</p>
<p>Webmin modifies the /etc/network/interfaces file. But it may not set it up exactly like you’ll need. My interfaces file was missing a valid gateway entry. That is why we just edited the interfaces file manually. Besides, it is quicker to copy and past then it is to point and click for each interface.</p>
<p><strong>Webmin Linux Firewall</strong></p>
<p>Webmin -> Networking -> Linux Firewall and initialize the firewall. Go ahead and choose allow/accept as the the default setting. I didn&#8217;t get any screen shots or notes on this step. It is pretty strait forward. But, before you start configuring your, get on your console and type<br />
<code><small>sudo cp /etc/iptables.up.rules /etc/iptables.up.rules.original</code></small></p>
<p>and should you screw something up you can go back to a clean slate by typing<br />
<code><small><br />
sudo mv /etc/iptables.up.rules.original /etc/iptables.up.rules<br />
sudo shutdown now –r<br />
</code></small></p>
<p>Back into webmin, setting up the rules is kind of figure it out as you go along. Click the Add Rule button and poke around. Just don’t hit thie Apply Configuration Button until you get it set the way you want it. There are lots of good configuration tutorials on the internet. But don&#8217;t sweat it, I&#8217;m going to cover what you need to get this router firewall filter with WAP up and running.</p>
<p>Hint: The Iptables read from top to bottom. So each packet that comes in gets compared to the first rule, then the second and so on until it gets accepted, or gets dropped. And the last line should always be a drop all. So a desired packet or connection needs to meet an accept rule someplace above a drop rule.</p>
<p>Hint: If you get a set up that you like, and want to save your work and keep editing you can go back to your console and type<br />
<code><small>sudo cp /etc/iptables.up.rules  /etc/iptables.up.rules.bk.X </code></small><br />
where X is the version number. That way you can easily restore to a particular version with a<br />
<code><small><br />
sudo mv  /etc/iptables.up.rules.X /etc/iptables.up.rules &#038;&#038; sudo shutdown now –r<br />
</code></small></p>
<p><strong>Webmin Linux Firewall – INPUT</strong></p>
<p>Notice it says “addressed to this host” this is connections attempted to the machine we are currently configuring. Not data that is being routed or passed through or destined for another system. If the first 2 lines are missing then you just got locked out of your box using webmin and ssh. And then you’ll be sitting at the console and doing the mv command as explained above. The last line is the security line that says basically, if no other conditions are met, then drop this packet. Also set the &#8220;default action&#8221; to drop by adjusting the drop down box and then clicking the button. I don’t know why there are 2 methods of assigning a default action, but lets cover all bases and do both.</p>
<p><a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallINPUT.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallINPUT.jpeg" alt="rampart_FirewallINPUT" title="rampart_FirewallINPUT" width="576" height="210" class="aligncenter size-full wp-image-815" /></a></p>
<p><strong>Webmin Linux Firewall – FORWARD</strong></p>
<p>This is the section that allows the packets to move through the host. (this may not be needed with masq section. Need to test)<br />
<a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallFORWARD.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallFORWARD.jpeg" alt="rampart_FirewallFORWARD" title="rampart_FirewallFORWARD" width="632" height="230" class="aligncenter size-full wp-image-817" /></a><br />
Again, configure the set default action to Drop</p>
<p><strong>Webmin Linux  Firewall – Outgoing</strong></p>
<p>There is nothing to configure here. It is probably ok to leave this with no rules and the default action set to accept. There is no reason to fear this server sending unwanted packets out.</p>
<p><strong>Webmin Linux Firewall – Routing</strong></p>
<p>In order for the routing (configured in webmin&#8217;s interfaces and routing sections) to work we need to tell the firewall to masquerade packets. Go to Webmin → Linux Firewall. Select Network Address Translation from the drop down list and if needed click &#8220;Show IPTable&#8221;. You only need to modify the “Packets After Rouging (POSTROUTING)” section. I want all segments to be able to route to all other segments. If I wanted to make eth3 invisible to other eths then that could be done, but that isn&#8217;t in the scope of this tutorial.</p>
<p><a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallPOSTROUTING.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallPOSTROUTING.jpeg" alt="rampart_FirewallPOSTROUTING" title="rampart_FirewallPOSTROUTING" width="535" height="168" class="aligncenter size-full wp-image-820" /></a></p>
<p><strong>Filtering &#8211; OpenDNS</strong></p>
<p>We want to Force all internal users to use OpenDNS server, even if they have admin on their computers and change their DNS settings to something else. The firewall can redirect the DNS requests and make them use our OpenDNS account for DNS. And that forces them to use our OpenDNS filtering.</p>
<p>It has come to my attention that webmin does not give much details in the Action setting. Usually this isn&#8217;t a problem So far the Action has just been doing drop or accept or masq. But here we are actually doing something complex with the action, and webmin isn&#8217;t showing is what it is. It just says Destination NAT. So When that happens I&#8217;ll edit the image to include the information from the &#8220;Chain Actions Details&#8221; pane. And I will try to highlight those changes in a red box on the screenshot. It makes for a butchered looking picture, but it will help clearify what is going on.<a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallPREROUTIN_DNS1.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallPREROUTIN_DNS1.jpeg" alt="rampart_FirewallPREROUTIN_DNS" title="rampart_FirewallPREROUTIN_DNS" width="747" height="190" class="aligncenter size-full wp-image-859" /></a><br />
Be sure that these rules are above any drop rules that may break it.</p>
<p>Note: OpenDNS is not 100% fool proof. It won’t block anyone from using an IP address to access a blocked site. But this is a great start for filtering.</p>
<p><strong>Filtering &#8211; Squid</strong></p>
<p>Squid can be installed from webmin by clicking on the un-used modules and clicking &#8220;squid proxy server&#8221;. This installs version 2.7 stable. And squid is currently at version 3.x. Why? the package name changed. the package squid is anything under 3. And squid3 is well, squid3. So we are going to install squid3 from the ubuntu repos, and then configure webmin to use squid3.</p>
<p>If you haven&#8217;t already installed the module, you may need to do so. Which will install squid 2.7. After installing the module we want to remove any instances squid.<br />
<code><small><br />
sudo apt-get purge -y squid &#038;&#038; sudo apt-get autoremove -y<br />
</code></small><br />
This is going to break our squid webmin module. But the webmin module will still be waiting and tell you &#8220;The Squid executable squid does not exist. If you have Squid installed, adjust your module configuration to use the correct path.&#8221; And the words &#8220;module configuration&#8221; are a hyper link. Click on that. You should have installed squid3 above. If not go back to the command line and <code><small>sudo apt-get install squid3</code></small> then back to the webmin module and make it look like this.</p>
<p>What we are mostly concerned with is the section System Configuration. Make it look like this.<br />
<a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_Squid3MODULE.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_Squid3MODULE.jpeg" alt="rampart_Squid3MODULE" title="rampart_Squid3MODULE" width="703" height="342" class="aligncenter size-full wp-image-827" /></a></p>
<p>If there is another way to get to module configuration, then you can do that too. Be sure to remove squid and keep squid3</p>
<p>The squid configuration can be done from webmin. But since we have a simple configuration change, it is easiest to copy and paste it form command line.</p>
<p><code><small><br />
sudo mv /etc/squid3/squid.conf /etc/squid3/squid.conf.original<br />
sudo  nano /etc/squid3/squid.conf<br />
</code></small><br />
and paste in the following<br />
<code><small><br />
http_port 3128 transparent<br />
acl our_networks src 10.0.0.0/8<br />
acl localnet src 127.0.0.1/255.255.255.255<br />
acl malware_block_list url_regex -i "/etc/squid3/malware_block_list.txt"<br />
acl porn_block_list url_regex -i "/etc/squid3/blacklists/porn/urls"<br />
http_access deny malware_block_list<br />
http_access deny porn_block_list<br />
http_access allow our_networks<br />
http_access allow localnet<br />
cache_dir ufs /var/spool/squid3 4000 16 256<br />
</code></small><br />
Note: The first number in cache_dir (4000 aka 4Gigs) in this example is the maximum size of the web cache. Depending on your hard drive size, and  how much caching you want to do you should edit this setting.</p>
<p>Note: you can employ more lists than those specified here. The Blacklists (to be downloaded, below) has many more lists. You can use a list by adding an appropriate acl and http_access deny for each list you want to use. For now, lets stick to the ones I&#8217;ve suggested. I&#8217;m only using these 2 lists because I want to protect children and the computers, but I don&#8217;t want to disrupt other users surfing.</p>
<p>We are using squid for added filtering. We want to filter porn, spam and malware. We will use the lists of bad sites provided by the free services <a href="http://malware.hiperlinks.com.br/">malware portal</a>, and <a href="http://www.squidguard.org/blacklists.html">Squid Guard &#038; MESD</a>. Squid will check these lists before allowing the connections.</p>
<p><code><small><br />
sudo nano /etc/squid3/getlists.sc<br />
</code></small><br />
paste in the following<br />
<code><small><br />
#!/bin/sh<br />
wget -O "http://malware.hiperlinks.com.br/cgi/submit?action=list_squid" > /etc/squid3/malware_block_list.txt<br />
rm -R blacklists<br />
wget http://squidguard.mesd.k12.or.us/blacklists.tgz<br />
tar -xf blacklists.tgz<br />
rm blacklists.tgz<br />
squid -k reconfigure<br />
</code></small></p>
<p>Warning: possible word wrapping on line 2. Line 2 should end with txt.</p>
<p><code><small><br />
sudo chmod +x /etc/squid3/getlists.sc<br />
sudo crontab -e<br />
</code></small><br />
and add the line<br />
<code><small><br />
1 1 * * * /etc/squid3/getlists.sc<br />
</code></small><br />
This will download the newly updated lists every day.</p>
<p>Now we have a functional squid3 proxy server running performing list based filtering. It isn&#8217;t doing any filtering yet. In fact, it isn&#8217;t even receiving any traffic until we configure our firewall to direct traffic to it. Quick, back to the Webmin firewall!</p>
<p>At this point you maybe asking &#8220;Why do I have to keep going back to the webmin firewall?&#8221; Well, I broke this tutorial down into &#8216;modules&#8217; so that it maybe easier to implement a feature at a time, or not use some features at all. And still have a sturdy router without a bunch of open holes.</p>
<p>Help decoding the picture: The section highlighted in green is the rules we created earliy for openDNS port redirection and has nothing to do with our squid. The sections highlighted in red are the Actions that webmin isn&#8217;t giving us much details on. As explained above. The pertinent information from the &#8220;Chain and Action Details&#8221; pain has been copied and pasted in the red boxes under the appropriate rule.<br />
<a href="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallPREROUTIN_SQUID.jpeg"><img src="http://blog.computerant.com/wp-content/uploads/2011/02/rampart_FirewallPREROUTIN_SQUID.jpeg" alt="rampart_FirewallPREROUTIN_SQUID" title="rampart_FirewallPREROUTIN_SQUID" width="830" height="375" class="aligncenter size-full wp-image-864" /></a>After this, get behind the squid proxy with a computer and access the web to be certain it loads. Then go back to your webmin and stop squid (it takes awhile, this is normal) and then try to reload the same site. It should time out because squid is dead. Now go back to webmin and start squid again and reload the page. It should load. You just proved that you are going through the proxy and are at its mercy.</p>
<p>Now try to goto a blocked porn or malware site. Because of your high moral quality you may not know what sites to try. You could peak in the supplied files for a list of sites to try. Squid should Stop you you.</p>
<p><a href="http://www.niemueller.de/webmin/modules/nettools/">Here is an nmap webmin scanner</a>. It doesn&#8217;t do the network scan, but can scan a single host with verbose output.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2011/03/18/webmin-firewall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rampart Router Firewall Proxy WAP</title>
		<link>http://blog.computerant.com/2011/03/02/rampart-router-firewall-proxy-wap/</link>
		<comments>http://blog.computerant.com/2011/03/02/rampart-router-firewall-proxy-wap/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 02:53:44 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Computer Stuff]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=804</guid>
		<description><![CDATA[My Linksys WRT54G is on its last leg. I put DDWRT on it which was a fun project and opened up a lot of possibilities. But lately, it keeps going stupid and requires a cold reboot. On reboot it forgets the last changes. It wont hold many nat entries, the iptables isn&#8217;t as powerful, and [...]]]></description>
			<content:encoded><![CDATA[<p><span id="more-804"></span><br />
My Linksys WRT54G is on its last leg. I put DDWRT on it which was a fun project and opened up a lot of possibilities. But lately, it keeps going stupid and requires a cold reboot. On reboot it forgets the last changes. It wont hold many nat entries, the iptables isn&#8217;t as powerful, and well.. maybe I&#8217;ve out grown it! I think it just doesn&#8217;t have the physical power to do what I want it to do. Ebay has this deal on a Dell server. The hardware was perfect for a network router. And I was looking for a fun project. I&#8217;m interested in products like Deep9s, Untangle and Zentya that are considered Unified Threat Management systems. But I want something more flexible and something that I can be more in control of. And I&#8217;ll either need to demote my WRT54G to just an access point, or replace it completely. In that event I&#8217;d need something that can take a wireless card.</p>
<p><strong>System Specs</strong></p>
<p>My System is probably a bit over kill. What you&#8217;ll need is a system that meets ubuntu server&#8217;s specs. And if you are going to run squid with some of the advanced filtering techniques, you will probably want at least 2 Gigs of RAM. You&#8217;ll need at least 2 NICs, one can be a wifi, but to make this project the most fun you&#8217;ll want at least 2 eth and one wlan. You only need a 100Mb eth card for your uplink to your ISP, but I&#8217;d put a 1Gb eth on the internal network interface. My Dell 1750 Server came with 2 eth on board and 2 eth on a PCI and I had a wlan G card from a previous project. My overkill stats include a Xeon Core 2 3Ghz with 4Gigs of RAM and a RAID 1 SCSI with 4Gigs of RAM. I&#8217;m running 32bit Ubuntu so I&#8217;m only seeing 3.69 Gigs.</p>
<p><strong>Warned</strong><br />
This project isn&#8217;t for the linux newb or the networking newb. There will be several assumptions made about the skill level of the practitioner of this project.</p>
<p><strong>Install the OS</strong><br />
There are enough tutorials out there to install the OS. Google one up if you need to. We don&#8217;t need the GUI or X so just install ubuntu server. I used 10.4 because it is LTS. When done installing go ahead and update.<br />
<code><br />
sudo apt-get update &amp;&amp; sudo apt-get upgrade –y &amp;&amp; sudo apt-get autoremove –y<br />
</code><br />
Here are a few of the handy tools we are going to need.<br />
<code><br />
sudo apt-get install –y netperf nmap ntop apt-show-versions<br />
</code></p>
<p><strong>Interfaces</strong></p>
<p>The first thing you need to do is set up your interfaces. Now I&#8217;ve got 4 eths and a wlan. You may not have as many eths so modify the following interfaces file as you need for your router. Remember, we are assuming eth0 is the interface connected to the internet or wild network. I connect eth0 to the ISP cable modem and therefore I need eth0 to be dhcp. You probably will too.</p>
<p>Also, I&#8217;m setting up each interface as its own subnet. This is a router, not a bridge. If you want all of your interfaces on the same subnet you will need to set up a bridge. And that is not covered in this tutorial.</p>
<p>Warning: Always, make a backup of the original file. If anywhere anytime I or anyone else suggests you edit a file that already exists quickly back it up.<br />
<code><br />
sudo mv /etc/network/interfaces /etc/network/interfaces.original<br />
</code><br />
then<br />
<code><br />
sudo nano /etc/network/interfaces</code><br />
and paste in the following.<br />
<code><br />
auto lo<br />
iface lo inet loopback</code></p>
<p>#External Interface<br />
auto eth0<br />
iface eth0 inet dhcp</p>
<p>auto eth1<br />
iface eth1 inet static<br />
address 10.1.1.1<br />
netmask 255.255.255.0<br />
network 10.1.1.0</p>
<p>auto eth2<br />
iface eth2 inet static<br />
address 10.2.1.1<br />
netmask 255.255.255.0<br />
network 10.2.1.0</p>
<p>auto eth3<br />
iface eth3 inet static<br />
address 10.3.1.1<br />
netmask 255.255.255.0<br />
network 10.3.1.0</p>
<p>auto wlan0<br />
iface wlan0 inet static<br />
address 10.4.1.1<br />
netmask 255.255.255.0<br />
network 10.4.1.0</p>
<p><strong>Routing</strong></p>
<p>To make this computer become a linux router it a route we need to edit a few files.</p>
<p>Argument: I suppose one could argue that this is not a true router but is instead a multi-interface gateway device. A true router could share a routing table. And this device does not. I suppose it could, but since I don&#8217;t want it to, it isn&#8217;t.<br />
<code><br />
sudo cp /etc/sysctl.conf /etc/sysctl.conf.bak &amp;&amp; sudo nano /etc/sysctl.conf<br />
</code><br />
to enable router mode you must remove the # before the line</p>
<p>net.ipv4.ip_forward=1<br />
echo 1 &gt; /proc/sys/net/ipv4/ip_forward<br />
cat /proc/sys/net/ipv4/ip_forward</p>
<p>and be sure it says 1 instead of 0. I&#8217;ve seen it not take for some reason. If not just nano it.<br />
And then reboot<br />
<code><br />
sudo shutdown now –r<br />
</code></p>
<p>When the system comes back up it will have the potential to route packets. It wont. Not until you configure the firewall via iptables. Particularly the masquerade section.</p>
<p><strong>iptables Firewall </strong></p>
<p>I determined that <a href="http://blog.computerant.com/2011/03/18/webmin-firewall/#more-920">webmin </a>firewall is easy to configure and gives a nice graphic representation of the firewall, but it wasn&#8217;t as flexible and quick as I wanted. I wanted to run a script and link other non firewall things to that script. As a result I trashed my webmin firewall and implamented this script. But, I saved my documentation and made it its own blog entry. If you want to use webmin and make a router firewall with it instead of using an iptables script you can check it out.</p>
<p>WARNING: there maybe some nasty word wrapping in this script due to this blog layout.<br />
<code><br />
sudo nano /bin/iptables.sc<br />
</code><br />
and paste in the following<br />
<code><br />
#!/bin/bash<br />
######################<br />
#<br />
#  Settings up variables for the script<br />
#<br />
######################<br />
#SETS SERVER IPS TO VARAIBLES AND DETERMINES DHCP GATEWAY<br />
echo "setting up variables"<br />
#_GATEWAY=$(nslookup nedimare.game-host.org | grep 97 | cut -d : -f 2 | sed -e 's/^[ \t]*//')<br />
_GATEWAY=$(ifconfig eth0 | grep -v inet6 | grep inet | cut -d : -f 2 | sed 's/Bcast//')<br />
echo "The gateway inteface IP is $_GATEWAY"<br />
_FTP=10.1.1.5<br />
_HTTP=10.1.1.6<br />
_RUNUO=10.1.1.7<br />
_CYGNENOS=10.1.1.3<br />
_Win2k8Server=10.1.1.8</code></p>
<p>########################<br />
#<br />
#   Flushing and setting defaults<br />
#   accepts for some<br />
#<br />
######################<br />
echo &#8220;Flushing and setting defaults&#8221;<br />
echo &#8221;  flush nat&#8221;<br />
iptables -t nat -F<br />
echo &#8221;  flush input&#8221;<br />
iptables -F INPUT<br />
echo &#8221;  flush nat prerouting&#8221;<br />
iptables -t nat -F PREROUTING<br />
echo &#8221;  flush nat postrouting&#8221;<br />
iptables -t nat -F POSTROUTING<br />
echo &#8221;  flush output&#8221;<br />
iptables -F OUTPUT<br />
iptables -P OUTPUT ACCEPT<br />
echo &#8221;  flush forward&#8221;<br />
iptables -F FORWARD</p>
<p>##########################<br />
#<br />
# ICMP<br />
#<br />
##########################<br />
iptables -A OUTPUT -p icmp &#8211;icmp-type echo-request -j ACCEPT<br />
iptables -A INPUT  -p icmp &#8211;icmp-type echo-reply   -j ACCEPT<br />
iptables -A INPUT -p icmp &#8211;icmp-type echo-request -m limit &#8211;limit 1/s -i eth0 -j ACCEPT<br />
# Work around for stupid websites blocking ICMP (just for normal surfing)<br />
# iptables -t mangle -A FORWARD -p tcp &#8211;tcp-flags SYN,RST SYN -j TCPMSS &#8211;clamp-mss-to-pmtu<br />
# Allow ICMP for frag notification<br />
# &#8211;icmp-type 8 = ping<br />
# iptables -t filter -A INPUT -p icmp -s 0/0 -d $ip_eth2 -m state &#8211;state NEW -j ACCEPT</p>
<p>################<br />
#<br />
# Masqurading<br />
#  allows routing to work<br />
#<br />
#################<br />
echo &#8220;setting up masqurading&#8221;<br />
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</p>
<p>################<br />
#<br />
# INPUT<br />
#  connections to this firewall/router<br />
###############<br />
echo &#8220;setting up INPUT&#8221;<br />
iptables -I INPUT 1 -i lo -j ACCEPT<br />
iptables -A INPUT -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT<br />
iptables -A INPUT -p tcp &#8211;dport ssh -j ACCEPT<br />
iptables -A INPUT -p tcp &#8211;dport 10000 -j ACCEPT</p>
<p>################<br />
#<br />
# OUTPUT<br />
#  connections from this firewall/router<br />
################<br />
echo &#8220;setting up OUTPUT&#8221;<br />
iptables -A OUTPUT -j ACCEPT</p>
<p>###################<br />
#<br />
# FORWARD<br />
#  connections going through this firewall/router<br />
##################<br />
echo &#8220;setting up FORWARD&#8221;<br />
iptables -A FORWARD -m state &#8211;state ESTABLISHED,RELATED -j ACCEPT</p>
<p>##################<br />
#<br />
# Webmin DNATs<br />
#  allow various servers to connect from the internet<br />
##################<br />
echo &#8220;setting up Webmin DNATs&#8221;<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 10001 -j DNAT &#8211;to 10.1.1.5:10000<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 10003 -j DNAT &#8211;to 10.1.1.3:10000<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 10006 -j DNAT &#8211;to 10.1.1.6:10000<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 10007 -j DNAT &#8211;to 10.1.1.7:10000</p>
<p>##################<br />
#<br />
# RUNUO DNAT<br />
#<br />
#################<br />
echo &#8220;setting up RUNUO DNAT&#8221;<br />
iptables -t nat -A PREROUTING -p tcp &#8211;dport 2593 -j DNAT &#8211;to $_RUNUO:2593<br />
iptables -t nat -A POSTROUTING -s $_RUNUO -p tcp &#8211;sport 2593 -j SNAT &#8211;to-source $_GATEWAY<br />
iptables -A INPUT -d $_RUNUO -p tcp &#8211;dport 2593 -j ACCEPT<br />
iptables -A OUTPUT -s $_RUNUO -p tcp &#8211;dport 2593 -j ACCEPT</p>
<p>##########################<br />
#<br />
# RDP DNAT<br />
#  untested<br />
#########################<br />
echo &#8220;setting up RDP DNAT&#8221;<br />
iptables -A FORWARD -p tcp &#8211;dport 3389 -m state &#8211;state NEW -j ACCEPT<br />
iptables -t nat -A PREROUTING -p tcp &#8211;dport 3389 -j DNAT &#8211;to $_Win2k8Server:3389<br />
iptables -A FORWARD -i eth0 -p tcp &#8211;destination $_Win2k8Server -m multiport &#8211;dports 3389 -j ACCEPT</p>
<p>####################<br />
#<br />
# FTP DNAT<br />
#<br />
####################<br />
# THIS SECTION IS STILL NOT FUNCTIONING CORRECTLY<br />
echo setting up FTP DNAT<br />
modprobe ip_conntrack_ftp<br />
modprobe ip_nat_ftp<br />
PREROUTING -p tcp &#8211;dport 20 -j DNAT &#8211;to $_FTP:20<br />
PREROUTING -p tcp &#8211;dport 21 -j DNAT &#8211;to $_FTP:21<br />
iptables -t nat -A PREROUTING -p tcp -i eth0 &#8211;dport 21 -j DNAT &#8211;to $_FTP:21<br />
iptables -t nat -A PREROUTING -p tcp -i eth0 &#8211;dport 20 -j DNAT &#8211;to $_FTP:20<br />
iptables -A FORWARD -i eth0 -p tcp -d $_FTP -m multiport &#8211;dports 20,21 -j ACCEPT<br />
iptables -t nat -A PREROUTING -p tcp &#8211;dport 20 -j DNAT &#8211;to $_FTP:20<br />
iptables -t nat -A POSTROUTING -s $_FTP -p tcp &#8211;sport 20 -j SNAT &#8211;to-source $_GATEWAY<br />
iptables -A INPUT -d $_FTP -p tcp &#8211;dport 20 -j ACCEPT<br />
iptables -A OUTPUT -s $_FTP -p tcp &#8211;dport 20 -j ACCEPT</p>
<p>######################<br />
#<br />
# Webserver DNAT<br />
#<br />
#######################<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 80 -j DNAT &#8211;to $_HTTP:80<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 443 -j DNAT &#8211;to $_HTTP:443<br />
iptables -t nat -A PREROUTING -p tcp -i eth0  &#8211;dport 10022 -j DNAT &#8211;to $_HTTP:22</p>
<p>#####################<br />
#<br />
# OpenDNS DNAT OUTGOING<br />
#<br />
####################<br />
# note 10.1.1.3 is the IP of my internal DNS server<br />
echo &#8220;setting up OpenDNS prerouting (the trap)&#8221;<br />
iptables -t nat -A PREROUTING ! -s 10.1.1.3 -p udp &#8211;dport 53 -j DNAT &#8211;to 208.67.222.222:53<br />
iptables -t nat -A PREROUTING ! -s 10.1.1.3 -p tcp &#8211;dport 53 -j DNAT &#8211;to 208.67.222.222:53</p>
<p>###################<br />
#<br />
# Default settings end of chain and  rejects<br />
#<br />
## tighten this up later.<br />
echo &#8220;default rejects, end of chains&#8221;<br />
iptables -P INPUT REJECT<br />
iptables -P OUTPUT ACCEPT<br />
iptables -P FORWARD REJECT</p>
<p>Note: this is still a work in progress and may need tightening a bit more</p>
<p>Now that we have this script we can add modules like the ftp modules that load on execution, call this script from other scripts like the malware script below, call it from cron, and we can put a link into the /etc/network/if-pre-up.d and if-up.d folders so when the interfaces comes up the iptables gets reloaded.</p>
<p><code><br />
sudo ln -s /bin/iptables.sc ./if-pre-up.d/iptables.sc<br />
sudo ln -s /bin/iptables.sc ./if-up.d/iptables.sc<br />
</code></p>
<p><strong>Wireless Access Point – Can you host?</strong></p>
<p>Get the tools<br />
<code>sudo apt-get install -y wpasupplicant wireless-tools iw</code></p>
<p>Step 1 test your card:<br />
Be sure your wireless device is up and functional. One test is to do a <code>iwlist scanning wlan0</code> and verify that you can see other wireless networks. Setting up a WAP with a wifi card or other device that may or may not function could be a waste of time.</p>
<p>Step 2 Verify that your card supports being an access point<br />
First try<br />
<code><br />
sudo iw<br />
</code>and verify that AP is somewhere in the Supported Interface modes. If so, then just jump down to the section Wireless Access Point – hostapd, below. If not then  you can try<br />
<code><br />
sudo iwconfig mode master<br />
</code><br />
If you got no errors in &#8220;mode master&#8221; then you need to do something like&#8230;<br />
<code><br />
sudo nano /etc/network/interfaces<br />
</code><br />
Find the wireless interface (often wlan0) and add these lines<br />
<code><br />
wireless-mode master<br />
wireless-essid YOURESSIDNAME<br />
</code><br />
But I don’t have that type of card, so I can&#8217;t help with that, You can still try the next section about hostapd. It may still work. Otherwise, you are going to have to get another card, or research the wireless-mode master method.</p>
<p><strong>Wireless Access Point – hostapd (basic unsecured setup</strong></p>
<p>There is no webmin module for hostapd. Maybe someone should write one. That would be cool. For now, to the command line.</p>
<p><code><br />
sudo apt-get install hostapd<br />
cd /etc/hostapd<br />
sudo mv hostapd.conf hostapd.conf.original<br />
</code><br />
We are going to set up an unsecure wireless network and then lock it down. It is hard to troubleshoot security and connectivity. Lets first verify that we can connect. Then we will work on security.<br />
<code><br />
sudo nano hostapd.conf<br />
</code><br />
Paste in the following. Remember to change wlan0 to your wireless device that is displayed in an ifconfig. Also, the driver= section may not be the same as mine you may need to do some googling with &#8220;hostapd driver {your wifi card type}&#8221; and see what driver is suggest you use. I tried nl80211 on the first try and got lucky. Actually, my understanding is that nl80211 is the most common driver, so give it a try too.<br />
<code><br />
interface=wlan0<br />
driver=nl80211<br />
ssid=test<br />
channel=1<br />
</code><br />
Exit saving and then<br />
<code><br />
sudo hostapd ./hostapd.conf &amp;<br />
</code><br />
If there are no errors. Then we are golden. Go to another device and scan for a the network and see if you can see it.</p>
<p>Init.d fail: I noticed that starting this program as service by doing a “sudo /etc/init.d/hostapd restart” failed to load the correct conf file. Although the output was implying that the service started just fine. Using “sudo hostapd ./hostapd.conf &amp;” brought up the service with the correct conf file. You know what that means? The init.d script borked. I have to edit the init.d script.<br />
First backup the original<br />
<code><br />
cd /etc/init.d<br />
sudo mv hostapd hostapd.original<br />
sudo chmod –x hostapd.original<br />
</code><br />
Then <code><br />
sudo nano hostapd<br />
</code><br />
and paste in the following.<br />
<code><br />
#!/bin/sh<br />
### BEGIN INIT INFO<br />
# Provides:             hostapd<br />
# Required-Start:       $remote_fs<br />
# Required-Stop:        $remote_fs<br />
# Should-Start:         $network<br />
# Should-Stop:<br />
# Default-Start:        2 3 4 5<br />
# Default-Stop:         0 1 6<br />
# Short-Description:    Advanced IEEE 802.11 management daemon<br />
# Description:          Userspace IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP<br />
#                       Authenticator<br />
### END INIT INFO<br />
PATH=/sbin:/bin:/usr/sbin:/usr/bin<br />
case "$1" in<br />
start)<br />
echo "attempting to start hostapd using /etc/hostapd/hostapd.conf"<br />
hostapd /etc/hostapd/hostapd.conf &amp;<br />
echo "done attempting. Did we fail? I can't tell because I'm a very simple script."<br />
ps -A | grep hostapd<br />
;;<br />
stop)<br />
echo "i'm going to attempt to kill hostpad using killall"<br />
killall hostapd &amp;<br />
echo "done attempting. Did we fail? I can't tell because I'm a very simple script. If I did fail you can try again as there mayve multiple instances."<br />
ps -A | grep hostapd<br />
;;<br />
reload)<br />
echo "I'm too simple of a script to attampt a reload, do restart instead."<br />
;;<br />
restart|force-reload)<br />
$0 stop<br />
sleep 8<br />
$0 start<br />
;;<br />
*)<br />
N=/etc/init.d/$NAME<br />
echo "Usage: $N {start|stop|restart|force-reload}" &gt;&amp;2<br />
exit 1<br />
;;<br />
esac<br />
exit 0</code><br />
(this blog post screws up the tabbing format from the original. This looks sloppy, but works.)<br />
<code><br />
sudo chmod +x hostapd<br />
</code></code></p>
<p>Now /etc/init.d/hostapd start | stop etc works and it loads up on reboot. I realize this is a hack. My init.d script skills aren't the best. If anyone has a better solution feel free to reply to this blog and I'll put it in here.</p>
<p>When hostapd is running, do an ifconfig. You should notice a new device named mon.wlan0. Got a client computer and scan for new networks. You should see, and be able to connect to it. If not, first suspect the driver= section.</p>
<p><strong>Wireless Access Point – hostapd WPA2</strong></p>
<p>Hint: Before continuing, connect to the WAP while unsecured to rule out security as a possible cause for failure to connect.</p>
<p>again do a<br />
<code><br />
sudo mv /etc/hostapd/hostapd.conf /etc/hostapd/hostapd.conf_simple<br />
sudo nano /etc/hostapd/hostapd.conf<br />
</code><br />
and paste in the following.<br />
<code><br />
interface=wlan0<br />
driver=nl80211<br />
ssid=rampart<br />
hw_mode=g<br />
channel=11<br />
wpa=2<br />
wpa_passphrase=yourpasswordinplaintext<br />
wpa_key_mgmt=WPA-PSK<br />
wpa_pairwise=CCMP<br />
wpa_group_rekey=600<br />
</code><br />
restart the service and try to connect. If you fail, but you succeeded when you had no security, then one of your devices may not support wpa2 (AP or wifi card) or the pairwise may need changing. You will need to research and attempt another security type.</p>
<p><strong>DynDNS.com</strong></p>
<p>If, like me, you plan to use DynDNS and OpenDNS, then you need an account at dnsomatic.com. This basically links your 2 services so you update your IP to dnsomatic and it updates the other 2. Yes, you must have 3 internet accounts to accomplish this. I used the same user name and the same secure password for each. But this password I use for these accounts only.</p>
<p>You must install ddclient and it will update dnsomatic. Most of the installation instructions can be located <a href="https://help.ubuntu.com/community/DynamicDNS">here </a><br />
<code><br />
sudo apt-get install ddclient<br />
</code><br />
The installer prompts you for the service info like user name and password and the hosts you want to update etc. It probably doesn't matter what you enter because we'll be editing the conf file on our own after it installs. The conf file is located at /etc/ddclient.conf</p>
<p>Below is a sample ddcient.conf file that I found <a href="http://www.dnsomatic.com/wiki/ddclient">here</a>.<br />
<code><br />
##<br />
## DNS-O-Matic account-configuration<br />
##<br />
use=web, web=myip.dnsomatic.com<br />
server=updates.dnsomatic.com<br />
protocol=dyndns2<br />
login=dnsomatic_username<br />
password=dnsomatic_password<br />
all.dnsomatic.com<br />
</code></p>
<p>Our iptables script above forces all outgoing dns queries to opendns. So now would be a good time to log into opendns and set up your filtering rules. Anyone who accesses the internet from inside your network will now be filtered to your opendns account. Even if they set their DNS settings to something else.</p>
<p><strong>IP Tables and Malware</strong></p>
<p>At first I was using swquid for filtering as described on the Webmin Firewall page. After I got it all to work I realized that I wanted to do something different. I descided to dump squid...<br />
<code><br />
sudo apt-get remove squid3 -y<br />
</code><br />
... and just use iptables to filter these malware sites, and allow opendns to filter the porn. Why? Well, for one it woudld be faster and use less resources. And, it sounded like a fun challenge. If you wanted to use dansguardian or squidguard or do some actual proxying then you may want to leave squid in place.<br />
<code><br />
sudo nano /bin/malware.sc<br />
</code><br />
and paste in the following<br />
<code><br />
#!/bin/bash<br />
cd /tmp<br />
# Get the malware site list, exiting if it is not downloadable.<br />
wget "http://malware.hiperlinks.com.br/cgi/submit?action=list_hosts_win_127001" -O malware.tmp || exit 0</code></p>
<p># creating the scripts from the malware site list.<br />
cat ./malware.tmp | sed '/^$/d' | sed '/#/d' &gt; malware2.tmp<br />
echo "#!/bin/bash" &gt; mal_INPUT.sc<br />
echo "#!/bin/bash" &gt; mal_OUTPUT.sc</p>
<p>cat malware2.tmp | sed 's/127.0.0.1/iptables -A INPUT -s/' | sed 's/$/ -j REJECT/' &gt;&gt; mal_INPUT.sc<br />
cat malware2.tmp | sed 's/127.0.0.1/iptables -A OUTPUT -d/' | sed 's/$/ -j REJECT/' &gt;&gt; mal_OUTPUT.sc<br />
cat malware2.tmp | sed 's/127.0.0.1/iptables -A FORWARD -d/' | sed 's/$/ -j REJECT/' &gt;&gt; mal_FORWARD.sc<br />
rm *.tmp</p>
<p>chmod +x mal_INPUT.sc<br />
chmod +x mal_OUTPUT.sc</p>
<p>echo "exit" &gt;&gt; mal_INPUT.sc<br />
echo "exit" &gt;&gt; mal_OUTPUT.sc</p>
<p># Excution of the scripts adding them to iptables<br />
/bin/iptables.sc<br />
/tmp/mal_INPUT.sc<br />
/tmp/mal_OUTPUT.sc<br />
/tmp/mal_FORWARD.sc</p>
<p>Now we need to set it up to run once a day.<br />
<code><br />
sudo crontab -e<br />
</code><br />
and paste in the following<br />
<code><br />
1 4 * * * /bin/malware<br />
</code><br />
This will update the malware list and resets the firewall every day at 4:01AM.</p>
<p><strong>ntop - network usage monitor</strong></p>
<p>ntop installed from repos just fine. But it wouldn't launch I had to create the ntop directory and adjust its permissions. These permissions could be tightened up a bit maybe. I wonder if anyone knows the proper permissions and ownership for this<br />
<code><br />
sudo apt-get install ntop<br />
sudo mkdir -p /var/lib/ntop<br />
sudo chmod 755 -R /var/lib/ntop<br />
sudo nano /var/lib/ntop/init.cfg<br />
</code><br />
and then verify the interfaces. I had to add more interfaces inside the quotes and seperate each one with a comma. Like this.<br />
<code>INTERFACES="eth0,eth1,eth2,eth3,wlan0"</code></p>
<p>Once installed, you can direct your browser to<br />
<code></p>
<p>http://yourhosturlorIP:3000</p>
<p></code><br />
and get some very interesting statistics throughput and network usage. This is a very robust monitoring utility. Click here to see some <a href="http://www.google.com/images?um=1&amp;hl=en&amp;tbs=isch:1&amp;&amp;sa=X&amp;ei=iAtoTdrmEIqutwfvmoToAw&amp;ved=0CDMQBSgA&amp;q=ntop+screenshots&amp;spell=1&amp;biw=1126&amp;bih=1067">screenshots</a> of ntop.</p>
<p><strong>DHCPD and DNS</strong></p>
<p>Many Walmart brand home router boxes have DHCP and DNS Masquerading features built in. If you are creating a device to replace such a box then you will need to set up these servers as well. There should be ample documentation on the internet for these proceedures. I use DNS and DHCP on a device inside of the network. It is much more secure to not have these servers forward facing. If you also have a seperate yet internal DNS and DHCP server set up this box won't route dhcp broadcasts from subnet to subnet. So if you, like me, have eth0 internet facing, eth1 and eth2 with internal hosts then those hosts connected to the eth that the DHCP server is not connected to will not get an IP address. You must install a dhcp relay.<br />
<code><br />
sudo apt-get install -y dhcp3-relay<br />
</code><br />
and configure it to point to your internal dhcp server. It is all pretty strait forward.</p>
<p><strong>nmap - network scanner</strong><br />
This tool can scan your network and look for hosts inside of your firewall. You can use this output to look for rouge devices. nmap is such an indepth tool that it deserves its own blog post.<br />
<code><br />
sudo nano /bin/nmap.sc<br />
</code><br />
and paste in the following.<br />
<code><br />
#!/bin/bash<br />
nmap -sP 10.1.1.0/24 &gt; /tmp/nmap.last<br />
nmap -sP 10.2.1.0/24 &gt;&gt; /tmp/nmap.last<br />
nmap -sP 10.3.1.0/24 &gt;&gt; /tmp/nmap.last<br />
nmap -sP 10.4.1.0/24 &gt;&gt; /tmp/nmap.last<br />
</code><br />
Note: You probably wont be using the same networks as I am. So scanning a network that doesn't exist is not necessary. Edit the script to suit your network.</p>
<p><code><br />
sudo crontabe -e<br />
</code><br />
paste in the following line.<br />
<code><br />
1 * * * * * /bin/nmap.sc<br />
</code><br />
This will scan the network on the first minute of every hour and put the results into /tmp/nmap.last.log We’ll add more fun later in which we can set more detailed scans on those clients as well as send alerts if something doesn’t belong. For now, you can look at that log by doing a<br />
<code><br />
cat /tmp/nmap.last.log<br />
</code></p>
<p><strong>netperf</strong></p>
<p>This handy utility measures actual throughput. Having this running on your gateway/router allows you to check your speed on any segment, and even though the internet.</p>
<p><code>tshark</code><br />
coming soon</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2011/03/02/rampart-router-firewall-proxy-wap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Frankintosh</title>
		<link>http://blog.computerant.com/2011/01/15/frankintosh/</link>
		<comments>http://blog.computerant.com/2011/01/15/frankintosh/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 05:37:17 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=755</guid>
		<description><![CDATA[This is frankintosh It started off as a simple iBook, but went through mad scientist like transformations to become, frankintosh. Muhaha Basic Specs This is a 12 inch 800Mhz dual USB IBook G3. This is a fairly light little yet rugged iBook. It was being recycled from my old job and I think I paid [...]]]></description>
			<content:encoded><![CDATA[<p><big><big><strong>This is frankintosh</strong></big></big><br />
It started off as a simple iBook, but went through mad scientist like transformations to become, frankintosh. Muhaha<br />
<span id="more-755"></span></p>
<p><strong>Basic Specs</strong><br />
This is a 12 inch 800Mhz dual USB IBook G3. This is a fairly light little yet rugged iBook. It was being recycled from my old job and I think I paid $40 for it. This system is very functional, but isn&#8217;t very powerful. It is perfect for light web browsing, email, word processing, and blogging.</p>
<p><strong>Memory</strong><br />
The first thing to get upgraded was the RAM. I&#8217;m a RAM junky, so I crammed in as much as it would hold. A 512 stick of RAM was about $30 from ebay. The iBook has 128MB soldered to the board. So it gives me a grand total of 640MB.</p>
<p><strong>Battery</strong><br />
Again, from ebay I got a new (not refurbished and not used) battery for about $30 dollars plus shipping. This battery lasts between 2.5 and 3 hours with the pata spinner hard drive. When suspended the battery lasts for many days.</p>
<p><strong>The Optical Drive</strong><br />
A friends laptop, i think it was an HP, died. I examined it for parts. The hard drive was no bigger than the iBooks, and no other parts were compatible with anything I had. I looked at the DVD Read / CD Write drive because I was thinking of converting it to a USB drive. But I noticed the connectors appeared to be the same as my iBook. I shrugged and put it in. Installed, the tray wouldn&#8217;t close so I had to trim down the plastic of the door with a utility knife and then smoothed it with sandpaper. It worked! It will read DVDs and it can burn CDs. I haven&#8217;t watched a movie on it yet, but I don&#8217;t see why it wouldn&#8217;t. The thing I love the most is the button on the tray door that pops it open. Macs seem to lack this handy manual way of opening the tray.<br />
Pics of drive with the top off:<br />
<img src="http://blog.computerant.com/wp-content/uploads/2011/01/frankintosh_DVD1.jpg" alt="OpticalDrive1" /></p>
<p><img src="http://blog.computerant.com/wp-content/uploads/2011/01/frankintosh_DVD2.jpg" alt="OpticalDrive2" /><br />
I need a pic of drive with iBook top re-assembled.</p>
<p><strong>The Hard Drive</strong><br />
I finally bought a Solid State hard drive for this system. Hard drive replacement on these iBooks is not for the faint of heart. You can find directions at ifixit.com, so I wont get into the details, but it is a lot of work. I paid $60ish for this 16GB solid state drive from an online store on ebay. <img src="http://blog.computerant.com/wp-content/uploads/2011/01/frankintosh_ssd1.jpg" alt="SSD1" /></p>
<p>I did some unofficial tests today. I was at the coffee shop on battery power for an hour and a half and used about 20% of my battery charge. If that rate continued it would be looking at 7 hours or more of battery life. Yes i know battery monitors are rarely so linear. Even conservativly speaking I bet I top 4 and a half hours.</p>
<p>hdparm -tT /dev/hda test with original pata hdd</p>
<blockquote><p>Timing cached reads:   102 MB in  2.00 seconds =  50.91 MB/sec<br />
Timing buffered disk reads:  70 MB in  3.02 seconds =  23.21 MB/sec</p></blockquote>
<p>hdparm -tT /dev/hda test with new ssd hard drive</p>
<blockquote><p>Timing cached reads:   160 MB in  2.00 seconds =  79.82 MB/sec<br />
Timing buffered disk reads:  78 MB in  3.07 seconds =  25.42 MB/sec</p></blockquote>
<p>Not much improvement in the buffered reads, which isn&#8217;t surprising. The cached reads improved by a decent margin. It still isn&#8217;t as fast as a more modern sata drive. Of course performance tests never reflect the real world and &#8216;feel&#8217;.</p>
<p>I recorded my boot up before and after this installation. With the spinner the boot was right at 1 minute and 20 seconds and after it is shaved down to right at a minute. This from press of power button to a login prompt. And I swear, it hangs at the yaboot prompts longer with the new drive. One can modify that so it waits less time. I wonder if I did that with the old hard drive and forgot to do it with the new hard drive. I suppose I could post videos of the before and after boot times if anyone is interested.</p>
<p>UPDATE: Well, I just realized the readahead isn&#8217;t installed, and I know it is on the original hard drive. So after installing that I expect a few more seconds shaved off. Probably not a whole lot, though.</p>
<p>UPDATE: again, <a title="SSD tweaking on mintppc.org" href="http://www.mintppc.org/forums/viewtopic.php?f=10&amp;t=300" target="_blank">here is some more tweaking on the SSD</a></p>
<p><strong>The Operating System</strong><br />
Mac OS sucks. So, I put <a href="http://mintppc.org">linux MintPPC</a>!! MintPPC out performs Mac OS in speed, user friendliness, and flexibility. Not to mention cost. This OS is a lightweight and attractive and very functional. It is perfect for light web browsing, email, word processing, and blogging. By default, it has media &amp; music software, network tools, graphics tools and much more. At least for my iBook, all of the hardware just worked out of the box. Even the wireless with WPA support. If you read my other blog posts you can see that I&#8217;ve tried a lot of other distros on this iBook and nothing compares to mintPPC. Of course, I&#8217;m probably biased as I&#8217;m a mintPPC developer.</p>
<p><strong>The Case</strong> To complete the frankintosh I removed the top of the display case and painted it green with krylon plastic spray paint. I put several coats on. Now I can&#8217;t see that stupid apple. And the green lid does look different.</p>
<p>This boot up video was recorded pre updates described above. After the updates I shaved the boot time down a bit.</p>
<p>&nbsp;</p>
<p><strong>Update</strong></p>
<p>Mint 11 is based on Debian Wheezy using kernel 3.1 and is incredibly fast. It is very impressive and I have to to hand it to <a name="p4661"></a> <strong>linuxopjemac</strong>!! This version is awesome.</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2011/01/15/frankintosh/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Installing 3.2.1 OpenOfficeOrg on Ubuntu 10.4</title>
		<link>http://blog.computerant.com/2010/09/23/installing-3-2-1-openofficeorg-on-ubuntu-10-4/</link>
		<comments>http://blog.computerant.com/2010/09/23/installing-3-2-1-openofficeorg-on-ubuntu-10-4/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 17:27:50 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=735</guid>
		<description><![CDATA[OpenOfficeOrg 3.2 is what is in the ubuntu repos.And that version is buggy particularly with rtf documents. The fix is in 3.2.1. sudo apt-get remove openoffice*.* mkdir ~/sc nano ~/sc/install_OOo.sc paste in the following. Beware of word wrapping on the wget line cd ~/Downloads wget http://ftp.ussg.iu.edu/openoffice/stable/3.2.1/OOo_3.2.1_Linux_x86-64_install-deb_en-US.tar.gz tar -xvzf OOo_3.2.1_Linux_x86-64_install-deb_en-US.tar.gz cd OOO320_m18_native_packed-1_en-US.9502/DEBS sudo dpkg -i *.deb [...]]]></description>
			<content:encoded><![CDATA[<p>OpenOfficeOrg 3.2 is what is in the ubuntu repos.And that version is buggy particularly with rtf documents. The fix is in 3.2.1.<br />
<span id="more-735"></span></p>
<blockquote><p>sudo apt-get remove openoffice*.*<br />
mkdir ~/sc<br />
nano ~/sc/install_OOo.sc</p></blockquote>
<p>paste in the following. Beware of word wrapping on the wget line</p>
<blockquote><p>cd ~/Downloads<br />
wget http://ftp.ussg.iu.edu/openoffice/stable/3.2.1/OOo_3.2.1_Linux_x86-64_install-deb_en-US.tar.gz<br />
tar -xvzf  OOo_3.2.1_Linux_x86-64_install-deb_en-US.tar.gz<br />
cd OOO320_m18_native_packed-1_en-US.9502/DEBS<br />
sudo dpkg -i *.deb<br />
cd desktop-integration<br />
sudo dpkg -i *.deb</p></blockquote>
<p>end paste</p>
<blockquote><p>chmod +x ~/sc/install_OOo.sc<br />
cd ~/sc<br />
sudo ~/sc/install_OOo.sc</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2010/09/23/installing-3-2-1-openofficeorg-on-ubuntu-10-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>secure file syncronization</title>
		<link>http://blog.computerant.com/2010/09/13/secure-file-syncronization/</link>
		<comments>http://blog.computerant.com/2010/09/13/secure-file-syncronization/#comments</comments>
		<pubDate>Tue, 14 Sep 2010 02:32:55 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=719</guid>
		<description><![CDATA[Have you ever wanted to keep your Documents directory contents synchronised and consistent across more than one platform? While doing some school work I found myself using my laptop or my desktop and hunting for files. As always, please be aware of possible word wrapping in scripts displayed here. In order for this to work [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to keep your Documents directory contents synchronised and consistent across more than one platform? While doing some school work I found myself using my laptop or my desktop and hunting for files.<br />
<span id="more-719"></span><br />
As always, please be aware of possible word wrapping in scripts displayed here.</p>
<p>In order for this to work the same user name must exist on both the local and the remote systems. Now it is possible to get this to work using different user names, but not with the scripts I supply here. So for simplicity be sure that the same username exists on both systems, and that they have a Documents directory in the location of /home/username/Documents on both systems.</p>
<p>Also, unision must be installed on both systems. Using debian you can &#8220;apt-get install unison&#8221; easy enough.</p>
<p>Both of the following scripts are executed on the system doing the syncing. This is normally the client, laptop, or the system which is disconnected from the network (or powered off) the most.</p>
<p><strong>Script 1</strong><br />
This script just generates keys and then copies the keys to the remote server. This way you don&#8217;t need to enter login credentials to log into the remote server via ssh. Without this, the cron job will just hang waiting for input.</p>
<p>As root execute the following commands. You may need sudo if running ubuntu.</p>
<blockquote><p>nano /bin/sshkeys.sc</p></blockquote>
<p>paste in the following</p>
<blockquote><p>echo GETTING INFORMATION<br />
echo enter the target systems username<br />
read _USER<br />
echo enter the target systems name or IP address<br />
read _SERVER<br />
echo GENERATING KEYS<br />
echo do not enter a passphrase. Just hit enter twice. In fact<br />
echo just accept all defaults and keep hitting enter.<br />
ssh-keygen -t rsa<br />
cd ~/.ssh<br />
echo COPYING the generated keys to the remote server<br />
echo you will be prompted for the password for the supplied user<br />
echo but, this should be the last time!<br />
scp ./id_rsa.pub $_USER@$_SERVER:/home/$_USER/.ssh/authorized_keys</p></blockquote>
<p>end paste</p>
<blockquote><p>chmod +x /bin/sshkeys.sc</p></blockquote>
<p>Here is the tricky part&#8230; NOT as root execute the following command.</p>
<blockquote><p>/bin/sshkeys.sc</p></blockquote>
<p>If you are logged in as root you just set up root&#8217;s key&#8217;s on the remote server, which would be fine if root&#8217;s documents are the ones you want to synch. If your user account is a sudoer, DO NOT execute this command with a sudo.</p>
<p>So lets examine this script. At first we are prompted for user input with the echo and read commands. You must supply the user name, and information about the target remote server. (with either hostname, FQDN, or IP address.) It is kind of self explanatory there. Then we are generating the encryption keys and copying them to the remote server. For the secure copying, you will be prompted for the user&#8217;s password. This should be the last time you are asked. Because from here on out it will use the copied keys, and we told it (by hitting enter twice) to not request a pass phrase.</p>
<p>Another (unrelated) fun trick:<br />
Once you have done the keygen you can do all kinds of nifty things, like execute commands remotely without logging in</p>
<blockquote><p>ssh user@servernameorIP &#8216;ls -l /tmp&#8217;</p></blockquote>
<p>Would list the contents of the /tmp directory on the remote machine</p>
<blockquote><p>ssh -X ant2ne@192.168.1.5 VirtualBox</p></blockquote>
<p>Would launch the Virtual Box console on the remote machine, but display it on the local machine.</p>
<p><strong>Script 2</strong><br />
as root execute these commands. you may need to proceed them with sudo if using ubuntu.</p>
<blockquote><p>nano /bin/unison.sc</p></blockquote>
<p>Paste in the following.</p>
<blockquote><p>
Syncing()<br />
{<br />
_LOG=/tmp/my_unison.log<br />
_DEST=ssh://remoteuser@remoteServer//home/remoteuser/Documents<br />
_SOURCE=/home/localuser/Documents</p>
<p>date > $_LOG<br />
unison -silent -auto -fastcheck true $_DEST $_SOURCE<br />
date >> $_LOG<br />
}<br />
ping -c 1 RemtoeServer &#038;&#038; Syncing</p></blockquote>
<p>End paste</p>
<blockquote><p>chmod +x /bin/unison.sc
</p></blockquote>
<p>So lets examine this script</p>
<p>_LOG is the location for your log file. I suggest /tmp/my_unison.log or some other directory where you have write access to. </p>
<p>_DEST is the remote destination to sync the files to. It must be in the format of &#8220;ssh://remoteuser@remoteServer//path/to/destination&#8221;. Lets break this down further. &#8220;ssh:&#8221; is the protocol to be used for the synch. ssh is encrypted and more secure. &#8220;remoteuser@remoteserver&#8221; this is the information that ssh needs to make a connection. remoteuser needs to be a valid user with write access on the path/to/destination part. and remoteserver is the FQDN or IP address of the target server. &#8220;//path/to/destination&#8221; is a UNC path to the target of the sync. If you were to navigate to the directory on the remote server and type pwd, that would be the information included here. BUt don&#8217;t forget to have the 2 wacks ( aka &#8220;//&#8221;) at the beginning of this path and not just one. </p>
<p>_SOURCE is the local location of the directory to be synced. if you were to navigate to that directory and type pwd this would be the exact information entered here.<br />
date > $_LOG and date >> $_LOG are just a little way to find out exactly how long it took to sync. If this takes too long then perhaps unison isn&#8217;t the method for you.</p>
<p>ping -c 1 remoteserver &#038;&#038; Syncing This is the last line, but it is executed first. This line tells the local computer to ping the remoteserver and if the remote server responds, then jump the the function Syncing, which then executes the stuff contained within the {} of the Syncing heading. If the ping fails, then the script just exits and there is not Syncing attempt. You don&#8217;t want to sync to a server that doesn&#8217;t exist do you? This is very handy for a laptop.</p>
<p>Once again, as root execute this command. You may need to proceed them with sudo if using ubuntu.</p>
<blockquote><p>nano /bin/unison.sc</p></blockquote>
<p>This time you need to edit _DEST= and _SOURCE= to fit your environment. I don&#8217;t know what that is. The words remoteuser remoteserver and localuser all need to be modified to fit your needs.</p>
<p><strong>Cron</strong><br />
The first synchronisation may take awhile because not only does it have to copy the files, but I think it builds a database of the meta data for the files. So you may want to execute the script manually by typing &#8220;unison.sc&#8221;. After this one completes, you&#8217;ll want it to be automated.</p>
<p>The final step is to configure cron to perform the sync on a regular basis. With your limited user account (the user that wants to sync the documents) execute.</p>
<blockquote><p>
crontab -e
</p></blockquote>
<p>And paste in the following line</p>
<blockquote><p>*/15 *  *   *   *     /bin/unison.sc</p></blockquote>
<p>End paste<br />
This line executes this unision.sc ever 15 minutes, basically causing the Documents directory to synchronise every 15 minutes.</p>
<p><strong>Disclaimer</strong><br />
Synchronisation is not a form of backup. If you delete a file, or it becomes corrupted, that file will be deleted and corrupted on the remote system as well. This is just a method of keeping your Documents consistent across multiple platforms.</p>
<p>But, once the Documents are synced, the remote system (assuming the remote system is a file server) can use tar to backup the Documents for archiving purposes. Didn&#8217;t I talk about backups using tar on another blog post?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2010/09/13/secure-file-syncronization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VirtualBox &#8211; Auto Power On Headless VMs</title>
		<link>http://blog.computerant.com/2010/06/21/virtualbox-auto-power-on-headless-vms/</link>
		<comments>http://blog.computerant.com/2010/06/21/virtualbox-auto-power-on-headless-vms/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 16:12:22 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=702</guid>
		<description><![CDATA[I like my VMs to run headless. I like my VMs to be powered on. Here is how. as root nano /bin/vboxlist.sc and paste in the following VBoxManage list vms &#124; grep { &#124; cut -d{ -f 1 &#124; sed &#8216;s/&#8221;//g&#8217; > /tmp/vboxlist cat /tmp/vboxlist exit saving and then nano /bin/vboxon.sc and paste in vboxlist.sc [...]]]></description>
			<content:encoded><![CDATA[<p>I like my VMs to run headless. I like my VMs to be powered on. Here is how.<br />
<span id="more-702"></span><br />
as root</p>
<blockquote><p>nano /bin/vboxlist.sc</p></blockquote>
<p>and paste in the following</p>
<blockquote><p>VBoxManage list vms | grep { | cut -d{ -f 1 | sed &#8216;s/&#8221;//g&#8217; > /tmp/vboxlist<br />
cat /tmp/vboxlist</p></blockquote>
<p>exit saving and then</p>
<blockquote><p>nano /bin/vboxon.sc</p></blockquote>
<p>and paste in</p>
<blockquote><p>vboxlist.sc<br />
vboxon_list=&#8217;/tmp/vboxlist&#8217;<br />
for VPS in `cat $vboxon_list`; do<br />
        echo starting &#8220;$VPS&#8221;<br />
        VBoxHeadless -startvm &#8220;$VPS&#8221; &#038;<br />
        sleep 20<br />
done<br />
exit 0</p></blockquote>
<p>save and exit and then</p>
<blockquote><p>chmod +x /bin/*.sc</p></blockquote>
<p>then as your regular user who executes the VMs. (often not root)</p>
<blockquote><p>crontab -e </p></blockquote>
<p>and enter</p>
<blockquote><p>*/5 * * * * /bin/vboxon.sc</p></blockquote>
<p>This will now launch your entire list of VMs in a headless mode every 5 minutes. If the VM is already running, it will simply fail to launch the VM and move onto the next. If you just want a list of VMs on the system you can type vboxlist.sc. If you want to manually turn on the VMs, you can type vboxon.sc</p>
<p>disclaimer: this was writtin on a debian VirtualBox host. The line &#8220;VBoxManage list vms | grep { | cut -d{ -f 1 | sed &#8216;s/&#8221;//g&#8217; > /tmp/vboxlist&#8221; maybe different on different distributions or VirtualBox versions.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2010/06/21/virtualbox-auto-power-on-headless-vms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make Windows Bearable &#8211; Steps 4 to 6 of the 12 step program</title>
		<link>http://blog.computerant.com/2010/05/24/make-windows-bearable-%e2%80%93-the-second-3-commandments/</link>
		<comments>http://blog.computerant.com/2010/05/24/make-windows-bearable-%e2%80%93-the-second-3-commandments/#comments</comments>
		<pubDate>Mon, 24 May 2010 18:44:11 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=673</guid>
		<description><![CDATA[Continuing the 12 step program from here 4 &#8211; Firewall In Windows 7: Win Logo &#8211; Control Panel &#8211; System Security &#8211; Windows Firewall Be certain it is turned on. Look at the list of applications that have already punched a hole in your firewall and disable them by unchecking them. If you don&#8217;t know [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.computerant.com/2010/02/14/make-windows-bearable-the-ms-holy-trinity/">Continuing the 12 step program from here</a><br />
<span id="more-673"></span><br />
<strong><big>4 &#8211; Firewall</big></strong><big></big><br />
In Windows 7: Win Logo &#8211; Control Panel &#8211; System Security &#8211; Windows Firewall<br />
Be certain it is turned on. Look at the list of applications that have already punched a hole in your firewall and disable them by unchecking them. If you don&#8217;t know what it is, google it. And deterine if you need that application or service to access the internet. After a quick google, if you still don&#8217;t know, then just disable it. {need to elaborate}</p>
<p><strong><big>5 &#8211; Protect yourself, from yourself.</big></strong><big></big><br />
You just bought the computer. It asked you a bunch of questions including your name and time zone and the account name. You were then logged into the computer and presented with a desktop. You just created an administrator account. And most people just continue to use that account and never think twice about it. Being and administrator sounds glamorous, and maybe it is, but it is also dangerous.</p>
<p>Don&#8217;t be an admin. Don&#8217;t log into a computer as an administrator. Don&#8217;t be a power user. Don&#8217;t ! ! Have you ever notice that at work or at school that you log into a computer as a Standard user and you are &#8216;locked out&#8217; of some computer functions. Why does the IT Department lock down the workstations? Because they hate you and don&#8217;t trust you. Well, probably. But mainly to protect the employees&#8217; computers and data from the employees.</p>
<p>While logged into a computer as an administrator, every thing you do on the computer you do with the authority of an administrator. Everything you click on, launch or type has ultimate power on the computer system (and in some situation, the network as well) Supposing you are logged in as an administrator and doing some web surfing and you click on a link titled &#8220;fuzzy puppys&#8221; and the link does take you to a site of cute pooches. But the link also downloaded some code behind the scenes, and since you were logged in as an administrator, it has complete authority on the system. It launched and installer that begins to infect your operating system. In a few hours you&#8217;ll be contacting you &#8220;computer geek&#8221; friend and bribing him with pizza to come over and &#8220;look at&#8221; your computer. He maybe a &#8220;computer geek&#8221;, but you are the &#8220;computer moron&#8221; who isn&#8217;t smart enough to follow these (very simple) rules.</p>
<p>&#8220;Ahh, but I&#8217;m good with computers, I know what I&#8217;m doing, I&#8217;ll just keep logging in as administrator.&#8221; The way I see it, if you are savvy enough to log in to your computer as an administrator, you are also savvy enough to fix it when you screw it up.</p>
<p>In Windows 7:  Click Win Logo Button (old start button) &#8211; Control Panel &#8211; User Accounts &#8211; Give other users access to this computer<br />
This launches the &#8220;User Accounts&#8221; form. Click the Add button and enter a name. And Next. Now here is the important part, you want &#8220;Standard User&#8221; and click finish.</p>
<p>Now log off and back on with the new Standard User. Only log in with the old Admin User when you need to install something or run some system utility. But 98% of what you do does not need Admin authority. Because you now have the inconvenience of logging off and back on to perform admin functions, you are less likely to spontaneously do things and click on crap. And you might think a little longer and harder about what it is you are doing.</p>
<p><a href="http://blog.computerant.com/wp-content/uploads/2010/05/adminlogin.jpg"><img class="aligncenter size-full wp-image-942" title="adminlogin" src="http://blog.computerant.com/wp-content/uploads/2010/05/adminlogin.jpg" alt="adminlogin" width="572" height="857" /></a></p>
<p><strong><big>6 &#8211; Don&#8217;t install that</big></strong><big></big><br />
Do not install unreputable software or software from unknown and untrustworthy sources. All because your buddy who &#8220;is good with computers&#8221; has it installed, does not mean it is reputable. After all, that moron logs in as an administrator. And all because you can download it from sourceforge doesn&#8217;t mean you can trust it. So before you click that setup.exe ask the person who is going to end up fixing your broken system if the program is reputable. If that person isn&#8217;t available, do some research on your own. Try googling &#8220;limewire and virus&#8221;.</p>
<p>Quote of the day; &#8220;Limewire is installed. I think I know what the problem is&#8230;&#8221; Limewire is a program that offers copy written and non-free software, media, or files for free. Regardless of this illegality and lets forget about how limewire eats up your bandwidth and system performance, and lets ignore that it ruins your privacy by sharing your files&#8230; Limewire is a horrible program that opens a hole in your firewall and gives access to your system to anything that wants it. I&#8217;d say a mere 10% of the systems I&#8217;ve cleaned did not have limewire or similar programs installed and were infected by some other source such as email or flash drive or sick link.</p>
<p>&#8220;Quit installing limewaire!&#8221;&#8230; &#8220;Why?&#8221;&#8230; &#8220;you&#8217;ll not find a more wretched hive of scum, and villany than limewire that&#8217;s why!!!!!&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2010/05/24/make-windows-bearable-%e2%80%93-the-second-3-commandments/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LXDE Mint on the iBook G3, using Debian lenny</title>
		<link>http://blog.computerant.com/2010/05/03/debian-lenny-with-mint-on-the-ibook-g3-%e2%80%93-getting-it-all-to-work/</link>
		<comments>http://blog.computerant.com/2010/05/03/debian-lenny-with-mint-on-the-ibook-g3-%e2%80%93-getting-it-all-to-work/#comments</comments>
		<pubDate>Mon, 03 May 2010 18:21:11 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=597</guid>
		<description><![CDATA[I am a moderator on the mintppc.org forums. I am flattered that you visited my site, but any questions you have will be answered quicker on that forum. Besides, most of this information is out of date with the current mint ppc 9 and debian squeeze. There are a few notes&#8230; wpa Squeeze comes with [...]]]></description>
			<content:encoded><![CDATA[<p>I am a moderator on the <a href="http://mintppc.org/forums">mintppc.org forums</a>. I am flattered that you visited my site, but any questions you have will be answered quicker on that forum. Besides, most of this information is out of date with the current mint ppc 9 and debian squeeze. There are a few notes&#8230;<br />
<span id="more-597"></span><br />
<strong>wpa</strong><br />
Squeeze comes with kernel 2.6.32.5 and when adding the orinoco driver (below) and by just adding &#8216;apt-get install wpasupplicant wireless-tools&#8217; wpa works great with wicd or command line. No need to update the kernel!</p>
<p><strong>power</strong><br />
Squeeze also has fairly functional suspend features. Hibernate is still borked though.The power management of lxde isn&#8217;t as configurable as I would like and when compared to gnome. But merely pushing the power button executed a suspend to ram.  Somehow closing the lid and suspending was giving me issues as well. But somehow it started working again. It appears that squeeze uses ppbuttonsd, but powerprefs 9the gui front) was not installed and could be installed manually from the lenny packages.</p>
<p><strong>right click</strong><br />
The right click is mapped to the F11, and my fix (below) didn&#8217;t seem to move it. I removed mouseemu with a &#8216;apt-get remove mouseemu&#8217; and my fix worked. I tried to configure and use mouseemu, but it wasn&#8217;t cooperating with me. I figure it is one less service running, right?</p>
<p><strong>mint</strong><br />
Running the mint ppc 9 install script on top of a basic installation (no gui) adds lxde with enough features for most needs. To install mint jump over to <a href="http://www.mintppc.org">mintppc.org</a> and register and click on the installation link and choose mint9. Pay special attention to the part where the author says, &#8220;We cannot yet install Squeeze natively as there is still a bug in the Debian Installer with respect to yaboot.&#8221; There are steps explained to overcome that problem. It can be a bit confusing. But you download the <strong>Lenny</strong> netinst or business card install CD and when prompted to enter &#8220;install&#8221;, &#8220;install video=ofonly&#8221; or &#8220;expert&#8221; just type &#8220;expert. And go through each step. You will eventually be prompted to select &#8216;lenny&#8217; &#8216;squeeze&#8217; or &#8216;sid&#8217;. Select squeeze. Continue the installation and when asked what packages you want, un-check desktop but leave laptop.</p>
<p><strong>Out of date information below this point&#8230;</strong></p>
<p>To install Mint, you should jump over to <a href="http://mac.linux.be/content/mint-lxde-debian-lenny-ppc#4">http://mac.linux.be/content/mint-lxde-debian-lenny-ppc#4</a> and read what there is to learn. then come back here and see how I tweaked it to run on the iBook. And get everything else to work as well. After playin with mint for some time, i detemined that lxde wasn&#8217;t enough of a window manager for me. So I went back to a gnome desktop. But, I have a 800Mhz cpu with 640MB of RAM so I didn&#8217;t need lxde. Some of the lighter iBooks out there will have better performance with lxde.<br />
<!--more--><br />
The tutorial outlined by linuxopjemac assumes that you have a default and basic install of debian with no other X sessions managers (ie. gnome or kde) and was intended to run on a desktop not laptop computer. But to get wpa and suspend, I had to sacrifice the ultra trim debian installation and go ahead and install a gnome desktop and applications. Then configure gnome to work properly. I then added only the required mint packages and themes and left out the other packages suggested by linuxopjemac. This left me with a minty lxde OS, but using mostly gnome applications. This is a situation that I’m quite happy with.</p>
<p>So first grab yourself a lenny (5.04) debian install CD and install it on your iBook, including gnome desktop. When that is done, you can begin configuring.<br />
all of this needs to be done as root. So</p>
<blockquote><p>su</p></blockquote>
<p>and enter the root password<br />
As usual, for iBook suspend and wpa you need a 2.6.32 or better kernel. In debian, you don’t have to roll your own.</p>
<blockquote><p>nano /etc/apt/sources.list</p></blockquote>
<p>add</p>
<blockquote><p>deb http://http.us.debian.org/debian/ unstable main contrib non-free</p></blockquote>
<p>save and back in terminal</p>
<blockquote><p>apt-get update &#038;&#038; apt-get install -y lxde linux-headers-2.6.32-3-powerpc linux-image-2.6.32-3-powerpc<br />
apt-get remove -y pmud powerprefs pbuttonsd<br />
nano /etc/apt/sources.list</p></blockquote>
<p>and comment out</p>
<blockquote><p>#deb http://http.us.debian.org/debian/ unstable main contrib non-free</p></blockquote>
<p>Back in the terminal</p>
<blockquote><p>cp /etc/yaboot.conf /etc/yaboot.conf.original<br />
nano /etc/yaboot.conf</p></blockquote>
<p>remove &#8220;video=ofonly&#8221;, but leave the quotes.</p>
<blockquote><p>ybin -v</p></blockquote>
<blockquote><p>shutdown now -r</p></blockquote>
<p>on reboot</p>
<blockquote><p>uname -r</p></blockquote>
<p>and verify the new kernel.</p>
<blockquote><p>su<br />
apt-get autoremove</p></blockquote>
<p>now we get and apply the orinoco driver for wpa</p>
<blockquote><p>cd  /tmp<br />
wget http://www.ant2ne.com/downloads/iBook_orinoco.fw.tar.bz2<br />
tar -xvjf iBook_orinoco.fw.tar.bz2<br />
mv orinoco.fw /lib/firmware/agere_sta_fw.bin<br />
modprobe airport<br />
shutdown now -r</p></blockquote>
<p>After all of that, we have a functional 2.6.32 kernel with wpa and we can suspend to ram with the command s2ram. But you need to configure it to unload and reload these drivers on suspend. The method I&#8217;m playing with now is on ifup and ifdown events.</p>
<blockquote><p>su<br />
cd /bin<br />
nano power_suspend.sc</p></blockquote>
<p>and then copy and paste in the following </p>
<blockquote><p>
#!/bin/bash<br />
case $1 in<br />
    hibernate)<br />
        #echo &#8220;Hey guy, we are going to suspend to disk!&#8221;<br />
	ifdown eth1<br />
	modprobe -r airport<br />
	modprobe -r orinoco<br />
	echo hibernate &#8212;&#8212;&#8212;&#8212;&#8211; >> /tmp/power.log<br />
	date >> /tmp/power.log<br />
        ;;<br />
    suspend)<br />
        #echo &#8220;Oh, this time we&#8217;re doing a suspend to RAM. Cool!&#8221;<br />
	ifdown eth1<br />
	modprobe -r airport<br />
	modprobe -r orinoco<br />
	echo suspend &#8212;&#8212;&#8212;&#8212;&#8212; >> /tmp/power.log<br />
	date >> /tmp/power.log<br />
        ;;<br />
    thaw)<br />
        #echo &#8220;oh, suspend to disk is over, we are resuming&#8230;&#8221;<br />
	#modprobe orinoco<br />
	modprobe airport<br />
	ifup eth1<br />
	echo thaw &#8212;&#8212;&#8212;&#8212;&#8212; >> /tmp/power.log<br />
	date >> /tmp/power.log<br />
        ;;<br />
    resume)<br />
        #echo &#8220;hey, the suspend to RAM seems to be over&#8230;&#8221;<br />
	#modprobe orinoco<br />
	modprobe airport<br />
	ifup eth1<br />
	echo resume &#8212;&#8212;&#8212;&#8212;&#8212; >> /tmp/power.log<br />
	date >> /tmp/power.log<br />
        ;;<br />
    *)  echo &#8220;somebody is calling me totally wrong.&#8221;<br />
        ;;<br />
esac
</p></blockquote>
<p>Now we need to link this script in bin to the loction where the power management will look for it. Scripts in the sleep.d directory are executed each time the computer is suspended, resumed, hibernated or thawed. Notice that I never did get hibernate and thaw to work. But with a good battery the suspend and resume is awesome. It is fast and conserves a lot of energy.</p>
<blockquote><p>chmod +x *.sc<br />
ln -s  /bin/power_suspend.sc /etc/pm/sleep.d/22power_suspend.sc
</p></blockquote>
<p><strong>Hard Drive</strong> tweaks</p>
<blockquote><p>hdparm -B 127 /dev/hda<br />
hdparm -M 254 /dev/hda</p></blockquote>
<p><strong>Right Click</strong> The right click is naturally mapped to the F12, wich is dumb. The fn &amp; alt keys are much more conveneint.</p>
<blockquote><p>nano /etc/sysctl.conf</p></blockquote>
<p>And edit or add the following</p>
<blockquote><p>
dev.mac_hid.mouse_button_emulation = 1<br />
dev.mac_hid.mouse_button2_keycode = 87<br />
dev.mac_hid.mouse_button3_keycode = 100</p></blockquote>
<p>exit and save. Then, back in the terminal execute</p>
<blockquote><p>invoke-rc.d procps start</p></blockquote>
<p>so the changes take effect.</p>
<p>I now have suspend, wpa and screen dimming on a debian system.</p>
<p><strong>Mint</strong><br />
To install Mint, you should jump over to <a href="http://mac.linux.be/content/mint-lxde-debian-lenny-ppc#4">http://mac.linux.be/content/mint-lxde-debian-lenny-ppc#4</a> and read what there is to learn. This install script assumes that you are installing on a basic debian install only. And not with gnome or configured settings for suspend and wpa. I noticed that some application in that script breaks suspend. So for a functional suspend, grab the install script called mint-installer. Then trim out the part that will install the other applications. With the current mint-installer script (as of 5/5/2010) you can just&#8230;</p>
<blockquote><p>tail -105 mint-installer > iBook_mint.sc<br />
rm mint-installer<br />
chmod +x iBook_mint.sc<br />
Apt-get install lxde<br />
./ iBook_mint.sc</p></blockquote>
<p>After playing around some, I determined that lxde and mint didn&#8217;t fit my needs so I went back to a default gnome-debian install on my ibook.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2010/05/03/debian-lenny-with-mint-on-the-ibook-g3-%e2%80%93-getting-it-all-to-work/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I passed my CompTIA Linux+ certification today</title>
		<link>http://blog.computerant.com/2010/04/26/i-passed-my-comptia-linux-certification-today/</link>
		<comments>http://blog.computerant.com/2010/04/26/i-passed-my-comptia-linux-certification-today/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 19:22:07 +0000</pubDate>
		<dc:creator>Tony Cygne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.computerant.com/?p=587</guid>
		<description><![CDATA[I passed my Comptia linux+ certification today. I can say that with no formal training, I did it on my own. It was a great learning process for me. And the knowledge gained on the journey of preparation for this exam (just like my A+ and Network+) was the true benefit. Not only do I [...]]]></description>
			<content:encoded><![CDATA[<p>I passed my Comptia linux+ certification today. I can say that with no formal training, I did it on my own.<br />
<span id="more-587"></span><br />
It was a great learning process for me. And the knowledge gained on the journey of preparation for this exam (just like my A+ and Network+) was the true benefit. Not only do I have a certification of my knowledge, but I have greater and more in depth knowledge of Linux than when I began studying.<br />
<img alt="" src="http://ant2ne.com/images/nickel_OS.JPG" title="nickelOS" class="aligncenter" width="600" height="197" /><br />
I owe much of my learning to my Slackintosh on the iBook and ubuntu iBook projects. You can read about them on this blog site here. It is true what they say, if you want to learn linux, use slack.</p>
<p>It will be a goal of mine, to share any of my knowledge of Linux to anyone who wants to learn. I&#8217;m also contemplating starting a lug in my area or finding some other way to contribute to the community.</p>
<p>Associates degree in Computer Networking (with a 4.0 gpa), A+, Network+, Linux+, and now I&#8217;m dusting off that Security+ book.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.computerant.com/2010/04/26/i-passed-my-comptia-linux-certification-today/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
