<?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>Sat, 12 May 2012 09:15:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Konsole is driving me crazy!</title>
		<link>http://www.geeklab.info/2012/04/konsole-is-driving-me-crazy/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=konsole-is-driving-me-crazy</link>
		<comments>http://www.geeklab.info/2012/04/konsole-is-driving-me-crazy/#comments</comments>
		<pubDate>Mon, 09 Apr 2012 14:38:14 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Konsole]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[rpm]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=865</guid>
		<description><![CDATA[Konsole, the terminal emulator of KDE, is driving me crazy! Version 4.8 made a slight change, that breaks an essential feature I'm using.

Up to version 4.7.x, I used the command <i>konsole --profile=Profilename&#8230; <a href="http://www.geeklab.info/2012/04/konsole-is-driving-me-crazy/" class="read_more">Read more</a></i> to open a terminal. Then I used ctrl+alt+N to open several terminals with the same profile. For]]></description>
			<content:encoded><![CDATA[Konsole, the terminal emulator of KDE, is driving me crazy! Version 4.8 made a slight change, that breaks an essential feature I'm using.

Up to version 4.7.x, I used the command <i>konsole --profile=Profilename</i> to open a terminal. Then I used ctrl+alt+N to open several terminals with the same profile. For some reason, this broke in version 4.8. Since I use this feature like every minute, I'm getting very frustrated by this.

Here comes the beauty of open source: since Konsole is open source, I can fix it myself.
<h2>My changes</h2>
First, I downloaded the <a href="http://mirror.optus.net/fedora/linux/updates/16/SRPMS/konsole-4.8.1-1.fc16.src.rpm" target="_blank">current version of the konsole source RPM</a> and installed it, using <em>rpm -i konsole-4.8.1-1.fc16.src.rpm</em>. In ~/rpmbuild/SOURCES I created a new file named newtab.patch, containing:


<div class="wp_syntax"><div class="code"><pre class="patch" style="font-family:monospace;">--- konsole-4.8.1/src/MainWindow.cpp    2012-02-29 23:56:57.000000000 +0100
+++ konsole-4.8.1/src/MainWindow.cpp    2012-04-03 19:47:52.397594047 +0200
@@ -397,7 +397,8 @@
&nbsp;
 void MainWindow::newTab()
 {
-    Profile::Ptr defaultProfile = SessionManager::instance()-&gt;defaultProfile();
+    Profile::Ptr defaultProfile = MainWindow::defaultProfile();
+              //SessionManager::instance()-&gt;defaultProfile();  //Geeklab fix
     emit newSessionRequest(defaultProfile , activeSessionDir() , _viewManager);
 }</pre></div></div>



Then I editted konsole.spec, adding a line after the one that starts with <em>Patch50</em>:


<div class="wp_syntax"><div class="code"><pre class="patch" style="font-family:monospace;">Patch99: newtab.patch</pre></div></div>



After that, I added a line after the one that starts with <em>%patch50</em>:


<div class="wp_syntax"><div class="code"><pre class="patch" style="font-family:monospace;">%patch99 -p1 -b .newtab</pre></div></div>




And we're done. Build the RPM using the command <i>rpmbuild -ba konsole.spec --define "dist geeklab"</i> and install it.

Somehow, this RPM doesn't cover all of the problems, but enough for me to be happy.<i class='glicopyright'>&copy; GeekLabInfo</i> ]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/04/konsole-is-driving-me-crazy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check your PC after the Nu.nl hack</title>
		<link>http://www.geeklab.info/2012/03/check-your-pc-after-the-nu-nl-hack/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=check-your-pc-after-the-nu-nl-hack</link>
		<comments>http://www.geeklab.info/2012/03/check-your-pc-after-the-nu-nl-hack/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 12:59:38 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[NoteToSelf]]></category>
		<category><![CDATA[Virus]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=847</guid>
		<description><![CDATA[Yesterday, Dutch news site nu.nl was hacked. Unfortunately, they hardly inform the public of what exactly happened. But <a href="http://sijmen.ruwhof.net/weblog/166-nu-nl-gehackt-malware-analyse" target="_blank">this site</a> has a pretty good analysis and a <a href="http://sijmen.ruwhof.net/js/nu.nl-infectietest/">page to check if you are vulnerable</a>.
<br />
You can also use <a href="http://www.google.com/search?q=microsoft+safety+scanner">MS Safety Scanner&#8230; <a href="http://www.geeklab.info/2012/03/check-your-pc-after-the-nu-nl-hack/" class="read_more">Read more</a></a> to scan your computer, which is a good]]></description>
			<content:encoded><![CDATA[Yesterday, Dutch news site nu.nl was hacked. Unfortunately, they hardly inform the public of what exactly happened. But <a href="http://sijmen.ruwhof.net/weblog/166-nu-nl-gehackt-malware-analyse" target="_blank">this site</a> has a pretty good analysis and a <a href="http://sijmen.ruwhof.net/js/nu.nl-infectietest/">page to check if you are vulnerable</a>.
<br />
You can also use <a href="http://www.google.com/search?q=microsoft+safety+scanner">MS Safety Scanner</a> to scan your computer, which is a good idea anyway.
<br />
I'm happy to say that my clients are all up-to-date and thus not infected.<i class='glicopyright'>&copy; GeekLabInfo</i> ]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/03/check-your-pc-after-the-nu-nl-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to generate SSH Fingerprint DNS records</title>
		<link>http://www.geeklab.info/2012/03/how-to-generate-ssh-fingerprint-dns-records/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-generate-ssh-fingerprint-dns-records</link>
		<comments>http://www.geeklab.info/2012/03/how-to-generate-ssh-fingerprint-dns-records/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 16:57:18 +0000</pubDate>
		<dc:creator>David (admin)</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[Bind]]></category>
		<category><![CDATA[djbdns]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[fingerprint]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[SSHFP]]></category>
		<category><![CDATA[tinydns]]></category>

		<guid isPermaLink="false">http://www.geeklab.info/?p=844</guid>
		<description><![CDATA[<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_rsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span>
<span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_dsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span></pre></div></div>



You can put the output to your dns zone.

<h2>To convert it to tinydns/djbdns style:</h2>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_rsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span> <span style="color: #000000; font-weight: bold;">&#124;</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
   my </span></pre></div>&#8230; <a href="http://www.geeklab.info/2012/03/how-to-generate-ssh-fingerprint-dns-records/" class="read_more">Read more</a></div]]></description>
			<content:encoded><![CDATA[


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_rsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span>
<span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_dsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span></pre></div></div>



You can put the output to your dns zone.

<h2>To convert it to tinydns/djbdns style:</h2>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_rsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #c20cb9; font-weight: bold;">hostname</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
   my ($host, $in, $sshfp, $alg, $fptype, $fp) = split &quot; &quot;, &lt;STDIN&gt;;
   printf(&quot;:%s:44:\\%03o\\%03o&quot;,$host, $alg, $fptype);
   for (my $i = 0; $i &lt; length($fp); $i += 2) { printf(&quot;\\%03o&quot;, hex substr($fp, $i, 2)); } 
   print &quot;:\n&quot;
'</span></pre></div></div>




<h2>One in all script</h2>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> ; <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_rsa_key.pub <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_rsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
   my ($host, $in, $sshfp, $alg, $fptype, $fp) = split &quot; &quot;, &lt;STDIN&gt;;
   printf(&quot;:%s:44:\\%03o\\%03o&quot;,$host, $alg, $fptype);
   for (my $i = 0; $i &lt; length($fp); $i += 2) { printf(&quot;\\%03o&quot;, hex substr($fp, $i, 2)); } 
   print &quot;:\n&quot;
'</span> ; <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_dsa_key.pub <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-f</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssh<span style="color: #000000; font-weight: bold;">/</span>ssh_host_dsa_key.pub <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span><span style="color: #000000; font-weight: bold;">`</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">perl</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'
   my ($host, $in, $sshfp, $alg, $fptype, $fp) = split &quot; &quot;, &lt;STDIN&gt;;
   printf(&quot;:%s:44:\\%03o\\%03o&quot;,$host, $alg, $fptype);
   for (my $i = 0; $i &lt; length($fp); $i += 2) { printf(&quot;\\%03o&quot;, hex substr($fp, $i, 2)); } 
   print &quot;:\n&quot;
'</span></pre></div></div>




<h2>Client configuration</h2>
SSH Fingerprints are useless if your client simply ignores them. Add the following line to /etc/ssh/ssh_config:
<pre>VerifyHostKeyDNS yes</pre>
<i class='glicopyright'>&copy; GeekLabInfo</i> ]]></content:encoded>
			<wfw:commentRss>http://www.geeklab.info/2012/03/how-to-generate-ssh-fingerprint-dns-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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[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&#8230; <a href="http://www.geeklab.info/2012/02/open-eps-files-with-gimp-for-windows/" class="read_more">Read more</a></em>.

Setting the environment variable is done]]></description>
			<content:encoded><![CDATA[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>.

Setting the environment variable is done in the advanced settings of "my computer".<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>
Linux
KDE
A Windows server to connect to.

<h2>Step 1: Install required software</h2>
yum install kde-plasma-networkmanagement-pptp NetworkManager-pptp

<h2>Step 2: Configure the network&#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></h2>
In the KDE Network Manager plasma module, go to the tab VPN, click add and choose PPTP.
<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" />

Enter and connection name you like. In the field "gateway"]]></description>
			<content:encoded><![CDATA[<h2>Requirements</h2>
Linux
KDE
A Windows server to connect to.

<h2>Step 1: Install required software</h2>
yum install kde-plasma-networkmanagement-pptp NetworkManager-pptp

<h2>Step 2: Configure the network</h2>
In the KDE Network Manager plasma module, go to the tab VPN, click add and choose PPTP.
<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" />

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.
<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" />

In the advanced window, disable EAP and enable MPPE. Then click OK.
<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" />

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.
<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" />

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).
<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" />

You may want to configure IPv6 as well, but I don't at this moment, so I'm not documenting this.

<h2>Step 3: Connect</h2>
Click on the icon in the tray and connect.<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[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

<h2>Step 1. Network configuration</h2>
First, install system-config-network or manually configure the network. I prefer system-config-network for easy configurations and vim for more complex configurations.
<code>yum -y &#8230; <a href="http://www.geeklab.info/2012/01/squid-with-active-directory-authentication-on-centos-6-0/" class="read_more">Read more</a></code]]></description>
			<content:encoded><![CDATA[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

<h2>Step 1. Network configuration</h2>
First, install system-config-network or manually configure the network. I prefer system-config-network for easy configurations and vim for more complex configurations.
<code>yum -y install system-config-network-tui</code>

<h2>Step 2. Install some tools for convenience</h2>
<code>yum -y install vim-minimal vim-enhanced openssh-clients mc telnet policycoreutils policycoreutils-python bind-utils</code>

<h2>Step 3. Install ntp and synchronize clocks</h2>
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:
<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>

<h2>Step 4. Install squid and other required software</h2>
<pre><code>yum -y install krb5-workstation samba-common samba-winbind authconfig squid<br />
chkconfig squid on</code></pre>

<h2>Step 5. Connect to active directory</h2>
Please note that MYCOMPANY.local and mycompany.local may be different domains due to the upper/lowercase.
<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>

Give squid permissions to use winbind info:
<code>usermod -G wbpriv squid</code>

Now check your winbind connection using the following commands:
<pre><code>wbinfo -u<br />
wbinfo -g</code></pre>

<h2>Step 6. Firewall</h2>
<pre><code>iptables -I INPUT -m tcp -p tcp --dport 3128 -j ACCEPT<br />
/sbin/service iptables save</code></pre>

<h2>Step 7. Configure squid</h2>
I commented out this line from /etc/squid/squid.conf:
<code>http_access allow localnet</code>
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:
<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>

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

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:
<pre><code>\.trendmicro\.com<br />
^trendmicro\.com<br />
\.microsoft\.com<br />
^microsoft\.com</code></pre>
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.

Start Squid using <em>/sbin/service squid restart</em> and the proxy is ready.

<h2>Step 8. Optional: IPv6 issues</h2>
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:
<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>

<h2>Step 9. Optional: Some white- and blacklisting</h2>
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.<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[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.

<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" />

How the hell are you supposed&#8230; <a href="http://www.geeklab.info/2012/01/konsole-is-hiding-underscores/" class="read_more">Read more</a]]></description>
			<content:encoded><![CDATA[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.

<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" />

How the hell are you supposed to code when half of the characters is invisible?

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.

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.

<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><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[One of my users got an annoying message when starting MS Paint (mspaint.exe):
<blockquote>Onvoldoende geheugen of bronnen om de bewerking te voltooien. Sluit enkele programma's af en probeer het opnieuw.</blockquote>

Which means:
<blockquote>Insufficient memory to complete operation. Close some programs and try again&#8230; <a href="http://www.geeklab.info/2012/01/ms-paint-insufficient-memory/" class="read_more">Read more</a></blockquote>

Other resources suggested that the file opened]]></description>
			<content:encoded><![CDATA[One of my users got an annoying message when starting MS Paint (mspaint.exe):
<blockquote>Onvoldoende geheugen of bronnen om de bewerking te voltooien. Sluit enkele programma's af en probeer het opnieuw.</blockquote>

Which means:
<blockquote>Insufficient memory to complete operation. Close some programs and try again</blockquote>

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:
<em>HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Paint</em>
That reset all MS Paint settings and we could start paint again.<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[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>.

I installed the following packages:

https://market.android.com/details?id=de.schaeuffelhut.android.openvpn.installer


https://market.android.com/details?id=de.schaeuffelhut.android.openvpn

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&#8230; <a href="http://www.geeklab.info/2011/12/sgs2-openvpn/" class="read_more">Read more</a></a>), unzipped it, and put it]]></description>
			<content:encoded><![CDATA[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>.

I installed the following packages:

https://market.android.com/details?id=de.schaeuffelhut.android.openvpn.installer


https://market.android.com/details?id=de.schaeuffelhut.android.openvpn

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.


<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>




And it works great!<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[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.

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]]></description>
			<content:encoded><![CDATA[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.

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.

The script was put in /etc/NetworkManager/dispatcher.d/10-DNS:


<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>



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.<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>
	</channel>
</rss>

