<?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>Sudo Make Install</title>
	<atom:link href="http://sudomakeinstall.com/feed" rel="self" type="application/rss+xml" />
	<link>http://sudomakeinstall.com</link>
	<description>System Administrators Blurb</description>
	<lastBuildDate>Sat, 25 Aug 2012 21:25:02 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
		<item>
		<title>16 x 256GB Samsung 830 SSD Raid 6 with LSI 9266-8i Controller in a Dell R720 (16 Bay)</title>
		<link>http://sudomakeinstall.com/linux-systems/16-x-256gb-samsung-830-ssd-raid-6-with-lsi-9266-8i-controller-in-a-dell-r720-16-bay</link>
		<comments>http://sudomakeinstall.com/linux-systems/16-x-256gb-samsung-830-ssd-raid-6-with-lsi-9266-8i-controller-in-a-dell-r720-16-bay#comments</comments>
		<pubDate>Mon, 06 Aug 2012 18:11:15 +0000</pubDate>
		<dc:creator>Tyler Bishop</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[Virtualization]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=561</guid>
		<description><![CDATA[&#160; As a systems administrator it seems like I&#8217;m constantly battling IO contention and latency in our san and local storage environments. So As months roll by these new SSD drives keep getting cheaper and cheaper, offering better write wear and longer life spans for high write intensive environments, so finally I&#8217;m taking the plunge [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>As a systems administrator it seems like I&#8217;m constantly battling IO contention and latency in our san and local storage environments. So As months roll by these new SSD drives keep getting cheaper and cheaper, offering better write wear and longer life spans for high write intensive environments, so finally I&#8217;m taking the plunge to begin converting our most intensive systems over to solid state.</p>
<p>In the process of exploring solid state disk the samsung 256GB 830 series really stuck out of the crowd. The 830 offers fantastic read and write latency and throughput as well as being one of the only SSD series on the market where both the flash and storage controller are by the same manufacture.</p>
<p>The main reason for chosing the samsung is this benchmark at <a title="Extreme Systems" href="http://www.xtremesystems.org/forums/showthread.php?271063-SSD-Write-Endurance-25nm-Vs-34nm">extreme systems.</a></p>
<p><img src="http://www.ssdaddict.com/ss/Endurance/Endurance_cr_latest.png" alt="" /></p>
<p>&nbsp;</p>
<p><img src="https://sphotos-b.xx.fbcdn.net/hphotos-ash4/332974_10151135819785792_1963671865_o.jpg" alt="" /></p>
<p>&nbsp;</p>
<h1>Update: 8/24/12</h1>
<p>We ended up going back to the dell H710P after having a few issues with the uEFI bios not playing well with the controller at post.  Not to mention LSI webbios is a horrible pile of useless shit, this is 2012 why the hell do we have this prehistoric pile of crap UI on a raid controller.  Whoever at LSI approved that to be shipped on the cards should be forced to stand in a fire.</p>
<p>The H710P has dells lovely customized controller bios which is keyboard driven EASY to use and FAST to configure with.   Performance of the H710P is actually a little bit better than the 9266-8i while the hardware is identical.</p>
<p>Another major issue with the 9266 is when you would remove a drive *failure simulation* and replace it, the controller would mark the new drive as bad vs treating it as a fresh drive to rebuild on.  Without the CLI or MegaRaid Storage Manager this is a rather annoying problem to deal with as you would need to reboot the system to fix it in WEbiboss11!!111.. POS.</p>
<p>The H710P obviously works with dells unified system and can be accessed a number of ways without the operating system even knowing about it.</p>
<h2> The configuration:</h2>
<ul>
<li>16x Samsung 830 256GB MLC SSD</li>
<li>Raid 6 with read and write caching (BBU backed).  64KB Block Size</li>
<li>Dell R720 16 Bay 8i SAS6 Expanded Backplane  2 Ports 16 devices.</li>
</ul>
<p>The Benchmarks!</p>
<p>Here are some prelim benchmarks of the actual performance inside a VMware machine.</p>
<h2>LSI 9266-8i</h2>
<blockquote><p><strong>Children see throughput for 32 initial writers  =  214905.26 ops/sec</strong><br />
Parent sees throughput for 32 initial writers   =  198172.68 ops/sec<br />
Min throughput per process                      =    6392.06 ops/sec<br />
Max throughput per process                      =    7173.76 ops/sec<br />
Avg throughput per process                      =    6715.79 ops/sec<br />
Min xfer                                        =  925970.00 ops</p>
<p><strong>Children see throughput for 32 readers          =  734057.97 ops/sec</strong><br />
Parent sees throughput for 32 readers           =  734011.56 ops/sec<br />
Min throughput per process                      =   22833.85 ops/sec<br />
Max throughput per process                      =   23062.16 ops/sec<br />
Avg throughput per process                      =   22939.31 ops/sec<br />
Min xfer                                        = 1038205.00 ops</p>
<p><strong>Children see throughput for 32 random readers   =   55662.96 ops/sec</strong><br />
Parent sees throughput for 32 random readers    =   55662.71 ops/sec<br />
Min throughput per process                      =    1730.88 ops/sec<br />
Max throughput per process                      =    1751.76 ops/sec<br />
Avg throughput per process                      =    1739.47 ops/sec<br />
Min xfer                                        = 1036073.00 ops</p>
<p><strong>Children see throughput for 32 random writers   =   19827.16 ops/sec</strong><br />
Parent sees throughput for 32 random writers    =   19090.45 ops/sec<br />
Min throughput per process                      =     584.53 ops/sec<br />
Max throughput per process                      =     663.61 ops/sec<br />
Avg throughput per process                      =     619.60 ops/sec<br />
Min xfer                                        =  967988.00 ops</p></blockquote>
<h2>Dell H710P</h2>
<blockquote><p><strong>Children see throughput for 32 initial writers  =  489124.60 ops/sec</strong><br />
Parent sees throughput for 32 initial writers   =  435746.51 ops/sec<br />
Min throughput per process                      =   14005.25 ops/sec<br />
Max throughput per process                      =   17028.75 ops/sec<br />
Avg throughput per process                      =   15285.14 ops/sec<br />
Min xfer                                        =  860278.00 ops</p>
<p><strong>Children see throughput for 32 readers          =  678563.56 ops/sec</strong><br />
Parent sees throughput for 32 readers           =  678524.72 ops/sec<br />
Min throughput per process                      =   21111.18 ops/sec<br />
Max throughput per process                      =   21253.53 ops/sec<br />
Avg throughput per process                      =   21205.11 ops/sec<br />
Min xfer                                        = 1041599.00 ops</p>
<p><strong>Children see throughput for 32 random readers   =   59482.27 ops/sec</strong><br />
Parent sees throughput for 32 random readers    =   59482.00 ops/sec<br />
Min throughput per process                      =    1851.91 ops/sec<br />
Max throughput per process                      =    1869.25 ops/sec<br />
Avg throughput per process                      =    1858.82 ops/sec<br />
Min xfer                                        = 1038852.00 ops</p>
<p><strong>Children see throughput for 32 random writers   =   20437.99 ops/sec</strong><br />
Parent sees throughput for 32 random writers    =   19228.06 ops/sec<br />
Min throughput per process                      =     610.33 ops/sec<br />
Max throughput per process                      =     695.63 ops/sec<br />
Avg throughput per process                      =     638.69 ops/sec<br />
Min xfer                                        =  945641.00 ops</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/16-x-256gb-samsung-830-ssd-raid-6-with-lsi-9266-8i-controller-in-a-dell-r720-16-bay/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cool One Liners #2; The one line cpanel packaging</title>
		<link>http://sudomakeinstall.com/uncategorized/cool-one-liners-2-the-one-line-cpanel-packaging</link>
		<comments>http://sudomakeinstall.com/uncategorized/cool-one-liners-2-the-one-line-cpanel-packaging#comments</comments>
		<pubDate>Mon, 06 Aug 2012 18:09:46 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=518</guid>
		<description><![CDATA[OK, so we are migrating to a new server and we have a lot of accounts to migrate. Here&#8217;s a quick and dirty one liner to make it happen: grep -v &#8220;*: nobody&#8221; /etc/userdomains &#124;cut -d: -f2 &#124; sort &#124; uniq &#124; xargs /scripts/pkgacct {} \; This will remove the generic (nobody) user from the [...]]]></description>
			<content:encoded><![CDATA[<p>OK, so we are migrating to a new server and we have a lot of accounts to migrate. Here&#8217;s a quick and dirty one liner to make it happen:</p>
<p>grep -v &#8220;*: nobody&#8221; /etc/userdomains |cut -d: -f2 | sort | uniq | xargs /scripts/pkgacct {} \;</p>
<p>This will remove the generic (nobody) user from the list, separate the user from their respective domain, and execute the pkgacct command.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/uncategorized/cool-one-liners-2-the-one-line-cpanel-packaging/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a Linux console</title>
		<link>http://sudomakeinstall.com/uncategorized/setting-up-a-linux-console</link>
		<comments>http://sudomakeinstall.com/uncategorized/setting-up-a-linux-console#comments</comments>
		<pubDate>Thu, 26 Jul 2012 21:38:27 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=540</guid>
		<description><![CDATA[I had always wanted to have a dumb terminal on my Linux workstation. I always liked the idea of having a text only environment just because I&#8217;m not a fan of clicking through a thousand windows to get what I want set up in regards to consoles. That being said, I haven&#8217;t had any luck [...]]]></description>
			<content:encoded><![CDATA[<p>I had always wanted to have a dumb terminal on my Linux workstation. I always liked the idea of having a text only environment just because I&#8217;m not a fan of clicking through a thousand windows to get what I want set up in regards to consoles. That being said, I haven&#8217;t had any luck finding any dumb terminals. Mainframe being out of style dumb terminals are getting progressively harder and harder to come by. Thin Clients are actually easy to get via Ebay or other sources, come in a variety of shapes, sizes and capabilities. I ended up buying a random terminal likely without doing adequate research into it, but for the price of $25 shipped I figured it was a minimal investment.</p>
<p>The terminal its self came with a copy of embedded Windows that was trying to connect to a Citrix Server. Considering that is far from what I wanted, I needed to figure out how to get Linux on it. There are a few things you need to know about these terminals. They have an AMD Geode processor, 128 Megabytes of RAM, but more importantly IMO they only have 32 Megabytes of flash. This ultimately is the biggest limitation.</p>
<p>This means you&#8217;re really having to chop things down to even get a base OS and some sort of SSH client on them. There are really 2 vectors for getting another OS on these clients, the first is USB. Considering this is a USB1 terminal, it is horridly slow to do this way. It does work, but a basic flash drive takes forever to boot. The other way, the way that I ultimately settled on is PXE booting. There are a few advantages of this IMO, among them being:</p>
<p>-Faster. 100 megs versus 12 megs. Even with a basic initrd it&#8217;s obvious to me which wins.</p>
<p>-Ease of migration. You can use this with pretty much any desktop, laptop or terminal that will PXE boot. That&#8217;s very convenient if you want to step up to something a bit hotter, or use a random laptop as a spare console.</p>
<p>-Remote connectivity. If I wanted to use this in my garage remotely, all I would have to do is run an Ethernet cable. Makes it really easy to get a VT.  No OS installations to worry about, it &#8220;just works.&#8221;</p>
<p>-Expandable. We can set this up to connect to a remote X11 server later if we want to.</p>
<p>To actually start the install, we need to change the BIOS. The password for these systems is &#8220;Fireport&#8221; which makes it easy for us to log in. There&#8217;s not a ton of options here, so we will change the boot order and exit.</p>
<p>Linux selection is a mixed bag on these, the fact the Geode is an I586 architecture limits the options pretty significantly. I decided on Slackware as I&#8217;ve always liked it, you can use the latest version with an I586 system and it&#8217;s fairly easy to &#8220;chop.&#8221;</p>
<p>On to actually getting this thing booted up in a (non-windows) environment. First things we need to do are set up services. On SuSE this can be a bit more trying than Red Hat due to having to open some ports, but the process is essentially the same. I have a separate NIC as well due to running DHCP on my main network and not wanting to cause conflicts with that. The idea is that the main server will be 192.168.1.1, the terminal will be set up as 192.168.1.2.</p>
<p>/etc/dhcpd.conf:</p>
<p>ddns-update-style none;<br />
default-lease-time 14400;<br />
filename &#8220;pxelinux.0&#8243;;</p>
<p># IP address of the dhcp server nothing but this machine.<br />
next-server 192.168.1.1;<br />
subnet 192.168.1.0 netmask 255.255.255.0 {<br />
# ip distribution range between 192.168.1.1 to 192.168.1.100<br />
range 192.168.1.2 192.168.1.100;<br />
default-lease-time 10;<br />
max-lease-time 10;<br />
}</p>
<p>I also edited /etc/sysconfig/dhcpd to set up dhcpd to listen on eth1:</p>
<p>&nbsp;</p>
<p>DHCPD_INTERFACE=&#8221;eth1&#8243;</p>
<p>&nbsp;</p>
<p>The next thing I did was install the TFTP server. There&#8217;s not much to that, it&#8217;s an Xinetd service. Be sure that ports are open, if at all possible I like to try and nmap the server to make sure everything is open and running. After this, we need to add a few things to the config. The first is the pxelinux.0 file which goes in /tftproot/. After this, a pxelinux.cfg directory needs to get created. Add a file to this called default. Since I started with the hugesmp kernel (I would just use the regular huge kernel since this is unicore and uniproc) I set it up the following way:</p>
<p>&nbsp;</p>
<p>default hugesmp.s<br />
prompt 1<br />
timeout 1<br />
display message.txt<br />
F1 message.txt<br />
F2 f2.tx<br />
label hugesmp.s<br />
kernel kernels/hugesmp.s/bzImage<br />
append initrd=initrd.img load_ramdisk=1 prompt_ramdisk=0 rw SLACK_KERNEL=hugesmp.s</p>
<p>I copied the initrd.img off the DVD as well as the &#8220;kernels&#8221; directory into /tftpboot in their entirety. You should be able to actually boot the Slackware initrd at this point, and run any of the setup aps you want. We however, are going to do a lot more with it. This will come in part II where we will tweak it to our means. The cool thing about this initrd is that it has an SSH server as well as an SSH client built into it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/uncategorized/setting-up-a-linux-console/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending LVM across multiple disks</title>
		<link>http://sudomakeinstall.com/linux-systems/extending-lvm-across-multiple-disks</link>
		<comments>http://sudomakeinstall.com/linux-systems/extending-lvm-across-multiple-disks#comments</comments>
		<pubDate>Tue, 08 Mar 2011 18:29:16 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=548</guid>
		<description><![CDATA[Had a situation arise yesterday where a coworker was wanting to extend an LVM Volume Group across two disks. It&#8217;s actually really simple to do. The first thing we do is use vgdisplay to show original info for the Volume Group. Notice how when you look at this, the Free PE Size is 0MB. [root@nfsen01 [...]]]></description>
			<content:encoded><![CDATA[<p>Had a situation arise yesterday where a coworker was wanting to extend an LVM Volume Group across two disks. It&#8217;s actually really simple to do.</p>
<p>The first thing we do is use vgdisplay to show original info for the Volume Group. Notice how when you look at this, the Free PE Size is 0MB.</p>
<p>[root@nfsen01 ~]# vgdisplay<br />
&#8212; Volume group &#8212;<br />
VG Name               VolGroup00<br />
System ID<br />
Format                lvm2<br />
Metadata Areas        1<br />
Metadata Sequence No  3<br />
VG Access             read/write<br />
VG Status             resizable<br />
MAX LV                0<br />
Cur LV                2<br />
Open LV               2<br />
Max PV                0<br />
Cur PV                1<br />
Act PV                1<br />
VG Size               2.88 GB<br />
PE Size               32.00 MB<br />
Total PE              92<br />
Alloc PE / Size       92 / 2.88 GB<br />
Free  PE / Size       0 / 0<br />
VG UUID              XXXXXXXXXXXXXXXXXXXXXXXXXX</p>
<p>Assuming you are using sdb1 as your drive, and that you have LVM set up as the partition type on it already extending the Volume Group is as simple as:</p>
<p>vgextend VolGroup00 /dev/sdb1</p>
<p>And this will extend the volume across the entire disk. You should be able to run vgdisplay again and see your free PE size went up.</p>
<p>What you have to do next is extend the Logical Volume for the disk. This is optional depending on your objectives, if you wanted a common VG and wanted to create new volumes you can do it at your convenience now.</p>
<p>lvextend -L +931.51G /dev/mapper/VolGroup00-LogVol00</p>
<p>Assuming you&#8217;re running EXT3 you would use this command. For other file systems on top of LVM your milage may vary; Consult your documentation.</p>
<p>resize2fs /dev/mapper/VolGroup00-LogVol00 -p</p>
<p>After this is done you should be able to use df -h on the drive, and see your partition has been enlarged. This can even be done while the system is active, there&#8217;s no need for any boot CDs or the likes.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/extending-lvm-across-multiple-disks/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some Perl for entering IPs into a database</title>
		<link>http://sudomakeinstall.com/linux-systems/541</link>
		<comments>http://sudomakeinstall.com/linux-systems/541#comments</comments>
		<pubDate>Sat, 05 Mar 2011 18:07:34 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=541</guid>
		<description><![CDATA[This code is proof of concept, if you want to use it in a production environment I suggest you go over it heavily. For a person fairly new to perl there is a lot going on here that you may find useful. The overall idea is to convert IPs from dotted quad decimal numbers into [...]]]></description>
			<content:encoded><![CDATA[<p>This code is proof of concept, if you want to use it in a production environment I suggest you go over it heavily. For a person fairly new to perl there is a lot going on here that you may find useful. The overall idea is to convert IPs from dotted quad decimal numbers into binary then store them in a database. Because IPs can&#8217;t be duplicated on machines or it will cause a conflict, it is in general going to be a good value to have as a primary key. Feel free to use and adapt this code as you see fit. The end result should be something like:</p>
<p>&nbsp;</p>
<p>mysql&gt; select * from IPs;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| ip_address                       | netmask                          | computer_name            |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| 11000000101010000000001000000101 | 11111111111111111111111100000000 | control.frontandback.net |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
1 row in set (0.00 sec)</p>
<p>#/usr/bin/perl</p>
<p>#IP2DB 0.1.0 (C) Febuary 2011 Howard A Underwood II<br />
#Free for use and modification under the Creative Commons 1.0 License. If you want to give me a shout out try aunderwoodii#at#gmail.com<br />
#The purpose of this code is to convert an IP address and netmask pair into Binary to make it easily stored in the database in a processable manner. This is only for IPV4 atm and is just a proof of concept, I&#8217;d love to see your adaptations to real world applications. Feel free to give me your feedback at the above address.</p>
<p>#This requires DBI and DBD::MySQL. Use CPAN or your package manager of choice to get them.<br />
use DBI;<br />
use DBD::mysql;</p>
<p>#info to connect to the DB server. This assumes that your table is pre-created. If you need to create a database do the following:<br />
#create database ips;<br />
#CREATE TABLE IPs (ip_address BINARY(32) PRIMARY KEY, netmask BINARY(32), computer_name char(200));</p>
<p>$hostname=localhost;<br />
$db=&#8221;ips&#8221;;<br />
$port=&#8221;3306&#8243;;<br />
$user=&#8221;dbuser&#8221;;<br />
$password=&#8221;wouldn&#8217;tyouliketoknow&#8221;;</p>
<p>#info to put into the DB. There&#8217;s the IP here, netmask and the computer name. These variables and the ones above are going to be what you need to use to adapt the script to your needs.<br />
$ip=&#8221;192.168.2.5&#8243;;<br />
$netmask=&#8221;255.255.255.0&#8243;;<br />
$compname=&#8221;control.frontandback.net&#8221;;</p>
<p>#Getting down to business. This first line takes the netmask and breaks it into 4 ocets.<br />
my @netmask = split (/\./, $netmask);<br />
#Now that we have 4 ocets, we process each one into binary. Future modifications include cleaning this code up so that it&#8217;s a loop rather than 4 instances.<br />
$ocetnm0= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $netmask[0]));<br />
$ocetnm1= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $netmask[1]));<br />
$ocetnm2= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $netmask[2]));<br />
$ocetnm3= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $netmask[3]));<br />
#We recombine everything into 1 Binary number after this.<br />
$totalnm= $ocetnm0.$ocetnm1.$ocetnm2.$ocetnm3;<br />
#Just printing the post process # on the TTY for human verification<br />
print &#8220;$totalnm\n&#8221;;</p>
<p>#Now we repeat the process for the IP its self. This will probably get condensed into one instance along with the above code eventually. Once again, not the most efficient way to do it but rather straight forward.<br />
my @ip = split (/\./, $ip);<br />
$ocet0= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $ip[0]));<br />
$ocet1= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $ip[1]));<br />
$ocet2= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $ip[2]));<br />
$ocet3= unpack(&#8220;B*&#8221;, pack(&#8220;C&#8221;, $ip[3]));<br />
$total= $ocet0.$ocet1.$ocet2.$ocet3;<br />
print &#8220;$total\n&#8221;;</p>
<p>#Basic DBI connection code. We are using the DBI script to connect to the databse<br />
$dsn = &#8220;DBI:mysql:database=$db;host=$hostname;port=$port&#8221;;<br />
$DBIconnect = DBI-&gt;connect($dsn, $user, $password)<br />
#If we don&#8217;t like what we see bail out because we can&#8217;t connect.<br />
or die &#8220;Connection denied to database $db \n;&#8221;;<br />
#Add the entry to the table. Please note that if you use the above table it will probably not let you run this more than once for any given IP.<br />
eval { $DBIconnect-&gt;do(&#8220;INSERT INTO IPs (ip_address,netmask,computer_name) VALUES (&#8216;$total&#8217;,'$totalnm&#8217;,'$compname&#8217;);&#8221;) };<br />
print &#8220;Data not added to the database: $@\n&#8221; if $@;</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/541/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Sword of SEO part II</title>
		<link>http://sudomakeinstall.com/linux-systems/the-sword-of-seo-part-ii</link>
		<comments>http://sudomakeinstall.com/linux-systems/the-sword-of-seo-part-ii#comments</comments>
		<pubDate>Thu, 24 Feb 2011 17:56:50 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=535</guid>
		<description><![CDATA[Well, it&#8217;s been a long time since I posted the first article on this. My time or lack thereof got the best of me. To counter this attack is actually very very easy. The first thing you do is you find out who is the referrer. This is simply done by tailing the logs. If [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s been a long time since I posted the first article on this. My time or lack thereof got the best of me. To counter this attack is actually very very easy. The first thing you do is you find out who is the referrer. This is simply done by tailing the logs. If you have a single domain, this can be fairly easy. Otherwise my preferred method involves using &#8220;watch ls -l&#8221; and seeing which log grows the fastest. This tends to be the one getting hit, or a likely suspect. I will probably write a perl script later to check this and tell me which log grows the most in say 10 seconds eventually. After this, you can use tail in the manner of:</p>
<p>tail -f /etc/httpd/domlogs/domain.log</p>
<p>When you do this, you will see what IPs are querying the page and the source they are being referred from. Look for any thing that doesn&#8217;t look like a search engine. To actually block them after they are identified what you do is you block the attack based on a referrer in the .htaccess. See the convenient rewrite code I jacked off another web site (about the same I did when I really saw the attack.)</p>
<p>RewriteEngine on<br />
# Options +FollowSymlinks<br />
RewriteCond %{HTTP_REFERER} attacker\.com [NC]<br />
RewriteRule .* &#8211; [F]</p>
<p>So, why does this work you may ask? In the case of the scenario I saw the person was attacking a &#8220;high value&#8221; target. This means a page that hits the database and has dynamically generated content with no caching. Server side configuration CAN make these sort of attacks a lot harder to perpetrate as well. Anything that you can do to increase the robustness of a server will help with a DoS. When you add a rule like this where it denies access to the referrer basically what happens is you pull up static content instead. Static content uses virtually no resources compared to something PHP based and backed by a databse. It&#8217;s a good idea to know about this sort of attack, as I could see it being bigger in the future. Black hat SEO is very common these days, and if you have the SEO part down the resources to do the rest of this attack are virtually nothing compared to what it does. It could also be plausible we will see this attack combined with &#8220;conventional, network level&#8221; type DoSing to increase its effectiveness.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/the-sword-of-seo-part-ii/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another basic shell script</title>
		<link>http://sudomakeinstall.com/linux-systems/another-basic-shell-script</link>
		<comments>http://sudomakeinstall.com/linux-systems/another-basic-shell-script#comments</comments>
		<pubDate>Wed, 23 Feb 2011 04:23:46 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=531</guid>
		<description><![CDATA[The great thing about shell scripts is that they are a great way to solve complex problems that can cost you a lot of time to do manually. To this end, I had a client that needed some videos encoded on his server that didn&#8217;t encode properly. For an experienced script writer this would take [...]]]></description>
			<content:encoded><![CDATA[<p>The great thing about shell scripts is that they are a great way to solve complex problems that can cost you a lot of time to do manually. To this end, I had a client that needed some videos encoded on his server that didn&#8217;t encode properly. For an experienced script writer this would take about 5 minutes to write. It also makes it so that if the client wants to use it they can. The configuration was nice because the input and output file name was the same, just the extension was different. This is not very polished, if it were I would</p>
<p>A)run it as the same user</p>
<p>B)Put it in the user&#8217;s homedir</p>
<p>C)Make it so that it was password protected and executable via PHP script so the user wouldn&#8217;t require any bash experience at all but could upload a list via FTP and just run it.</p>
<p>#!/bin/bash</p>
<p>for video in `cat /root/list.txt` #We will run a loop where each line in list.txt is run as a variable $video.<br />
do<br />
mv /home/user/public_html/media/videos/flv/$video.flv /home/user/public_html/media/videos/flv/$video.flv.old #back up old files<br />
ffmpeg -y -b 1500 -r 25 -i  /home/gogreenc/public_html/media/videos/vid/$video.* -f flv -s 640&#215;480 -deinterlace -ac 1 -ar 41400 /home/user/public_html/media/videos/flv/$video.flv #encode new file, 640X480 out, FLV format deinterlaced.<br />
chown user:user /home/user/public_html/media/videos/flv/$video.flv #chown to the right user. Not required if running as the right user.<br />
done</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/another-basic-shell-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A quickie MySQL backup script</title>
		<link>http://sudomakeinstall.com/linux-systems/a-quickie-mysql-backup-script</link>
		<comments>http://sudomakeinstall.com/linux-systems/a-quickie-mysql-backup-script#comments</comments>
		<pubDate>Tue, 22 Feb 2011 04:31:17 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=529</guid>
		<description><![CDATA[I&#8217;ve seen my fair share of clients that need basic MySQL backups but have no control panel or don&#8217;t want to bother with Control panel based backups. This is a really simple setup that lets you do DB backups and put them in a local directory of the server. It would likely be easily modified [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen my fair share of clients that need basic MySQL backups but have no control panel or don&#8217;t want to bother with Control panel based backups. This is a really simple setup that lets you do DB backups and put them in a local directory of the server. It would likely be easily modified to rsync to another server as well if you wanted to. There are a ton of options that could be added to this, your imagination (and shell scripting capacity) are the only limitations. Some suggestions I have would be</p>
<p>-Mail on success or failure and on old file deletion</p>
<p>-Connect to a remote DB</p>
<p>-Monitor the overall size</p>
<p>Well enough with the abstract, on to the shell!</p>
<p>#!/bin/bash<br />
date=`date +%Y%m%d`<br />
mysqldump &#8211;all-databases &gt; /mysqlbackups/mysql-$date.sql<br />
find /mysqlbackups/ -atime +30 -delete</p>
<p>If you notice, this takes up all of 4 lines. The first one is the she-bang, the second is establishing the date time stamp, the third dumps the databases and the last one purges any old backups. The only real variable you have to change here is the &#8220;+30&#8243; so that it is the number of days you want to retain the backups for minus one.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/a-quickie-mysql-backup-script/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Did you know tw_cli has performance monitoring??</title>
		<link>http://sudomakeinstall.com/servers/did-you-know-tw_cli-has-performance-monitoring</link>
		<comments>http://sudomakeinstall.com/servers/did-you-know-tw_cli-has-performance-monitoring#comments</comments>
		<pubDate>Fri, 10 Dec 2010 03:43:29 +0000</pubDate>
		<dc:creator>Tyler Bishop</dc:creator>
				<category><![CDATA[Servers]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=520</guid>
		<description><![CDATA[Yep title says it all, you can actually monitor individual disk performance with tw_cli. First we need to enable performance monitoring: tw_cli /c0 set dpmstat=on Now we will show the information its providing. tw_cli /c0 show dpmstat  type=ra Drive Performance Monitor Configuration for /c0 ... Performance Monitor: ON Version: 1 Max commands for averaging: 100 [...]]]></description>
			<content:encoded><![CDATA[<p>Yep title says it all, you can actually monitor individual disk performance with tw_cli.</p>
<p>First we need to enable performance monitoring:</p>
<pre>tw_cli /c0 set dpmstat=on
</pre>
<p>Now we will show the information its providing.</p>
<pre>tw_cli /c0 show dpmstat  type=ra
Drive Performance Monitor Configuration for /c0 ...
Performance Monitor: ON
Version: 1
Max commands for averaging: 100
Max latency commands to save: 10
Requested data: Running Average Drive Statistics

 Queue           Xfer         Resp
Port   Status           Unit   Depth   IOPs    Rate(MB/s)   Time(ms)
------------------------------------------------------------------------
p0     OK               u0     22      23      0.479        11
p1     OK               u0     24      93      1.344        12
p2     OK               u0     25      82      0.720        14
p3     OK               u0     24      83      1.108        16
</pre>
<p><strong>BE SURE TO TURN OFF PERFORMANCE MONITORING WHEN YOU ARE DONE!</strong></p>
<pre>tw_cli /c0 set dpmstat=off</pre>
<p>Different performance results:</p>
<p>This command only applies to 9000 series SX/SE/SA controllers, except for<br />
type=ext, which applies only to SE/SA models.</p>
<p>This command allows you to request drive statistics of the specified type for<br />
the specified port. These statistics can be helpful when troubleshooting<br />
performance problems.</p>
<p><strong>type=</strong> specifies which statistics should be displayed. The options are: inst for<br />
Instantaneous, ra for Running Average, lct for Long Command Times,<br />
histdata for Histogram Data, and ext for Extended Drive Statistics.</p>
<p><strong>inst (Instantaneous).</strong> This measurement provides a short duration average.<br />
ra (Running Average). Running average is a measure of long-term averages<br />
that smooth out the data, and results in older results fading from the average<br />
over time.</p>
<p><strong>ext (Extended Drive Statistics).</strong> The extended drive statistics refers to<br />
statistics of a drive&#8217;s read commands, write commands, write commands with<br />
FUA (Force Unit Access), flush commands, and a drive sectors&#8217;s read, write,<br />
and write commands with FUA.</p>
<p><strong>lct (Long Command Times)</strong>. This a collection of the commands with the<br />
longest read/write response time.</p>
<p><strong>histdata (Histogram Data).</strong> The histogram categorizes the read/write<br />
execution times and group them together based on time frames.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/servers/did-you-know-tw_cli-has-performance-monitoring/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The sword of SEO</title>
		<link>http://sudomakeinstall.com/linux-systems/the-sword-of-seo</link>
		<comments>http://sudomakeinstall.com/linux-systems/the-sword-of-seo#comments</comments>
		<pubDate>Mon, 22 Nov 2010 19:49:38 +0000</pubDate>
		<dc:creator>Alex Underwood</dc:creator>
				<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Linux Systems]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SEO (Search Engine Optimization)]]></category>

		<guid isPermaLink="false">http://sudomakeinstall.com/?p=506</guid>
		<description><![CDATA[I was on a client server getting attacked, the DoS was heavily distributed. Since he&#8217;d mentioned something about someone linking to his web site, I was poking through the Apache logs. I noticed that one site was generating a huge amount of referrals. Investigating deeper, Ifound this on the referral site: &#60;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; [...]]]></description>
			<content:encoded><![CDATA[<p>I was on a client server getting attacked, the DoS was heavily distributed. Since he&#8217;d mentioned something about someone linking to his web site, I was poking through the Apache logs. I noticed that one site was generating a huge amount of referrals. Investigating deeper, Ifound this on the referral site:</p>
<p>&lt;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; &gt;&lt;/iframe&gt;<br />
0&lt;br&gt;&lt;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; &gt;&lt;/iframe&gt;<br />
1&lt;br&gt;&lt;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; &gt;&lt;/iframe&gt;<br />
2&lt;br&gt;&lt;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; &gt;&lt;/iframe&gt;<br />
3&lt;br&gt;&lt;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; &gt;&lt;/iframe&gt;</p>
<p>&#8230;&#8230;.</p>
<p>30&lt;br&gt;&lt;iframe src=&#8221;http://www.domain.com&#8221; width=&#8221;1&#8243; height=&#8221;1&#8243; &gt;&lt;/iframe&gt;</p>
<p>This is one of the slicker DoSes I&#8217;ve seen in a while. Because of the way it was set up it would be very difficult if not impossible to block on a network level and not traceable back to any particular IP on a network level (read:iptables, RTG or hardware firewall.) Within a few assumptions here this is what I believe to happen:</p>
<p>-Person sets up a web site with just a park page etc. on it.<br />
-Person directs traffic to this using SEO. (back links, etc) to gain it status on search engines<br />
-Person puts up the attack page similar to the above<br />
-Every time a person from a search engine clicks the link, they load a few dozen copies of the page<br />
-The iframe points to a &#8220;high value&#8221; target that generates a lot of load on the server, such as a forum or other dynamic content.</p>
<p>I personally saw this attack decimate a late model server with 16GB of RAM with enough IP distribution that it was not plausible to block it. It is viciously effective when planned out and done properly. It can also be done with virtually NO resources using a free shared hosting account. The person who loads it probably never realized they just made an attack on a server either. The plus side is that if you track it you can limit the damage done very easily provided you know what you are looking for. That will be my next blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://sudomakeinstall.com/linux-systems/the-sword-of-seo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
