<?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>GeekLab</title>
	<atom:link href="http://www.geeklab.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.geeklab.info</link>
	<description></description>
	<lastBuildDate>Sun, 19 Feb 2012 16:21:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Open EPS files with GIMP for Windows</title>
		<link>http://www.geeklab.info/2012/02/open-eps-files-with-gimp-for-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=open-eps-files-with-gimp-for-windows</link>
		<comments>http://www.geeklab.info/2012/02/open-eps-files-with-gimp-for-windows/#comments</comments>
		<pubDate>Sun, 19 Feb 2012 16:21:52 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[EPS]]></category>
		<category><![CDATA[ghostscript]]></category>
		<category><![CDATA[GIMP]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=832</guid>
		<description><![CDATA[<p>To open EPS files on GIMP for Windows, you'll need to install GhostScript. You can download GhostScript <a href="http://sourceforge.net/projects/ghostscript/files/GPL Ghostscript">here</a>. After installing, you'll also need to configure a system environment variable: GS_PROG. This variable must point to the executable, in my case <em>C:\Program Files\gs\gs9.05\bin\gswin32.exe</em>.</p>
<p>Setting the environment variable is done&#8230; <a href="http://www.geeklab.info/2012/02/open-eps-files-with-gimp-for-windows/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>To open EPS files on GIMP for Windows, you'll need to install GhostScript. You can download GhostScript <a href="http://sourceforge.net/projects/ghostscript/files/GPL Ghostscript">here</a>. After installing, you'll also need to configure a system environment variable: GS_PROG. This variable must point to the executable, in my case <em>C:\Program Files\gs\gs9.05\bin\gswin32.exe</em>.</p>
<p>Setting the environment variable is done in the advanced settings of "my computer".</p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/02/open-eps-files-with-gimp-for-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up a PPTP VPN to a Windows 2008 Server</title>
		<link>http://www.geeklab.info/2012/02/setting-up-a-pptp-vpn-to-a-windows-2008-server/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-a-pptp-vpn-to-a-windows-2008-server</link>
		<comments>http://www.geeklab.info/2012/02/setting-up-a-pptp-vpn-to-a-windows-2008-server/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 15:12:51 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Fedora 16]]></category>
		<category><![CDATA[NetworkManager]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=823</guid>
		<description><![CDATA[<h2>Requirements</h2>
<p>Linux<br />
KDE<br />
A Windows server to connect to.</p>
<h2>Step 1: Install required software</h2>
<p>yum install kde-plasma-networkmanagement-pptp NetworkManager-pptp</p>
<h2>Step 2: Configure the network</h2>
<p>In the KDE Network Manager plasma module, go to the tab VPN, click add and choose PPTP.<br />
<img src="http://www.geeklab.info/wp-content/uploads/2012/02/screenshot1.jpeg" alt="" title="screenshot1" width="808" height="575" class="alignnone size-full&#8230; <a href="http://www.geeklab.info/2012/02/setting-up-a-pptp-vpn-to-a-windows-2008-server/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
<p>Linux<br />
KDE<br />
A Windows server to connect to.</p>
<h2>Step 1: Install required software</h2>
<p>yum install kde-plasma-networkmanagement-pptp NetworkManager-pptp</p>
<h2>Step 2: Configure the network</h2>
<p>In the KDE Network Manager plasma module, go to the tab VPN, click add and choose PPTP.<br />
<img src="http://www.geeklab.info/wp-content/uploads/2012/02/screenshot1.jpeg" alt="" title="screenshot1" width="808" height="575" class="alignnone size-full wp-image-833" /></p>
<p>Enter and connection name you like. In the field "gateway" type the hostname or IP number of the Windows server you're connecting to. Under <em>Login</em>, <em>Password</em> and <em>NT Domain</em>, fill in your authentication data. Then click advanced.<br />
<img src="http://www.geeklab.info/wp-content/uploads/2012/02/screenshot2.jpeg" alt="" title="screenshot2" width="459" height="566" class="alignnone size-full wp-image-834" /></p>
<p>In the advanced window, disable EAP and enable MPPE. Then click OK.<br />
<img src="http://www.geeklab.info/wp-content/uploads/2012/02/screenshot3.jpeg" alt="" title="screenshot3" width="299" height="576" class="alignnone size-full wp-image-835" /></p>
<p>Go to the tab IPv4. Under method, I chose <em>Automatic (VPN)</em>. But <em>Automatic (VPN) addresses only</em> is also a nice option: it sets the IPs but no DNS settings.<br />
<img src="http://www.geeklab.info/wp-content/uploads/2012/02/screenshot4.jpeg" alt="" title="screenshot4" width="458" height="563" class="alignnone size-full wp-image-836" /></p>
<p>Go to the routes sub-tab. Switch on <em>Ignore automatically obtained routes</em> and <em>Use only for resources on this connection</em> to make sure the connection doesn't steal your traffic. Then I entered a manual route: 192.168.178.0/255.255.255.0 to gateway 0.0.0.0 (it is a ppp device after all).<br />
<img src="http://www.geeklab.info/wp-content/uploads/2012/02/screenshot5.jpeg" alt="" title="screenshot5" width="459" height="565" class="alignnone size-full wp-image-837" /></p>
<p>You may want to configure IPv6 as well, but I don't at this moment, so I'm not documenting this.</p>
<h2>Step 3: Connect</h2>
<p>Click on the icon in the tray and connect.</p>
<div style='border: 1px solid #555C64; background-color: #efefef; padding:5px;'><h2>Ubuntu/Debian</h2>I'm running RedHat-based software on all of my machines. Above information may be useful for Ubuntu/Debian users, but it's not tested and I'm not supporting it.<br><br><b>Servers:</b> RedHat Enterprise Linux/CentOS is more suitable for servers, as there's a lot of professional level support available. I think that's important, because if I say, get a car accident, I want the servers to be managable by another professional.<br><br><b>Desktops/Laptops:</b> RPM packages are pretty exchangable between RedHat-based platforms. That's a good reason to run Fedora on the desktop.</div><i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/02/setting-up-a-pptp-vpn-to-a-windows-2008-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Squid with active directory authentication on Centos 6.0</title>
		<link>http://www.geeklab.info/2012/01/squid-with-active-directory-authentication-on-centos-6-0/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=squid-with-active-directory-authentication-on-centos-6-0</link>
		<comments>http://www.geeklab.info/2012/01/squid-with-active-directory-authentication-on-centos-6-0/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 12:28:10 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[gai.conf]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NTLM]]></category>
		<category><![CDATA[squid]]></category>
		<category><![CDATA[wbinfo]]></category>
		<category><![CDATA[winbind]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=595</guid>
		<description><![CDATA[<p>In this post, I'll be writing down all steps required to build a Squid proxy server on a clean "minimal" installation of CentOS 6.0</p>
<h2>Step 1. Network configuration</h2>
<p>First, install system-config-network or manually configure the network. I prefer system-config-network for easy configurations and vim for more complex configurations.<br />
<code>yum</code>&#8230; <a href="http://www.geeklab.info/2012/01/squid-with-active-directory-authentication-on-centos-6-0/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>In this post, I'll be writing down all steps required to build a Squid proxy server on a clean "minimal" installation of CentOS 6.0</p>
<h2>Step 1. Network configuration</h2>
<p>First, install system-config-network or manually configure the network. I prefer system-config-network for easy configurations and vim for more complex configurations.<br />
<code>yum -y install system-config-network-tui</code></p>
<h2>Step 2. Install some tools for convenience</h2>
<p><code>yum -y install vim-minimal vim-enhanced openssh-clients mc telnet policycoreutils policycoreutils-python bind-utils</code></p>
<h2>Step 3. Install ntp and synchronize clocks</h2>
<p>If one of the clocks it out of sync, NTLM authentication will not work. Therefore, we synchronize the clocks. Using pool.ntp.org as a source would be good, but if the AD server isn't synchronized with that source, we'd have the same problem. So I'm synchonizing the proxy to the AD server (Win2003SBS actually) instead:<br />
<pre><code>rpm -q ntp || yum -y install ntp<br />
sed -i &quot;s/^server /#server /g&quot; /etc/ntp.conf<br />
echo &quot;server AD-SERVERNAME&quot; &gt;&gt; /etc/ntp.conf<br />
ntpdate AD-SERVERNAME #synchronize right now<br />
service ntpd start #and keep in sync<br />
chkconfig ntpd on</code></pre></p>
<h2>Step 4. Install squid and other required software</h2>
<p><pre><code>yum -y install krb5-workstation samba-common samba-winbind authconfig squid<br />
chkconfig squid on</code></pre></p>
<h2>Step 5. Connect to active directory</h2>
<p>Please note that MYCOMPANY.local and mycompany.local may be different domains due to the upper/lowercase.<br />
<pre><code>ADSERVER=sbs.MYCOMPANY.local<br />
DOMAIN=MYCOMPANY.local<br />
WORKGROUP=MYCOMPANY<br />
authconfig --enableshadow --enablemd5 --passalgo=md5 --krb5kdc=$ADSERVER \<br />
--krb5realm=$DOMAIN --smbservers=$ADSERVER --smbworkgroup=$WORKGROUP \<br />
--enablewinbind --enablewinbindauth --smbsecurity=ads --smbrealm=$DOMAIN \<br />
--smbidmapuid=&quot;16777216-33554431&quot; --smbidmapgid=&quot;16777216-33554431&quot; --winbindseparator=&quot;+&quot; \<br />
--winbindtemplateshell=&quot;/bin/false&quot; --enablewinbindusedefaultdomain --disablewinbindoffline \<br />
--winbindjoin=Administrator --disablewins --disablecache --enablelocauthorize --updateall<br />
service winbind restart<br />
chkconfig winbind on<br />
</code></pre></p>
<p>Give squid permissions to use winbind info:<br />
<code>usermod -G wbpriv squid</code></p>
<p>Now check your winbind connection using the following commands:<br />
<pre><code>wbinfo -u<br />
wbinfo -g</code></pre></p>
<h2>Step 6. Firewall</h2>
<p><pre><code>iptables -I INPUT -m tcp -p tcp --dport 3128 -j ACCEPT<br />
/sbin/service iptables save</code></pre></p>
<h2>Step 7. Configure squid</h2>
<p>I commented out this line from /etc/squid/squid.conf:<br />
<code>http_access allow localnet</code><br />
That line would have allowed users from 10.0.0.0/8+172.16.0.0/12+192.168.0.0/16 and others to use the proxy without authentication. Then I added the following right below that line:<br />
<pre><code>acl whitelist dstdom_regex -i &quot;/etc/squid/whitelist&quot;<br />
http_access allow whitelist<br />
auth_param ntlm program /usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp<br />
auth_param ntlm children 5<br />
auth_param ntlm keep_alive on<br />
acl our_networks src 192.168.0.0/16<br />
acl ntlm proxy_auth REQUIRED<br />
http_access allow our_networks ntlm<br />
authenticate_ip_ttl 900 seconds</code></pre></p>
<p>This will allow all valid, logged in users to surf the web. You could also limit which users can surf by adding <em>--require-membership-of=ADGROUPNAME</em> to the ntlm_auth command</p>
<p>The first two lines of above configuration point to a file /etc/squid/whitelist. This file contains domains that should <b>never</b> be denied. My whitelist file contains:<br />
<pre><code>\.trendmicro\.com<br />
^trendmicro\.com<br />
\.microsoft\.com<br />
^microsoft\.com</code></pre><br />
This means that anything at *.microsoft.com and microsoft.com (without subdomain) as well as *.trendmicro.com as trendmicro.com (my virusscanner) is always allowed for any user. We wouldn't want to block important updates.</p>
<p>Start Squid using <em>/sbin/service squid restart</em> and the proxy is ready.</p>
<h2>Step 8. Optional: IPv6 issues</h2>
<p>I've been experimenting with IPv6 for a while now, but I don't have IPv6 available on all systems. That caused me some trouble with the next step. I had to give preference to IPv4 above IPv6 by editting /etc/gai.conf:<br />
<pre><code>label ::1/128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0<br />
label ::/0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<br />
label 2002::/16&nbsp;&nbsp;&nbsp;&nbsp; 2<br />
label ::/96&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3<br />
label ::ffff:0:0/96 4<br />
label fec0::/10&nbsp;&nbsp;&nbsp;&nbsp; 5<br />
label fc00::/7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6<br />
precedence ::ffff:0:0/96&nbsp;&nbsp;100<br />
precedence ::1/128&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 50<br />
precedence ::/0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;40<br />
precedence 2002::/16&nbsp;&nbsp;&nbsp;&nbsp; 30<br />
precedence ::/96&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;20</code></pre></p>
<h2>Step 9. Optional: Some white- and blacklisting</h2>
<p>We may not want to allow all sites to be visited. For instance, porn sites are often blocked in office situations. I've got a <a href="http://www.geeklab.info/?p=643">manual on blacklisting using SquidGuard</a> as well.</p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/01/squid-with-active-directory-authentication-on-centos-6-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Konsole is hiding underscores</title>
		<link>http://www.geeklab.info/2012/01/konsole-is-hiding-underscores/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=konsole-is-hiding-underscores</link>
		<comments>http://www.geeklab.info/2012/01/konsole-is-hiding-underscores/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 20:22:44 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Fedora 16]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Konsole]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=806</guid>
		<description><![CDATA[<p>Today I upgraded my Fedora 15 installation to Fedora 16 with KDE 4.7.4. Although it was a pretty smooth transition this time, there were a few problems. One of them was that Konsole 4.7.4-2.fc16 was hiding underscores, which is pretty annoying when you're programming.</p>
<p><img src="http://www.geeklab.info/wp-content/uploads/2012/01/underscores.gif" alt="" title="" width="649" height="165" class="alignnone size-full wp-image-815" /></p>
<p>How the hell are you&#8230; <a href="http://www.geeklab.info/2012/01/konsole-is-hiding-underscores/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>Today I upgraded my Fedora 15 installation to Fedora 16 with KDE 4.7.4. Although it was a pretty smooth transition this time, there were a few problems. One of them was that Konsole 4.7.4-2.fc16 was hiding underscores, which is pretty annoying when you're programming.</p>
<p><img src="http://www.geeklab.info/wp-content/uploads/2012/01/underscores.gif" alt="" title="" width="649" height="165" class="alignnone size-full wp-image-815" /></p>
<p>How the hell are you supposed to code when half of the characters is invisible?</p>
<p>I'm more than happy to report that I fixed it. On the profile's page "advanced" you find the option "Enable Bi-Directional text rendering". Enabling this option fixed the problem immediately.</p>
<p>Google'ing, I found a few pages that say this is specific to a combination of intel or nouveau driver + specific fonts + Qt 4.8.</p>
<p><strong>Update:</strong> RedHat acknowledged <a href="https://bugzilla.redhat.com/show_bug.cgi?id=742583">the issue</a> and released a fix: konsole 4.7.4-2.fc16. Update using <em>yum update konsole</em></p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/01/konsole-is-hiding-underscores/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MS Paint: Insufficient memory</title>
		<link>http://www.geeklab.info/2012/01/ms-paint-insufficient-memory/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ms-paint-insufficient-memory</link>
		<comments>http://www.geeklab.info/2012/01/ms-paint-insufficient-memory/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 10:48:18 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[mspaint.exe]]></category>
		<category><![CDATA[registry]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=771</guid>
		<description><![CDATA[<p>One of my users got an annoying message when starting MS Paint (mspaint.exe):</p>
<blockquote><p>Onvoldoende geheugen of bronnen om de bewerking te voltooien. Sluit enkele programma's af en probeer het opnieuw.</p></blockquote>
<p>Which means:</p>
<blockquote><p>Insufficient memory to complete operation. Close some programs and try again</p></blockquote>
<p>Other resources suggested that the file opened&#8230; <a href="http://www.geeklab.info/2012/01/ms-paint-insufficient-memory/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>One of my users got an annoying message when starting MS Paint (mspaint.exe):</p>
<blockquote><p>Onvoldoende geheugen of bronnen om de bewerking te voltooien. Sluit enkele programma's af en probeer het opnieuw.</p></blockquote>
<p>Which means:</p>
<blockquote><p>Insufficient memory to complete operation. Close some programs and try again</p></blockquote>
<p>Other resources suggested that the file opened was too big or that we're doing something with a .tiff file. But he was just starting paint, no images involved at that point. The solution was to open regedit and remove the following key:<br />
<em>HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint</em><br />
That reset all MS Paint settings and we could start paint again.</p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/01/ms-paint-insufficient-memory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SGS2: OpenVPN</title>
		<link>http://www.geeklab.info/2011/12/sgs2-openvpn/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sgs2-openvpn</link>
		<comments>http://www.geeklab.info/2011/12/sgs2-openvpn/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 12:15:17 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=743</guid>
		<description><![CDATA[<p>I'm currently running CF-Root kernel version <a href="http://www.geeklab.info/2011/12/sgs2-removing-bol-com-app/">CF-Root-SGS2_XW_XEN_KK2-v5.0-CWM5</a>.</p>
<p>I installed the following packages:</p>
<p>https://market.android.com/details?id=de.schaeuffelhut.android.openvpn.installer</p>
<p>https://market.android.com/details?id=de.schaeuffelhut.android.openvpn</p>
<p>Then I discovered that the openvpn binary was not completely okay, especially the ifconfig parameter gave some unexpected errors on correct configurations. So I downloaded <a href="http://cloud.github.com/downloads/fries/android-external-openvpn/openvpn-static-2.1.1.bz2">this file</a> (<a href='http://www.geeklab.info/wp-content/uploads/2011/12/openvpn-static-2.1.1.bz2'>mirror</a>), unzipped it, and put it&#8230; <a href="http://www.geeklab.info/2011/12/sgs2-openvpn/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>I'm currently running CF-Root kernel version <a href="http://www.geeklab.info/2011/12/sgs2-removing-bol-com-app/">CF-Root-SGS2_XW_XEN_KK2-v5.0-CWM5</a>.</p>
<p>I installed the following packages:</p>
<p>https://market.android.com/details?id=de.schaeuffelhut.android.openvpn.installer</p>
<p>https://market.android.com/details?id=de.schaeuffelhut.android.openvpn</p>
<p>Then I discovered that the openvpn binary was not completely okay, especially the ifconfig parameter gave some unexpected errors on correct configurations. So I downloaded <a href="http://cloud.github.com/downloads/fries/android-external-openvpn/openvpn-static-2.1.1.bz2">this file</a> (<a href='http://www.geeklab.info/wp-content/uploads/2011/12/openvpn-static-2.1.1.bz2'>mirror</a>), unzipped it, and put it on the location of the original openvpn binary.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>system <span style="color: #660033;">-o</span> remount,rw
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>xbin
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>toolbox  <span style="color: #c20cb9; font-weight: bold;">ifconfig</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>toolbox  route
<span style="color: #c20cb9; font-weight: bold;">mv</span> openvpn openvpn-original
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>new<span style="color: #000000; font-weight: bold;">/</span>openvpn openvpn
<span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #000000; font-weight: bold;">/</span>system <span style="color: #660033;">-o</span> remount,ro</pre></div></div>

<p>And it works great!</p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2011/12/sgs2-openvpn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DNS and multiple VPNs: Using dnsmasq to access multiple dns suffixes</title>
		<link>http://www.geeklab.info/2011/12/dns-and-multiple-vpns-using-dnsmasq-to-access-multiple-dns-suffixes/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dns-and-multiple-vpns-using-dnsmasq-to-access-multiple-dns-suffixes</link>
		<comments>http://www.geeklab.info/2011/12/dns-and-multiple-vpns-using-dnsmasq-to-access-multiple-dns-suffixes/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 11:42:52 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[dhcp]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[dnsmasq]]></category>
		<category><![CDATA[Fedora 15]]></category>
		<category><![CDATA[NetworkManager]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=711</guid>
		<description><![CDATA[<p>On my Fedora 15 laptop, I'm almost always connected to several VPNs simultaneously. One VPN to my office or to my home (depending on where I am), one to the data center, one to a customer. These connections all have their own DNS server with their own suffix.</p>
<p>To make&#8230; <a href="http://www.geeklab.info/2011/12/dns-and-multiple-vpns-using-dnsmasq-to-access-multiple-dns-suffixes/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>On my Fedora 15 laptop, I'm almost always connected to several VPNs simultaneously. One VPN to my office or to my home (depending on where I am), one to the data center, one to a customer. These connections all have their own DNS server with their own suffix.</p>
<p>To make all dns suffixes working, I created a script that redirects all outgoing DNS traffic to dnsmasq running on localhost, which in turn forwards all requests for .lan to 192.168.15.254 and all requests for .gl to 192.168.1.254.</p>
<p>The script was put in /etc/NetworkManager/dispatcher.d/10-DNS:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>dnsmasq.localhost <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>proc<span style="color: #000000; font-weight: bold;">/`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>dnsmasq.localhost<span style="color: #000000; font-weight: bold;">`/</span>cmdline <span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">grep</span> dnsmasq <span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> \
        <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>dnsmasq.localhost<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$2&quot;</span> == <span style="color: #ff0000;">&quot;up&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf.dhcp
        <span style="color: #7a0874; font-weight: bold;">echo</span> nameserver 127.0.0.1 <span style="color: #000000; font-weight: bold;">&gt;</span>  <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf
        <span style="color: #7a0874; font-weight: bold;">echo</span> domain <span style="color: #007800;">$DHCP4_DOMAIN_NAME</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf 
        <span style="color: #7a0874; font-weight: bold;">echo</span> search <span style="color: #007800;">$DHCP4_DOMAIN_NAME</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf 
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span>dnsmasq <span style="color: #660033;">-C</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>resolv.conf.dhcp <span style="color: #660033;">--server</span>=<span style="color: #000000; font-weight: bold;">/</span>gl<span style="color: #000000; font-weight: bold;">/</span>192.168.1.254 \
            <span style="color: #660033;">--server</span>=<span style="color: #000000; font-weight: bold;">/</span>lan<span style="color: #000000; font-weight: bold;">/</span>192.168.15.254 <span style="color: #660033;">--bind-interfaces</span> <span style="color: #660033;">--listen-address</span> 127.0.0.1 \ 
            <span style="color: #660033;">--pid-file</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>dnsmasq.localhost
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Once I had to fix resolv.conf manually when I connected my laptop to my Samsung Galaxy SII as well. This may mean I need to improve the script some day, but for the time being, it works good enough.</p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2011/12/dns-and-multiple-vpns-using-dnsmasq-to-access-multiple-dns-suffixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Playing with the sockets: socat and netcat</title>
		<link>http://www.geeklab.info/2011/12/playing-with-the-sockets-socat-and-netcat/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=playing-with-the-sockets-socat-and-netcat</link>
		<comments>http://www.geeklab.info/2011/12/playing-with-the-sockets-socat-and-netcat/#comments</comments>
		<pubDate>Fri, 23 Dec 2011 11:32:19 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[socat]]></category>
		<category><![CDATA[sockets]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=748</guid>
		<description><![CDATA[<p>Connect two netcats to each other</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkfifo</span> backpipe
nc localhost <span style="color: #000000;">55545</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&#60;</span>backpipe <span style="color: #000000; font-weight: bold;">&#124;</span> nc localhost <span style="color: #000000;">55546</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&#62;</span>backpipe</pre></div></div>

<p>Telnet with readline and a history:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-d</span> <span style="color: #660033;">-d</span> READLINE,<span style="color: #007800;">history</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.http_history \
TCP4:www.domain.org:www,crnl</pre></div></div>

<p>Talk&#8230; <a href="http://www.geeklab.info/2011/12/playing-with-the-sockets-socat-and-netcat/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>Connect two netcats to each other</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkfifo</span> backpipe
nc localhost <span style="color: #000000;">55545</span> <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&lt;</span>backpipe <span style="color: #000000; font-weight: bold;">|</span> nc localhost <span style="color: #000000;">55546</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">&gt;</span>backpipe</pre></div></div>

<p>Telnet with readline and a history:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-d</span> <span style="color: #660033;">-d</span> READLINE,<span style="color: #007800;">history</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>.http_history \
TCP4:www.domain.org:www,crnl</pre></div></div>

<p>Talk to your modem in raw mode:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat - <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyS0,raw,<span style="color: #007800;">echo</span>=<span style="color: #000000;">0</span>,crnl</pre></div></div>

<p>Simulate tail -f:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-u</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>messages,seek-end=<span style="color: #000000;">0</span>,ignoreeof -</pre></div></div>

<p>Give a random interactive program, such as nslookup, a history:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat readline,<span style="color: #007800;">history</span>=.nslookup_hist <span style="color: #7a0874; font-weight: bold;">exec</span>:<span style="color: #ff0000;">&quot;nslookup&quot;</span>,pty,ctty,setsid,<span style="color: #007800;">echo</span>=<span style="color: #000000;">0</span></pre></div></div>

<p>Use your modem with a non-persistent history:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat readline <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyS0,raw,<span style="color: #007800;">echo</span>=<span style="color: #000000;">0</span>,crlf,nonblock</pre></div></div>

<p>Use your modem with a persistent history:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat READLINE,<span style="color: #7a0874; font-weight: bold;">history</span>:<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>serial.cmds \
  OPEN:<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyS0,<span style="color: #007800;">ispeed</span>=<span style="color: #000000;">9600</span>,<span style="color: #007800;">ospeed</span>=<span style="color: #000000;">9600</span>,crnl,raw,sane,<span style="color: #007800;">echo</span>=<span style="color: #c20cb9; font-weight: bold;">false</span></pre></div></div>

<p>To dos (as in tofrodos):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-u</span> - -,crlf</pre></div></div>

<p>From dos (as in tofrodos):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-u</span> -,cr -</pre></div></div>

<p>Run sendmail daemon with your favorite network options</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat TCP-LISTEN:<span style="color: #000000;">25</span>,fork,ip-ttl=<span style="color: #000000;">4</span>,ip-tos=<span style="color: #000000;">7</span>,tcp-maxseg=<span style="color: #000000;">576</span> EXEC:<span style="color: #ff0000;">&quot;/usr/sbin/sendmail -bs&quot;</span>,nofork</pre></div></div>

<p>Send a mail using chat (from ppp package):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-d</span> <span style="color: #660033;">-d</span> system:<span style="color: #ff0000;">'/usr/sbin/chat &quot;220 &quot; &quot;HELO loopback&quot; &quot;250 &quot; &quot;MAIL FROM: &lt;root@localhost&gt;&quot; &quot;250 &quot; &quot;RCPT TO: root&quot; &quot;250 &quot; &quot;DATA&quot; &quot;354 &quot; &quot;test'</span>$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>.&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #ff0000;">'&quot; &quot;250 &quot; &quot;QUIT&quot;'</span>,pty,<span style="color: #007800;">echo</span>=<span style="color: #000000;">0</span>,cr tcp:localhost:<span style="color: #000000;">25</span>,crlf,nodelay</pre></div></div>

<p>Connect remote X :1 to local X :0</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #7a0874; font-weight: bold;">exec</span>:<span style="color: #ff0000;">'ssh root@troas socat unix-l\:/tmp/.X11-unix/X1 -'</span> unix:<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>.X11-unix<span style="color: #000000; font-weight: bold;">/</span>X0</pre></div></div>

<p>Note the escaping of the colon in the remote command.</p>
<p>Sending a file - Server sending the file</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server$ socat <span style="color: #660033;">-u</span> FILE:test.dat TCP-LISTEN:<span style="color: #000000;">9876</span>,reuseaddr
client$ socat <span style="color: #660033;">-u</span> TCP:127.0.0.1:<span style="color: #000000;">9876</span> OPEN:out.dat,creat</pre></div></div>

<p>Sending a file - Server receiving the file</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">server$ socat <span style="color: #660033;">-u</span> TCP-LISTEN:<span style="color: #000000;">9876</span>,reuseaddr OPEN:out.txt,creat
client$ socat <span style="color: #660033;">-u</span> FILE:test.txt TCP:127.0.0.1:<span style="color: #000000;">9876</span></pre></div></div>

<p>Be a syslog server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-u</span> UDP4-LISTEN:<span style="color: #000000;">5140</span>,reuseaddr,fork OPEN:<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>syslog.msg,creat,append</pre></div></div>

<p>I can't figure out how to put a newline after each message...</p>
<p>Send syslog messages to screen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-t0</span> <span style="color: #660033;">-T0</span> <span style="color: #660033;">-u</span> UDP4-LISTEN:<span style="color: #000000;">514</span>,reuseaddr,fork -</pre></div></div>

<p>To get time from time server:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat TCP:time.nist.gov:<span style="color: #000000;">13</span> -</pre></div></div>

<p>Really sick - use socat as a VPN solution:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #660033;">-d</span> <span style="color: #660033;">-d</span>  \
    TUN:192.168.99.2<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">24</span>,up \
    SYSTEM:<span style="color: #ff0000;">&quot;ssh root@remote-server socat -d -d  - 'TUN:192.168.99.1/24,up'&quot;</span></pre></div></div>

<p>This must be run as a user that can modify tap/tun devices on both sides of the tunnel.</p>
<p>Use a remote modem<br />
On the side with the modem</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>ttyS0,raw,<span style="color: #007800;">echo</span>=<span style="color: #000000;">0</span> tcp4-listen:<span style="color: #000000;">3334</span><span style="color: #000000; font-weight: bold;">&lt;</span>pre<span style="color: #000000; font-weight: bold;">&gt;</span>
On the side where you want the modem transferred
<span style="color: #000000; font-weight: bold;">&lt;</span>pre <span style="color: #007800;">lang</span>=<span style="color: #ff0000;">&quot;bash&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>socat PTY,<span style="color: #007800;">link</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>vmodem0,raw,<span style="color: #007800;">echo</span>=<span style="color: #000000;">0</span> TCP:servername:<span style="color: #000000;">3334</span></pre></div></div>

<p>You can now access remote /dev/ttyS0 through local $HOME/vmodem0</p>
<p>Use a remote modem over SSH</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">socat PTY,<span style="color: #007800;">link</span>=<span style="color: #007800;">$HOME</span><span style="color: #000000; font-weight: bold;">/</span>vmodem0,waitslave \
 EXEC:<span style="color: #ff0000;">&quot;ssh root@remote-server socat - /dev/ttyS0&quot;</span></pre></div></div>

<p>You can now access remote /dev/ttyS0 through local $HOME/vmodem0. Remove waitslave to keep alive after local client disconnect.</p>
<p>More information:<br />
<a href="http://melkov.ru/FreeBSD/socat/EXAMPLES" rel="nofollow">1</a> <a href="http://blog.rootshell.be/2010/10/31/socat-another-network-swiss-army-knife/" rel="nofollow">2</a></p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2011/12/playing-with-the-sockets-socat-and-netcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Change VMWare Data Recovery 2.0 report mail</title>
		<link>http://www.geeklab.info/2011/12/change-vmware-data-recovery-2-0-report-mail/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=change-vmware-data-recovery-2-0-report-mail</link>
		<comments>http://www.geeklab.info/2011/12/change-vmware-data-recovery-2-0-report-mail/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 15:01:17 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[SMTP]]></category>
		<category><![CDATA[socat]]></category>
		<category><![CDATA[VMWare]]></category>
		<category><![CDATA[VMWare Data Recovery]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=769</guid>
		<description><![CDATA[<p>As I <a href="http://www.geeklab.info/2011/12/vmware-data-recovery-is-crap/">may have mentioned before</a> VMWare Data Recovery is not my favorite backup solution. I'm pleased to report that VDR2.0 is a LOT better than 1.x ever was. Since upgrading, my backups haven't failed once. And it even has a built-in email reporting system.</p>
<p>Unfortunately, this mail system&#8230; <a href="http://www.geeklab.info/2011/12/change-vmware-data-recovery-2-0-report-mail/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<p>As I <a href="http://www.geeklab.info/2011/12/vmware-data-recovery-is-crap/">may have mentioned before</a> VMWare Data Recovery is not my favorite backup solution. I'm pleased to report that VDR2.0 is a LOT better than 1.x ever was. Since upgrading, my backups haven't failed once. And it even has a built-in email reporting system.</p>
<p>Unfortunately, this mail system isn't too customizable. Since I'd like my subjects to be clear they need extra attention, I made a little fix. This script is started by socat.</p>
<h2>Install socat</h2>
<p>Socat handles incoming connections on port 25 for me.<br />
<em>rpm -i http://download.fedora.redhat.com/pub/epel/5/x86_64/socat-1.7.1.3-1.el5.x86_64.rpm</em></p>
<h2>Get my script</h2>
<p><em>cd /usr/local/bin ; wget <a href='http://www.geeklab.info/wp-content/uploads/2011/12/smtp-filter.sh' target=_blank>http://www.geeklab.info/wp-content/uploads/2011/12/smtp-filter.sh</a></em><br />
You should put your own mailserver in the script on line 7.</p>
<h2>Start it automatically</h2>
<p><em>echo "socat TCP4-LISTEN:25,fork EXEC:/usr/local/bin/smtp-filter.sh &#038;" >> /etc/rc.d/rc.local</em></p>
<h2>Now change your settings</h2>
<p>Change the outgoing mailserver to localhost and test it. If everything's ok, you'll get a mail with 1 warning and 2 error-message, as the test-mail doesn't contain the fields that indicate no backups failed.</p>
<h2>Security</h2>
<p>The iptables firewall does not allow incoming connections to port 25, so you will not become an open relay using this script.</p>
<i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2011/12/change-vmware-data-recovery-2-0-report-mail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Dymo label writing process</title>
		<link>http://www.geeklab.info/2011/12/my-dymo-label-writing-process/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=my-dymo-label-writing-process</link>
		<comments>http://www.geeklab.info/2011/12/my-dymo-label-writing-process/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 12:29:45 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[CentOS 6]]></category>
		<category><![CDATA[CUPS]]></category>
		<category><![CDATA[Dymo]]></category>
		<category><![CDATA[Raw Note]]></category>
		<category><![CDATA[SELinux]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=730</guid>
		<description><![CDATA[<div style="position: relative; background-color: red; color: white; font-size: 14px; padding: 20px; text-align:center;">This page contains raw notes and/or untested notes. They may be incorrect, parts may be missing or the article may contain parts that are not needed and more. An update will probably follow some day.</div><p>To print labels on my&#8230; <a href="http://www.geeklab.info/2011/12/my-dymo-label-writing-process/" class="read_more">Read more</a></p]]></description>
			<content:encoded><![CDATA[<div style="position: relative; background-color: red; color: white; font-size: 14px; padding: 20px; text-align:center;">This page contains raw notes and/or untested notes. They may be incorrect, parts may be missing or the article may contain parts that are not needed and more. An update will probably follow some day.</div><p>To print labels on my Dymo, I'm running a custom built webapp that allows users in the entire network to print. It has a memory, prints KIX-codes (that make it easier for the postal service to process letters) and prints a logo.</p>
<p>In my setup, the server generating the logo and the server printing it are two different machines. But even if they weren't, this method keeps the webserver in its SELinux confinement.</p>
<h2>Requirements</h2>
<p>We need some tools, install the packages with the following command:<br />
<em>yum install ripmime</em></p>
<h2>Add the printer to CUPS</h2>
<p>Add the printer to CUPS, so you can spool jobs to it. I'm not explaining this part.</p>
<h2>Generate a label</h2>
<p>Using PHP's <a href="http://www.php.net/manual/en/ref.image.php" target="_blank">GD extensions</a> I generate a new image with width=1010 and height=540. Using this high resolution results in good quality prints.</p>
<p>The image is exported as a .png file, named [something-random].dymo.png and transported to the printserver through a special email-address.</p>
<h2>Prepare the mailserver</h2>
<p>I'm running a Postfix mailserver. This mailserver has a special address that accepts print jobs, extracts the files and prints them.</p>
<p>In /etc/postfix/master.cf, add the following lines:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">printer unix  -       n       n       -       -       pipe
  <span style="color: #007800;">flags</span>=F  <span style="color: #007800;">user</span>=nobody <span style="color: #007800;">argv</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>printserver <span style="color: #007800;">$sender</span> <span style="color: #007800;">$recipient</span></pre></div></div>

<p>Then in /etc/postfix/transport, we put:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">printer.geeklab.info    printer:</pre></div></div>

<p>The domain printer.geeklab.info doesn't necessarily need to exist, as long as you smtp right to this mailserver.</p>
<p>Finally in /etc/postfix/main.cf we enable the transport maps, if that hasn't been done before:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">transport_maps = <span style="color: #7a0874; font-weight: bold;">hash</span>:<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>postfix<span style="color: #000000; font-weight: bold;">/</span>transport</pre></div></div>

<h2>Write a script</h2>
<p>In master.cf we start the script /etc/postfix/bin/printserver. Add this content to said script:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">TMPDIR</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>spool<span style="color: #000000; font-weight: bold;">/</span>mailprinter<span style="color: #000000; font-weight: bold;">/</span>$<span style="color: #007800;">$_</span><span style="color: #800000;">${RANDOM}</span>_<span style="color: #800000;">${RANDOM}</span>
<span style="color: #007800;">MESSAGE_FILE</span>=<span style="color: #800000;">${TMPDIR}</span>_the_message
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$TMPDIR</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$MESSAGE_FILE</span>
ripmime <span style="color: #660033;">-i</span> <span style="color: #007800;">$MESSAGE_FILE</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$TMPDIR</span>
<span style="color: #000000; font-weight: bold;">for</span> i <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #800000;">${METAMAIL_TMPDIR}</span><span style="color: #000000; font-weight: bold;">/*</span>.dymo.png; <span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #c20cb9; font-weight: bold;">lpr</span> <span style="color: #660033;">-PDymo</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">PageSize</span>=w167h288 <span style="color: #660033;">-o</span> landscape <span style="color: #660033;">-o</span> page-left=<span style="color: #000000;">0</span> <span style="color: #660033;">-o</span> page-top=<span style="color: #000000;">0</span> <span style="color: #660033;">-o</span> page-right=<span style="color: #000000;">0</span> <span style="color: #660033;">-o</span> page-bottom=<span style="color: #000000;">26</span> <span style="color: #660033;">-o</span> orientation-requested=<span style="color: #000000;">5</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">scaling</span>=<span style="color: #000000;">100</span>
<span style="color: #000000; font-weight: bold;">done</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> <span style="color: #007800;">$MESSAGE_FILE</span> <span style="color: #007800;">$TMPDIR</span></pre></div></div>

<h2>Manage SELinux settings</h2>
<p>The script we just write uses ripmime and lpr and runs as the Postfix pipe user. To allow the Postfix pipe program to use these tools, run postfix_pipe_t in a permissive state:<br />
<em>semanage permissive -a postfix_pipe_t</em><br />
Always remember to manage SELinux, not disable it.</p>
<div style='border: 1px solid #555C64; background-color: #efefef; padding:5px;'><h2>Ubuntu/Debian</h2>I'm running RedHat-based software on all of my machines. Above information may be useful for Ubuntu/Debian users, but it's not tested and I'm not supporting it.<br><br><b>Servers:</b> RedHat Enterprise Linux/CentOS is more suitable for servers, as there's a lot of professional level support available. I think that's important, because if I say, get a car accident, I want the servers to be managable by another professional.<br><br><b>Desktops/Laptops:</b> RPM packages are pretty exchangable between RedHat-based platforms. That's a good reason to run Fedora on the desktop.</div><i class='glicopyright'>&copy; GeekLabInfo</i>]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2011/12/my-dymo-label-writing-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

