<?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>Rob Garth &#187; debian</title>
	<atom:link href="http://blog.sumostyle.net/robg/tag/debian/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sumostyle.net/robg</link>
	<description>Mildly Useful Stuff</description>
	<lastBuildDate>Fri, 12 Aug 2011 00:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Backup/Restore remote disk images.</title>
		<link>http://blog.sumostyle.net/robg/2011/03/09/backuprestore-remote-disk-images/</link>
		<comments>http://blog.sumostyle.net/robg/2011/03/09/backuprestore-remote-disk-images/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 03:28:22 +0000</pubDate>
		<dc:creator>robg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fedora]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[restore]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sumostyle.net/robg/?p=515</guid>
		<description><![CDATA[There are occasion when backing up data is not enough. You may want a snapshot of your whole system. There are some great tools out there like Clonezilla, which in turn uses partdisk, or Ghost if you don&#8217;t mind closed source. But you can do this using tools almost certainly available even in the most [...]]]></description>
			<content:encoded><![CDATA[<div>There are occasion when backing up data is not enough. You may want a snapshot of your whole system. There are some great tools out there like Clonezilla, which in turn uses partdisk, or Ghost if you don&#8217;t mind closed source. But you can do this using tools almost certainly available even in the most minimal of linux installs.</div>
<div></div>
<div><strong>Caveats:</strong></div>
<div>
<ul>
<li>The image is easily restorable to the hardware it was created on. If you restore to another computer it will create unexpected issues. Usually fixable by creating a new initrd</li>
<li>The partition sizes are fixed and must be restored to a harddrive of equal or larger size.</li>
<li>dd creates a byte level copy of your harddrive, empty space is included in the backup. Without gzip a 160GB disk will create a 160GB disk image. With Gzip the image will still be very large.</li>
</ul>
<h3><a name="Creatingafullbackupimageofalinuxbox-BackupimagetoanotherLinuxmachine"></a>Backup image to another Linux machine</h3>
<p>If you have a Linux workstation with a large enough hard-drive you can simply backup and restore across the network. You will need root access to both boxes. Netcat is also available for Windows and Mac.</p>
<p><strong>1. On the Destination</strong> <em>Where you are storing the backup</em></p>
<p>In this example /dev/sda is the harddrive you want to backup/restore. Make sure you choose the correct harddrive.</p>
<div>
<div>
<pre> # nc -l 1010 &gt; harddrive.img.gz</pre>
</div>
</div>
<p><strong>2. On the source computer</strong> <em>The machine being backed-up</em></p>
<div>
<div>
<pre># dd if=/dev/sda | gzip -cf | nc -q 10 xxx.xxx.xxx.xxx 1010</pre>
</div>
</div>
<h3><a name="Creatingafullbackupimageofalinuxbox-RestoreimageformanotherLinuxmachine"></a>Restore image form another Linux machine</h3>
<p><strong>1. On the Targe</strong> <em>The machine you are restoring to</em></p>
<ul>
<li>You will need to boot into a live image, I suggest Ubuntu, from USB or a CD.</li>
<li>From the now booted, live operating system:<br />
<span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; white-space: pre;"># nc -l 1010 | gzip -dcf | dd of=/dev/sda</span></li>
</ul>
<p><strong>2. On the Source machine</strong> <em>The machine with the image saved</em></p>
<div>
<div>
<pre># nc -q 10 xxx.xxx.xxx.xxx 1010 &lt; harddrive.img.gz</pre>
</div>
</div>
</div>
<div id="labels-section">
<div>
<form id="add-labels-form" action="http://wiki.inside.nicta.com.au/display/DLGHTH/Creating+a+full+backup+image+of+a+linux+box" method="GET"></form>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumostyle.net/robg/2011/03/09/backuprestore-remote-disk-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simpana, Galaxy and Debian</title>
		<link>http://blog.sumostyle.net/robg/2011/02/21/simpana-galaxy-and-debian/</link>
		<comments>http://blog.sumostyle.net/robg/2011/02/21/simpana-galaxy-and-debian/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 02:56:06 +0000</pubDate>
		<dc:creator>robg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[simpana]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.sumostyle.net/robg/?p=505</guid>
		<description><![CDATA[This post is not particular generic and will only affect a few, but I will write it because the problem caused me huge frustration, and much time was wasted. We currently use CommVault for backup and the Galaxy agent to make it work with Linux. I had a freshly installed Linux box which simply would not back [...]]]></description>
			<content:encoded><![CDATA[<p>This post is not particular generic and will only affect a few, but I will write it because the problem caused me huge frustration, and much time was wasted.</p>
<p>We currently use CommVault for backup and the Galaxy agent to make it work with Linux. I had a freshly installed Linux box which simply would not back up. The Controller and agent could communicate and there were no errors raised on either. Every time a backup was run, the scan would work, but as soon as data transfer was ready a communication error was raised.</p>
<p>It turns out that a clean install of Debina/Ubuntu adds an entry for your FQDN which point to 127.0.1.1. This is included for machines which swap networks and possibly hostnames form time to time (think laptops) so app suites like GNOME still work. It is also, in my opinion, stupid.</p>
<p>This entry was breaking Galaxy. I can only guess what was happening as it is  a closed source suite. But I think at some point in the backup process, even though communication is already happening, the agent gives the Controller the IP address to talk to. As the hosts file had a pointer to a localhost IP, this IP address was handed back to the Controller. and everything breaks.</p>
<p>So simple lesson, if you have a Debian/Ubuntu machine with static networking, replace the 127.0.1.1 entry in /etc/hosts for the FQDN to the real IP address.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumostyle.net/robg/2011/02/21/simpana-galaxy-and-debian/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN server with Username and Password auth</title>
		<link>http://blog.sumostyle.net/robg/2010/02/25/ovpn-server/</link>
		<comments>http://blog.sumostyle.net/robg/2010/02/25/ovpn-server/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 10:45:16 +0000</pubDate>
		<dc:creator>robg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.sumostyle.net/robg/?p=442</guid>
		<description><![CDATA[I did this on Debian but these instruction should work equally well for Ubuntu Setup IP Forwarding/Masquerading/Firewall To turn on IP Forwarding: # echo 1 &#62; /proc/sys/net/ipv4/ip_forward Set the change permanantly in /etc/sysctl.conf by uncommenting the line: net.ipv4.ip_forward=1 To turn on IP Masquerading add the following IP Tables rule: # iptables --table nat --append POSTROUTING [...]]]></description>
			<content:encoded><![CDATA[<p>I did this on Debian but these instruction should work equally well for Ubuntu<br />
<span id="more-442"></span></p>
<h4>Setup IP Forwarding/Masquerading/Firewall</h4>
<p><strong>To turn on IP Forwarding:</strong><br />
<code># echo 1 &gt; /proc/sys/net/ipv4/ip_forward</code></p>
<p>Set the change permanantly in /etc/sysctl.conf by uncommenting the line:<br />
<code>net.ipv4.ip_forward=1</code></p>
<p><strong>To turn on IP Masquerading add the following IP Tables rule:</strong></p>
<p><code># iptables --table nat --append POSTROUTING \<br />
--out-interface eth0 --jump MASQUERADE</code></p>
<p><strong>Firewall</strong><br />
If you are running a firewall, and I strongly recommend you do on a public facing box you need to allow UDP on port 1194 into you box.<br />
<code># iptables -A INPUT -udp -m udp --dport 1194 -j ACCEPT</code></p>
<p>But these rules need be persistant so we need to create a script to run when the interface starts up</p>
<p><code># iptables-save &gt; /etc/iptables.conf</code></p>
<p>Create a new file: /etc/network/if-up.d/iptables and paste in the following:</p>
<p><code>#!/bin/sh<br />
/sbin/iptables-restore &lt; /etc/iptables.conf</code></p>
<p>Set it to executable:<br />
<code># chmod 755 /etc/network/if-up.d/iptables</code></p>
<p>Now when networking starts the firewall is brought up. If all you have done is what is above, your box is not really firewalled, as no traffic is dropped or blocked. For a basic firewall the following config, forwards everything, allows bind internally and only allows SSH and OpenVPN on the external interface.</p>
<p>/etc/iptables.conf (example):</p>
<pre>#
*nat
&#58;PREROUTING ACCEPT [36:18250]
&#58;POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [12:806]
-A POSTROUTING -o eth0 -j MASQUERADE
COMMIT
#
*filter
:INPUT ACCEPT [19:1037]
:FORWARD ACCEPT [420:191307]
:OUTPUT ACCEPT [314:39042]
# Allow everything on loopback
-A INPUT -i lo -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
# Allow already established connections
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# Allow SSH
-A INPUT -p tcp -m tcp --dport 22 -m state --state NEW -j ACCEPT
# Allow DNS to this machine fron the private network
# (If you plan to run you own DNS, I run dns_masq)
-A INPUT -p tcp --dport 53 -s 10.8.0.0/16 -j ACCEPT
# Allow OpenVPN
-A INPUT -p udp -m udp --dport 1194 -j ACCEPT
# DROP the rest
-A INPUT -i eth0 -j DROP
COMMIT
#</pre>
<h4>Setup Open VPN</h4>
<p><strong>Installation</strong></p>
<p>Install OpenVPN:</p>
<p><code># aptitude install openvpn openssl<br />
</code></p>
<p>Edit /etc/default/openvpn. Comment all lines, and add:</p>
<p><code>AUTOSTART="openvpn"</code></p>
<p><strong>Create Certificates and Keys</strong></p>
<p>On you server as root:</p>
<p><code># cd /etc/openvpn</code></p>
<p>Copy the the following directory</p>
<p><code># cp -r /usr/share/doc/openvpn/examples/easy-rsa .<br />
# cd easy-rsa/2.0/</code></p>
<p>Edit the file &#8220;vars&#8221;. Change the default values at the bottom of the file to match your details.</p>
<p>Import you ssl settings:<br />
<code># . ./vars</code></p>
<p>run: <code># ./cleann-all</code>. Do not run this every time as it will remove all existing certificates.</p>
<p>Create your Certificate Authority</p>
<p><code># ./build-ca</code></p>
<p>Give it a sensible common-name, something like: &#8220;OpenVPN CA&#8221;</p>
<p>Now build the key and certificate for you server</p>
<p><code># ./build-key-server server</code></p>
<p>Set the common name to &#8220;server&#8221;</p>
<p>Answer yes to signing the certificate and commiting it.</p>
<p>Now let&#8217;s create Diffie Hellman parameters:</p>
<p><code># ./build-dh</code></p>
<p>Most other guides now get you to generate client certs, but we are using  username and password authentication so we do not need to do this.</p>
<p><strong>Configure OpenVPN</strong></p>
<p>Edit the file /etc/openvpn/openvpn.conf and add the following (the comments are unnecessary they are just there for explanation):</p>
<pre>
    dev tun
    ## udp is recommended, avoid TCP over TCP
    proto udp
    ## any port will do, this is the standard
    port 1194 

    ## certs we created earlier
    ca /etc/openvpn/easy-rsa/2.0/keys/ca.crt
    cert /etc/openvpn/easy-rsa/2.0/keys/server.crt
    key /etc/openvpn/easy-rsa/2.0/keys/server.key
    dh /etc/openvpn/easy-rsa/2.0/keys/dh1024.pem

    user nobody
    group nogroup
    ## You can make this any private subnet you like
    server 10.8.0.0 255.255.255.0

    persist-key
    persist-tun

    #status openvpn-status.log
    #verb 3
    client-to-client

    ## make this connection the default gateway for network traffic
    push "redirect-gateway def1"
    ## I am running dns_masq, you may want to put your server's DNS here
    ## or even google: 8.8.8.8
    push "dhcp-option DNS 10.8.0.1"

    log-append /var/log/openvpn

    ## User authentication settings. Usernames must be able to authenticate with PAM
    ## To use radius or another auth mechanism create /etc/pam.d/openvpn
    ## by default it is doing common-auth (a user must have a local accout and pasword)
    plugin /usr/lib/openvpn/openvpn-auth-pam.so login
    client-cert-not-required
    username-as-common-name

    ## A management interface allows you to telnet from local host to use
    ## telnet localhost 7505
    management localhost 7505
</pre>
<p>Restart OpenVPN: <code># /etc/init.d/openvpn restart</code></p>
<p>So this is the server done. We haven&#8217;t configured anything to connect to it yet.<br />
Client how-to comming up next time.</p>
<p><strong>Update.</strong> <em>Client how-to is <a href="http://blog.sumostyle.net/robg/2010/03/01/ovpn-client/">available</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumostyle.net/robg/2010/02/25/ovpn-server/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Lenny, Icedove and teeny tiny fonts</title>
		<link>http://blog.sumostyle.net/robg/2010/01/20/lenny-icedove-and-teeny-tiny-fonts/</link>
		<comments>http://blog.sumostyle.net/robg/2010/01/20/lenny-icedove-and-teeny-tiny-fonts/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 22:59:25 +0000</pubDate>
		<dc:creator>robg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[icedove]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[thunderbird]]></category>

		<guid isPermaLink="false">http://blog.sumostyle.net/robg/?p=419</guid>
		<description><![CDATA[You know the font situation on debian and gnome isn&#8217;t terrible in lenny. Actually it looks fairly decent. Until you load icedove (thunderbird). The fonts are teeny, pixelated and hard to read. Luckily it is a very easy fix. Open icedove, go to &#8220;Edit -&#62; Preference -&#62; Advanced -&#62; Config Editor&#8221; Change the value for [...]]]></description>
			<content:encoded><![CDATA[<p>You know the font situation on debian and gnome isn&#8217;t terrible in lenny. Actually it looks fairly decent. Until you load icedove (thunderbird).</p>
<p>The fonts are teeny, pixelated and hard to read. Luckily it is a very easy fix.</p>
<p>Open icedove, go to &#8220;<strong>Edit -&gt; Preference -&gt; Advanced -&gt; Config Editor</strong>&#8221;</p>
<p>Change the value for &#8220;<strong>layout.css.dpi</strong>&#8221; from &#8220;-1&#8243; to &#8220;0&#8243;</p>
<p>Restart icedove</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumostyle.net/robg/2010/01/20/lenny-icedove-and-teeny-tiny-fonts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up pptpd on debian (lenny)</title>
		<link>http://blog.sumostyle.net/robg/2010/01/01/setting-up-pptpd-on-debian-lenny/</link>
		<comments>http://blog.sumostyle.net/robg/2010/01/01/setting-up-pptpd-on-debian-lenny/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 01:22:33 +0000</pubDate>
		<dc:creator>robg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[lenny]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[poptop]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.sumostyle.net/robg/?p=395</guid>
		<description><![CDATA[There are other giudes to do this, but none seemed complete, I had to get the iptables rules from the debug document on poptop.org. I guess they are not always needed. I started with a clean install of lenny from http://rackspacecloud.com. Install poptop # aptitude install pptpd Edit pptpd config files /etc/pptpd.conf You need to [...]]]></description>
			<content:encoded><![CDATA[<p>There are other giudes to do this, but none seemed complete, I had to get the iptables rules from the debug document on poptop.org. I guess they are not always needed.<br />
<span id="more-395"></span></p>
<p>I started with a clean install of lenny from http://rackspacecloud.com.</p>
<p><strong>Install poptop</strong></p>
<p><code># aptitude install pptpd</code></p>
<p><strong>Edit pptpd config files</strong></p>
<p><strong>/etc/pptpd.conf</strong></p>
<p>You need to set the private ip of the server and the ip range for clients, the 2 lines are added to this file:</p>
<p><code>localip 192.168.0.1<br />
remoteip 192.168.0.10-20</code></p>
<p>Set them to whatever private (or public) ip addressing you want. You could use IP addresses currently available in your network, if you do this you will not need to add the iptables rules for natting later in this guide.</p>
<p><strong>/etc/ppp/pptpd-options</strong></p>
<p><em>Option 1</em><br />
Set ms-wins and ms-dns to the name server the server you are currently working on is using (look in reolv.conf).</p>
<p><em>Option 2</em><br />
Or as I did install dnsmasq on the server and run it as a chaching dns server<br />
<code><br />
# aptitude install dnsmasq</code></p>
<p>And then set ms-dns and ms-wins to 192.168.0.1 (or the localip you set)</p>
<p><strong>/etc/ppp/chap-secrets</strong></p>
<p>Setup users and passwords to connect the pptp server</p>
<p><code>username	 pptpd	 somepassword		*</code></p>
<p><strong>Turn on IP Forwarding</strong></p>
<p><code># echo 1 &gt; /proc/sys/net/ipv4/ip_forward</code></p>
<p>Set the change permanantly in /etc/sysctl.conf by uncommenting the line:</p>
<p><code>net.ipv4.ip_forward=1</code></p>
<p><strong>Turn on NATing</strong></p>
<p>If you have created a new private network for your pptpd server, you probably have, you need to add a rule to iptables.</p>
<p><code># iptables --table nat --append POSTROUTING \<br />
--out-interface eth0 --jump MASQUERADE</code></p>
<p>But this rule needs be persistant so we need to create a script to run when the interface starts up</p>
<p><code># iptables-save &gt; /etc/iptables.conf</code></p>
<p>Create a new file: /etc/network/if-up.d/iptables and paste in the following</p>
<p><code>#!/bin/sh<br />
/sbin/iptables-restore &lt; /etc/iptables.conf</code></p>
<p>Set it to executable<br />
<code># chmod 755 /etc/network/if-up.d/iptables</code></p>
<p>All Done!. Just startup pptpd</p>
<p><code># /etc/init.d/pptpd start</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumostyle.net/robg/2010/01/01/setting-up-pptpd-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Moving host</title>
		<link>http://blog.sumostyle.net/robg/2010/01/01/moving-host/</link>
		<comments>http://blog.sumostyle.net/robg/2010/01/01/moving-host/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 22:21:17 +0000</pubDate>
		<dc:creator>robg</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nocleanfeed]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.sumostyle.net/robg/?p=390</guid>
		<description><![CDATA[I am thinking of moving host again. I have no issues with dreamhost, but I have been playing with the rackspace cloud, and I like it. I can have my own virtual machine, lowest specs, for abut the same price as dreamhost each month. And since it is my own box I can do whatever [...]]]></description>
			<content:encoded><![CDATA[<p>I am thinking of moving host again. I have no issues with dreamhost, but I have been playing with the rackspace cloud, and I like it.</p>
<p>I can have my own virtual machine, lowest specs, for abut the same price as dreamhost each month. And since it is my own box I can do whatever I like with it.</p>
<p>If this site got more hits, and I had to increase the specs, dreamhost would be cheaper, but no one comes here so rackspace will work super.</p>
<p>More importantly this lets me setup a vpn server outside of Australia. While I find it very unlikely that I will ever go to a site banned by the government&#8217;s filtering scheme, my protest is to simply bypass it.</p>
<p><a href="http://nocleanfeed.com/">http://nocleanfeed.com/</a></p>
<p>The move will happen over the next few weeks as I find time to install wordpress on debian and get it configured and hardened. The DNS will be staying on dreamhost, so I doubt any changes will be noticed.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sumostyle.net/robg/2010/01/01/moving-host/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

