<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.whatthefork.org/~d/styles/itemcontent.css"?><rss 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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Slack/Tux</title>
	
	<link>http://www.slack-tux.org</link>
	<description>The Lazy Penguin</description>
	<pubDate>Tue, 16 Jun 2009 23:09:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<geo:lat>49.262196</geo:lat><geo:long>-122.885275</geo:long><creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-sa/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.whatthefork.org/SlackTux" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>HOWTO - Import CSV to SQL</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/gjYYqIL6g4c/</link>
		<comments>http://www.slack-tux.org/howto/import-csv-sql/#comments</comments>
		<pubDate>Sat, 02 May 2009 18:27:26 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[bulk insert]]></category>

		<category><![CDATA[convert]]></category>

		<category><![CDATA[csv]]></category>

		<category><![CDATA[export]]></category>

		<category><![CDATA[import]]></category>

		<category><![CDATA[insert]]></category>

		<category><![CDATA[ms-sql]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[oracle]]></category>

		<category><![CDATA[postgres]]></category>

		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.slack-tux.org/?p=54</guid>
		<description>CSV is a data exchange format that most software can export to, since it is a simple list of values separated by commas (hence the name). Spreadsheet programs like OpenOffice Calc, Microsoft Excel, Google Docs Spreadsheet and others commonly have an &amp;#8216;Export to CSV&amp;#8217; option, often found under the File menu.
There are scripts that convert [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>CSV is a data exchange format that most software can export to, since it is a simple list of values separated by commas (hence the name). Spreadsheet programs like OpenOffice Calc, Microsoft Excel, Google Docs Spreadsheet and others commonly have an &#8216;<em>Export to CSV&#8217;</em> option, often found under the <em>File</em> menu.</p>
<p>There are scripts that convert CSV to SQL, but most modern database systems support reading CSV data such as:</p>
<ul>
<li><a href="http://www.postgresql.org/">PostgreSQL</a></li>
<li><a href="http://dev.mysql.com/downloads/mysql/5.1.html">MySQL</a></li>
<li><a href="http://www.oracle.com/technology/products/database/xe/index.html">Oracle</a></li>
<li><a href="http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx">Microsoft SQL Server</a></li>
<li><a href="http://www.sybase.com/products/databasemanagement/adaptiveserverenterprise">Sybase Adaptive Server Enterprise</a> (which uses the same <a href="http://en.wikipedia.org/wiki/Transact-SQL">Transact-SQL</a> dialect as MS-SQL).</li>
</ul>
<p>They all require different syntax to import CSV data, some examples of which are detailed here.</p>
<h2>Laying Out the Data</h2>
<p>This reference relies on a few assumptions. Firstly, it assumes you have obtained your data in CSV format. Secondly, good sense assumes you would not be doing this if you had a better way. Important metadata can be lost by using CSV as an intermediate format. Details like Foreign Keys, column constraints, and so on.</p>
<p>For the purposes of this guide, we will be using the following dataset.<br />
<code><br />
"id","firstName","lastName"<br />
12345,"Ingrid","Insert"<br />
23456,"Eric","Example"<br />
12543,"Dave","Dataset"</code></p>
<p>All examples that follow are based on this CSV set.</p>
<h2>Creating the Table</h2>
<p>A simple example of a table we may be importing the CSV file to.</p>
<p><code>CREATE TABLE employees (<br />
id INT NOT NULL PRIMARY KEY,<br />
firstName VARCHAR(32) NOT NULL,<br />
lastName VARCHAR(48) NOT NULL<br />
);</code></p>
<h2>Importing the Data</h2>
<p>This process isn&#8217;t terribly complicated, but it does vary according to the database system you are importing to.</p>
<h3>MySQL</h3>
<p><code>LOAD DATA INFILE '/path/to/employees.csv' INTO TABLE employees<br />
FIELDS TERMINATED BY ',' ENCLOSED BY '"'<br />
LINES TERMINATED BY '\n';</code></p>
<h3>Microsoft SQL Server and Sybase ASE</h3>
<p><code>BULK INSERT employees FROM ‘c:\path\to\employees.csv’ WITH (<br />
FIELDTERMINATOR = ‘,’,<br />
ROWTERMINATOR = ‘\n’<br />
);<br />
GO</code></p>
<h3>PostgreSQL</h3>
<p><code>COPY employees FROM '/path/to/employees.csv' DELIMITERS ',' CSV;</code></p>
<h3>Oracle</h3>
<p>Offhand I don&#8217;t know a way to import a CSV file into Oracle using only SQL or PL/SQL, but there&#8217;s a great article on Dev Shed that covers how to do it with the Oracle 10G XE administration interface. Here is a <a href="http://www.devshed.com/c/a/Oracle/Importing-a-CSV-Text-File-into-Oracle-10G-XE/2/">convenient link to the good part</a>, since if you&#8217;re reading this, you have likely already exported the CSV data, and want to know how to import that CSV to SQL.</p>
<p>Alternatively, you could convert your CSV file to SQL INSERT statements, and then execute those INSERTS. An simple <a href="http://netsource.hu/csv2sql/" target="_blank">CSV to SQL Conversion Tool</a> can do this effectively.</p>
<p>If anyone knows how to import CSV files into Oracle without using the admin GUI or an external tool, please share!</p>
<h2>References</h2>
<ul>
<li><a href="http://dev.mysql.com/doc/refman/5.1/en/load-data.html">http://dev.mysql.com/doc/refman/5.1/en/load-data.html</a></li>
<li><a href="http://www.ensode.net/postgresql_csv_import.html">http://www.ensode.net/postgresql_csv_import.html</a></li>
<li><a href="http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/">http://blog.sqlauthority.com/2008/02/06/sql-server-import-csv-file-into-sql-server-using-bulk-insert-load-comma-delimited-file-into-sql-server/</a></li>
</ul>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/gjYYqIL6g4c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/import-csv-sql/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/import-csv-sql/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Replace Text in Multiple Files with sed and Regular Expressions</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/Eol4ANhrjFw/</link>
		<comments>http://www.slack-tux.org/howto/replace-text-in-multiple-files/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 17:31:56 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[batch operation]]></category>

		<category><![CDATA[find]]></category>

		<category><![CDATA[for loop]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[mv]]></category>

		<category><![CDATA[nano]]></category>

		<category><![CDATA[regular expression]]></category>

		<category><![CDATA[script]]></category>

		<category><![CDATA[sed]]></category>

		<category><![CDATA[text replacement]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=43</guid>
		<description>Sometimes you need to replace text in more than one file.  Often a quick &amp;#8216;find and replace&amp;#8217; with your favourite text editor (CTRL+\ in nano, for instance) can accomplish this, and when multiple files is a small number, it can be a viable method. When dealing with text replacement for large sets of files, a [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>Sometimes you need to replace text in more than one file.  Often a quick &#8216;find and replace&#8217; with your favourite text editor (CTRL+\ in nano, for instance) can accomplish this, and when <em>multiple files</em> is a small number, it can be a viable method. When dealing with text replacement for <em>large sets of files</em>, a quick script could save you a considerable amount of time. A few examples of when you might do this are:</p>
<ul>
<li>Changing footer links in a template.</li>
<li>Updating copyright information on a static HTML site.</li>
<li>Replacing contact information in many files.</li>
</ul>
<p>One solution is very simple shell script. It requires <em>sed</em> (a classic text replacement utility), which should be available on any Linux or Unix system. We can feed it a very simple regular expression, dump the output to a temporary file, and overwrite the original with it.</p>
<p><strong>Batch text replacement for multiple files with a shell script:</strong><strong><br />
</strong></p>
<pre>TMPFILE=./tmp.$$

for filename in *.txt; do
  sed 's/text_to_replace/something_to_replace_it_with/g' $filename &gt; $TMPFILE
  mv $TMPFILE $filename # Comment this line out to not overwrite the original file.
fi</pre>
<p>As mentioned above, this is just one way to accomplish this. <a href="http://www.dufault.info/">Phil Dufault</a> suggests two alternative methods (non-recursive and recursive)</p>
<p><strong>Replacing one string with another in multiple files using <em>sed</em>:</strong></p>
<blockquote>
<pre>sed -i 's,text,replacement,g' *.txt</pre>
</blockquote>
<p><strong>Recursively substituting text in many files with <em>find</em> and <em>sed</em>:</strong></p>
<blockquote>
<pre>find . -type f -iname '*.txt' -exec sed -i 's,this,that,g' {} +</pre>
</blockquote>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/Eol4ANhrjFw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/replace-text-in-multiple-files/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/replace-text-in-multiple-files/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Resolve 32-Bit Dependencies on 64-Bit Ubuntu (or Debian) with getlibs</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/m7kdOo_8cs4/</link>
		<comments>http://www.slack-tux.org/howto/resolve-dependencies-with-getlibs/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 16:24:53 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[debian]]></category>

		<category><![CDATA[dpkg]]></category>

		<category><![CDATA[getlibs]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[sudo]]></category>

		<category><![CDATA[ubuntu]]></category>

		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=30</guid>
		<description>One of the more irritating aspects of running a 64-bit distribution is that there are still a large number of applications that are not compiled as native 64-bit binaries. This leads to dependence on 32-bit libraries, and managing these 32-bit dependencies can be a nightmare. There is no shortage of users who have introduced more [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>One of the more irritating aspects of running a 64-bit distribution is that there are still a large number of applications that are not compiled as native 64-bit binaries. This leads to dependence on 32-bit libraries, and managing these 32-bit dependencies can be a nightmare. There is no shortage of users who have introduced more problems than they have solved by forcing the installation of 32-bit libraries.</p>
<p><a title="Cappy" href="http://cappy.wikidot.com/">Cappy</a> has released a handy script to detect and install libraries and other dependencies for 32-bit applications on 64-bit Ubuntu GNU/Linux. Handy things it can do include fetching missing libraries either by name, and figuring out which ones are needed when presented with a given binary.</p>
<p><em>Note: This script makes use of the Debian package management system, and is unlikely to function properly on distributions that are not Debian-based.</em></p>
<p><strong>Installing getlibs</strong></p>
<p>Installation couldn&#8217;t be simpler. Download getlibs, and double-click the .deb package. If you download getlibs via Firefox, you should get an &#8216;Open with gdebi&#8217; option or something equivalent. To install via commandline, try:</p>
<p><code><br />
$ wget http://www.boundlesssupremacy.com/Cappy/getlibs/getlibs-all.deb<br />
$ sudo dpkg -i getlibs-all.deb<br />
</code></p>
<p><strong>Installing Libraries with getlibs</strong></p>
<p>Usage is pretty straightforward. If you know the name of the library you need, you can feed it to getlibs, and it should fetch it.</p>
<p><code><strong>$ sudo getlibs -l libogg.so.0 libSDL-1.2.so.0</strong><br />
Matched library libogg.so.0 to libogg0<br />
Matched library libSDL-1.2.so.0 to libsdl1.2debian-all<br />
Reading package lists&#8230; Done<br />
Building dependency tree<br />
Reading state information&#8230; Done<br />
libogg0 is already the newest version.<br />
The following NEW packages will be installed:<br />
libsdl1.2debian-all<br />
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.<br />
Need to get 213kB of archives.<br />
After unpacking 20.5kB of additional disk space will be used.<br />
Do you want to continue [Y/n]?<br />
</code></p>
<p>Alternatively, provide <em>getlibs</em> with the location of a given binary, and it should figure out what is missing (if anything) and install it. For example, say the binary for <a title="Second Life" href="http://www.secondlife.com/">Second Life</a> was located at <em>/opt/32/secondlife/secondlife.bin</em>:</p>
<p><code><br />
$ sudo getlibs /opt/32/secondlife/secondlife.bin<br />
</code></p>
<p>At which point it should match any libraries that are not currently installed and fetch them, assuming they are available (see above for output example).</p>
<p><strong>Sources</strong></p>
<ul>
<li>http://ubuntuforums.org/showthread.php?t=474790</li>
</ul>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/m7kdOo_8cs4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/resolve-dependencies-with-getlibs/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/resolve-dependencies-with-getlibs/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Setup Parental Controls with DansGuardian and Squid</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/gRdmqa0QvJ0/</link>
		<comments>http://www.slack-tux.org/howto/setup-content-filtering-with-dansguardian/#comments</comments>
		<pubDate>Tue, 19 Jun 2007 18:18:15 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[censorship]]></category>

		<category><![CDATA[content filtering]]></category>

		<category><![CDATA[dansguardian]]></category>

		<category><![CDATA[firefox]]></category>

		<category><![CDATA[proxy]]></category>

		<category><![CDATA[squid]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=24</guid>
		<description>Ignoring the dangers implicit with censorship, this guide should provide a simple way to filter what some may consider &amp;#8216;objectionable&amp;#8217; content from the vast pit of corruption that is the web (this is not meant as a negative thing, mind you. Just a simple observation).
The configuration outlined here may also have the added benefit of [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>Ignoring the dangers implicit with censorship, this guide should provide a simple way to filter what some may consider &#8216;objectionable&#8217; content from the vast pit of corruption that is the web (this is not meant as a negative thing, mind you. Just a simple observation).</p>
<p>The configuration outlined here may also have the added benefit of caching web requests, which can provide not-insignificant performance gains for many home users, most often in the case of frequent accesses to the same site (such as <a href="http://www.facebook.com/">Facebook</a>, which seems to be popular at the time of this writing).</p>
<p><strong>Requirements</strong></p>
<ul>
<li>Proxy software (we will use <a href="http://www.squid-cache.org/">Squid</a> in this example)</li>
<li>Something to filter the content (we will use <a href="http://dansguardian.org/">DansGuardian</a>)</li>
<li>A blacklist of some sort (Optional)</li>
</ul>
<p><strong>Why Content Filtering</strong><br />
A blacklist alone is no longer sufficient for filtering web content effectively. Given the rate at which the web is growing: Approximately 334 new domains were registered every minute over the last 24 hours, according to <a href="http://www.domaintools.com/internet-statistics/">Domain Tools</a>. Add the amount of new content being added to existing domains, and we have a lot of sites to filter. Managing a list of it all would not only require a massive amount of human effort (or computational resources), the size of such a list would be ridiculous, even if compressed. If every request to retreive a site were checked against such a list, the verification delay would be very inconvenient (think of feeding a 5GB+ file to grep, looking for a specific address).</p>
<p>Enter Content Filtering, a technology that inspects individual pages for &#8216;objectionable&#8217; material, and decides based on the <em>contents</em> of those pages whether or not to allow access to them. A blacklist can supplement this technology to improve performance (if the blacklist is small enough, it can be faster to search than the contents of a large page).</p>
<p>Together, they form an effective means of &#8216;cleaning&#8217; the content served to users of your system (or network).</p>
<p><strong>Installing and Configuring Squid</strong></p>
<p>First, we need to install and configure a proxy. We&#8217;ll be using squid for this example, as the caching capabilities it offers provide benefits not found in many competing proxies.</p>
<p><a href="http://www.squid-cache.org/Download/">Download Squid</a> and install it.</p>
<p><code><br />
$ tar xzvf squid-*RELEASE*.tar.gz<br />
$ cd squid-*<br />
$ ./configure<br />
$ make<br />
# make install<br />
</code></p>
<p>In the case of Debian/Ubuntu users compiling from source, some minor tweaks should be made to the configure line, to accomodate the subtle differences in filesystem layout from what Squid would otherwise expect.</p>
<p><code><br />
$ ./configure --prefix=/usr --localstatedir=/var --libexecdir=/usr/lib/squid --srcdir=. --datadir=/usr/share/squid --sysconfdir=/etc/squid<br />
</code></p>
<p>While it is technically possible to build and install Squid on a Debian or Ubuntu system without these changes, they will ensure that the installation aligns with the general filesystem layout of those distributions, and should make distribution-specific troubleshooting a bit easier.</p>
<p>Additionally, a minor tweak to <em>./src/Makefile.am</em> in the directory you extracted to, prior to running <em>make</em> will avoid the need to do silly things. Change this line:</p>
<p><code><br />
DEFAULT_LOG_PREFIX = $(localstatedir)/logs<br />
</code></p>
<p>To make it look like this:</p>
<p><code><br />
DEFAULT_LOG_PREFIX = $(localstatedir)/log<br />
</code></p>
<p>Users of Debian-derivatives (such as Ubuntu or MEPIS) who do not wish to compile from source can simply fetch a recent binary from the supported repositories, and install it. This is easily accomplished with the provided package management tools:</p>
<p><code><br />
$ sudo apt-get install squid<br />
</code></p>
<p>Edit <em>/etc/squid/squid.conf</em> with your editor of choice, paying special attention to the acl/http_access section. Something similar to the following configuration should work (configure according to your network range, of course):</p>
<p><code><br />
acl local_network src 192.168.0.0/24 192.168.254.0/24<br />
http_access allow local_network<br />
</code></p>
<p><strong>Installing and Configuring DansGuardian</strong></p>
<p><a href="http://dansguardian.org/?page=download">Download DansGuardian</a> and install it:</p>
<p><code><br />
$ tar xzvf DansGuardian-*<br />
$ ./configure<br />
$ make<br />
# make install<br />
</code></p>
<p>Debian/Ubuntu users can do the following:</p>
<p><code><br />
$ sudo apt-get install dansguardian<br />
</code></p>
<p>Edit <em>/etc/dansguardian/dansguardian.conf</em>, commenting out the <code>UNCONFIGURED</code> line once complete. Things to pay attention to are&#8230;</p>
<p><code><br />
filterip =<br />
filterport = 8080<br />
proxyip = 127.0.0.1<br />
proxyport = 3128<br />
</code></p>
<p><strong>Configuring Firefox to Filter Content</strong></p>
<p>Setting up a content filtering proxy is effective, but only if it filters information. If requests are not directed through the proxy, it cannot effectively &#8216;clean&#8217; the content of &#8216;objectionable&#8217; material.</p>
<ul>
<li>Edit -&gt; Preferences -&gt; General -&gt; Connection Settings -&gt; Manual Proxy Configuration</li>
<li>Input 127.0.0.1 as the proxy IP</li>
<li>Input 8080 as the proxy port</li>
<li>Enable the checkbox for &#8216;Use this proxy server for all protocols&#8217;</li>
</ul>
<p><em>Please note that these settings only affect Firefox. Other web browsers and software will need to be configured as well. Configuration steps should be similar. If you would like specific examples, please post your requests in the comments for this article.</em></p>
<p><strong>Preventing Users from Disabling the Filter</strong></p>
<p>The restrictions created by a content-filtering proxy can be easily circumvented by simply not using the proxy. Assuming that the users so restricted do not have administrative access, this can be prevented as follows:</p>
<p>Edit <em>/usr/lib/firefox/firefox.cfg</em> and add the following entries:</p>
<p><code><br />
lockPref("network.proxy.http","127.0.0.1");<br />
lockPref("network.proxy.http_port",8080);<br />
lockPref("network.proxy.type,1);<br />
lockPref("network.proxy.no_proxies_on","localhost,127.0.0.1");<br />
</code></p>
<p><strong>Sources</strong></p>
<ul>
<li><a href="http://unixadmintalk.com/f11/content-filtering-proxy-82337/">http://unixadmintalk.com/f11/content-filtering-proxy-82337/</a></li>
<li><a href="http://wiki.squid-cache.org/SquidFaq/CompilingSquid">http://wiki.squid-cache.org/SquidFaq/CompilingSquid</a></li>
<li><a href="http://ubuntuforums.org/showthread.php?t=207008">http://ubuntuforums.org/showthread.php?t=207008</a></li>
<li><a href="http://ubuntuforums.org/showthread.php?t=320733">http://ubuntuforums.org/showthread.php?t=320733</a></li>
<li><a href="http://dansguardian.org/downloads/content_filtering_challenges.pdf">http://dansguardian.org/downloads/content_filtering_challenges.pdf</a></li>
</ul>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/gRdmqa0QvJ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/setup-content-filtering-with-dansguardian/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/setup-content-filtering-with-dansguardian/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Fix Canonical Problems with .htaccess and mod_rewrite</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/sz5ZyeSHJGk/</link>
		<comments>http://www.slack-tux.org/howto/fix-canonical-problems-with-mod_rewrite/#comments</comments>
		<pubDate>Sun, 17 Jun 2007 20:22:57 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[mod_rewrite]]></category>

		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=21</guid>
		<description>Canonical problems occur when there is confusion over which version of a given document is &amp;#8216;official&amp;#8217;.
If a URI identifies a specific document, two different URIs are often treated as two different documents. If the contents of each are identical, it could be assumed that one is a copy of the other. In fact, if we [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>Canonical problems occur when there is confusion over which version of a given document is &#8216;official&#8217;.</p>
<p>If a URI identifies a specific document, two different URIs are often treated as two different documents. If the contents of each are identical, it could be assumed that one is a copy of the other. In fact, if we treat them as two documents, that is the <strong>only</strong> logical conclusion. How then, if both are truly identical in all ways other than URI (same timestamps, content, etc), are we to determine which is official?</p>
<p>This is a canonical problem, and it can be fixed using mod_rewrite.</p>
<p>The most common type of canonical problem occurs when search engines recognize www.yourdomain.com, and yourdomain.com as different sites. A quick fix can be implemented in your .htaccess file like so (using mod_rewrite):</p>
<p>Enable mod_rewrite if it is not already active:</p>
<p><code><br />
RewriteEngine On<br />
</code></p>
<p>And set up a rule to direct the unofficial (non-www in this case) to the official (www) with a status code indicating that this is a permanent redirect (HTTP 301).</p>
<p><code><br />
RewriteCond %{HTTP_HOST} ^yourdomain.com$<br />
RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]<br />
</code></p>
<p>This tells browsers and search bots that the canonical (official) URL for your site is the one with www, and that all requests should be directed there.</p>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/sz5ZyeSHJGk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/fix-canonical-problems-with-mod_rewrite/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/fix-canonical-problems-with-mod_rewrite/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Dual WAN Setup under GNU/Linux</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/1IhdCMKkxw4/</link>
		<comments>http://www.slack-tux.org/howto/setup-dual-wan/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 12:35:31 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[dual wan]]></category>

		<category><![CDATA[iproute]]></category>

		<category><![CDATA[linux]]></category>

		<category><![CDATA[load balancing]]></category>

		<category><![CDATA[multiple interfaces]]></category>

		<category><![CDATA[networking]]></category>

		<category><![CDATA[routing]]></category>

		<guid isPermaLink="false">http://slack-tux.org/?p=3</guid>
		<description>This article presents a reasonably straightforward approach to using two independent internet connections on one system. While the examples are for multiple ethernet connections, some minor modifications could apply the methods to a mixed ethernet/wireless system.
Note: The timestamp on this article may seem unusual. This was written before Slack/Tux was purchased, and relocated to this [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>This article presents a reasonably straightforward approach to using two independent internet connections on one system. While the examples are for multiple ethernet connections, some minor modifications could apply the methods to a mixed ethernet/wireless system.</p>
<p><em>Note: The timestamp on this article may seem unusual. This was written before Slack/Tux was purchased, and relocated to this site, where it was more fitting.</em></p>
<p><strong>Update: <em>The concepts outlined here also work with virtual interfaces (aliases). This can be used to configure multiple IPs on a single interface. While this doesn&#8217;t have a lot of practical advantages for desktop users, there is significant value for servers. Thanks to Mickael Maddison for testing this.</em> </strong></p>
<p>Keep in mind that multiple virtual interfaces would still be a single physical connection though, so the maximum throughput would remain the same. This could also be used to allow a single ethernet card to span multiple subnets.</p>
<p><strong>Requirements</strong></p>
<ul>
<li>PC or router running GNU/Linux</li>
<li>Multiple WAN Connections, either from the same ISP or different ones</li>
<li>A dedicated ethernet adapter for each connection.</li>
</ul>
<p><strong>Update 2008-05-23: <em>It should be noted that this example requires all involved interfaces to be configured already. It assumes IPs have been assigned without using DHCP, though minor changes could account for that. The interfaces must also be active (not stopped). Thanks for Mickael Maddison pointing out that I hadn&#8217;t mentioned that.</em> </strong></p>
<p><strong>Example Setup</strong><br />
In this example, I have a 10MBit Cable connection via <a href="http://www.shaw.ca/">Shaw</a> on eth1, and a 6MBit ADSL connection via <a href="http://www.telus.com/">TELUS</a> on eth2.</p>
<ul>
<li>eth1 - IP 192.168.254.100 / Gateway 192.168.254.1</li>
<li>eth2 - IP 192.168.1.100 / Gateway 192.168.1.254</li>
</ul>
<p><strong>Simple Configuration</strong><br />
First, we need to add two lines to /etc/iproute2/rt_tables<br />
<code><br />
1 Shaw<br />
2 TELUS<br />
</code><br />
And then set up the routing for those tables.<br />
<code><br />
# ip route add 192.168.254.0/24 dev eth1 src 192.168.254.100 table Shaw<br />
# ip route add default via 192.168.254.1 table Shaw<br />
# ip route add 192.168.1.0/24 dev eth2 src 192.168.1.100 table TELUS<br />
# ip route add default via 192.168.1.254 table TELUS<br />
# ip rule add from 192.168.254.100 table Shaw<br />
# ip rule add from 192.168.1.100 table TELUS<br />
</code></p>
<p>Set up evenly weighted round-robin routing for the interfaces.<br />
<code><br />
# ip route add default scope global nexthop via 192.168.254.1 dev eth1 weight 1 nexthop via 192.168.1.254 dev eth2 weight 1<br />
</code></p>
<p><strong>Fixes and workarounds</strong><br />
In the event that you receive a RTNETLINK answers: File exists error, replace the previous entry with&#8230;<br />
<code><br />
# ip route append default scope global nexthop via 192.168.254.1 dev eth1 weight 1 nexthop via 192.168.1.254 dev eth2 weight 1<br />
</code><br />
Then remove the earlier route:<br />
<code><br />
# ip route del<br />
</code></p>
<p>Alternatively, omiting both<br />
<code><br />
# ip route add default via 192.168.254.1 table Shaw<br />
# ip route add default via 192.168.1.254 table TELUS<br />
</code><br />
should prevent this as well.</p>
<p><strong>Slightly more complex configurations</strong><br />
In addition to the basic setup here, the interfaces can be weighted differently, to favour one over the other (useful if one is a larger pipe, as in my setup here).</p>
<p><code><br />
# ip route append default scope global nexthop via 192.168.254.1 dev eth1 weight 5 nexthop via 192.168.1.254 dev eth2 weight 3<br />
</code><br />
In the case of IP-bound services (example: a GigaNews account, which does not allow simultaneous connections from different IPs), a static route is simple to configure:</p>
<p><code><br />
# ip route add 216.196.97.131 via 192.168.254.1<br />
</code></p>
<p>If one of your ISP blocks DNS queries from non-subscribers, then you will need to ensure that your primary DNS server is ISP-agnostic. OpenDNS is a great solution for this. Add the appropriate entries to /etc/resolv.conf<br />
<code><br />
nameserver 208.67.222.222<br />
nameserver 208.67.220.220<br />
</code></p>
<p><strong>Sources</strong></p>
<ul>
<li><a href="http://lartc.org/howto/lartc.rpdb.multiple-links.html">http://lartc.org/howto/lartc.rpdb.multiple-links.html</a></li>
<li><a href="http://www.linuxquestions.org/linux/answers/Networking/Spanning_Multiple_DSLs">http://www.linuxquestions.org/linux/answers/Networking/Spanning_Multiple_DSLs</a></li>
<li><a href="http://mailman.icsi.berkeley.edu/pipermail/xorp-users/2004-October/000266.html">http://mailman.icsi.berkeley.edu/pipermail/xorp-users/2004-October/000266.html</a></li>
</ul>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/1IhdCMKkxw4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/setup-dual-wan/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/setup-dual-wan/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Build .deb Packages from Source in Ubuntu (or Debian)</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/2l91lwjyaGo/</link>
		<comments>http://www.slack-tux.org/howto/build-deb-packages-from-source/#comments</comments>
		<pubDate>Tue, 12 Jun 2007 16:51:48 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[apt]]></category>

		<category><![CDATA[apt-build]]></category>

		<category><![CDATA[apt-get]]></category>

		<category><![CDATA[checkinstall]]></category>

		<category><![CDATA[dpkg]]></category>

		<category><![CDATA[make]]></category>

		<category><![CDATA[sudo]]></category>

		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=16</guid>
		<description>Sometimes, we need to build a package from source. This can be for performance reasons (architecture-specific optimizations), memory reasons (removing features we don&amp;#8217;t need), or just for kicks. In Ubuntu (or any other Debian derivative, for that matter), this can often pose a problem, as such hand-built packages are no longer managed by our Package [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>Sometimes, we need to build a package from source. This can be for performance reasons (architecture-specific optimizations), memory reasons (removing features we don&#8217;t need), or just for kicks. In Ubuntu (or any other Debian derivative, for that matter), this can often pose a problem, as such hand-built packages are no longer managed by our Package Manager. Removal is rarely clean, and updates are no longer tracked.</p>
<p>At least two solutions exist, each suited to a different purpose.</p>
<p><strong>apt-build</strong></p>
<p>The first method relies on the apt-build package, which fetches the latest source available in the repositories listed in your /etc/apt/sources.list file. This source is then compiled into a package (generally the same configuration as if you had installed the binary, unless you specify otherwise) and installed. Updates should still be managed as normal.</p>
<p><em>Note: This method is ideal if the package has source available in one of the repositories you have configured.</em></p>
<p>To install apt-build:<br />
<code><br />
$ sudo apt-get install apt-build<br />
</code></p>
<p>This should add a local repository to /etc/apt/sources.list for any built packages. To ensure that the package manager is aware of this:</p>
<p><code><br />
$ sudo apt-get update<br />
</code></p>
<p>Building a package with the default options can be accomplished as easily as installing a precompiled binary package. For example, to build <a href="http://labs.mozilla.com/2007/10/prism/">Prism</a>:</p>
<p><code><br />
$ sudo apt-build install prism<br />
</code></p>
<p><strong>checkinstall</strong></p>
<p>On occasion, the need may arise for an application that is not included in the standard repositories (or any supplemental ones that have been configured). This is common with niche software, software with licensing complications that prevent it from being hosted in one of the repositories, abandonware, and applications that are have no maintainer beyond the upstream developers.</p>
<p>For cases like these, checkinstall is an ideal solution, as it allows us to build a .deb package for easy removal later. This package will not have updates tracked, but does offer the most flexibility.</p>
<p>To install checkinstall:</p>
<p><code><br />
$ sudo apt-get install checkinstall<br />
</code></p>
<p>With it installed, building from source follows the usual documentation for a package, with one minor adjustment: We substitute the <em>checkinstall</em> command in place of <em>make install</em>. For example:</p>
<p><code><br />
$ tar xjf package-source.tar.bz2<br />
$ cd package-source<br />
$ ./configure<br />
$ make<br />
$ sudo checkinstall<br />
</code></p>
<p>At this point, checkinstall will ask you for a few details about the application being built (package name, version number and such), and construct a .deb package with the appropriate metadata. It will be installed automatically, and the package-name.deb will reside in the current directory. It can be backed up or deleted, depending on your need. Reinstalling it is as simple as:</p>
<p><code><br />
$ sudo dpkg -i package-name.deb<br />
</code></p>
<p>Removal follows the typical style:</p>
<p><code><br />
$ sudo apt-get remove --purge package-name<br />
</code></p>
<p>Where <em>package-name</em> is the name provided to checkinstall when it asked for it.</p>
<p>Again, it is important to note that packages built with checkinstall are not tracked for updates. You need to ensure that you stay aware of any important updates for packages built like this. Many applications have RSS feeds or mailing lists for releases and updates, and subscribing to these could allow you to patch a vulnerable application before it becomes a problem.</p>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/2l91lwjyaGo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/build-deb-packages-from-source/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/build-deb-packages-from-source/</feedburner:origLink></item>
		<item>
		<title>HOWTO - Forcing SSL Connections with .htaccess and mod_rewrite</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/XwMBA4Dh_9w/</link>
		<comments>http://www.slack-tux.org/howto/force-ssl-with-mod_rewrite/#comments</comments>
		<pubDate>Sat, 09 Jun 2007 18:03:09 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[HOWTO]]></category>

		<category><![CDATA[apache]]></category>

		<category><![CDATA[mod_rewrite]]></category>

		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=10</guid>
		<description>Warning! Forcing SSL use like this can cause more problems than it may be worth. Anything that is not SSL-aware will be unable to view your site. This can break compatibility with web services (see the example of FeedBurner below, including a workaround), search spiders (many may regard SSL-enabled content as private, and not index [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p><em><strong>Warning!</strong> Forcing SSL use like this can cause more problems than it may be worth. Anything that is not SSL-aware will be unable to view your site. This can break compatibility with web services (see the example of FeedBurner below, including a workaround), search spiders (many may regard SSL-enabled content as private, and not index it), primitive scrapers (this is a good thing), certain desktop feed readers and blog publishing tools, and more.</em></p>
<p>If you have SSL support enabled (either with a verified SSL certificate, or a self-signed one), you can require all connections to your site to use SSL with a .htaccess file. Note that this uses mod_rewrite.</p>
<p><strong>Requirements</strong></p>
<ul>
<li>Web Server running Apache</li>
<li>mod_rewrite installed and active</li>
<li>An SSL certificate installed and configured</li>
<li>Read/Write permissions on the file &#8216;.htaccess&#8217; in whatever directory you are configuring</li>
</ul>
<p>Enable mod_rewrite if you have not already done so, by adding the following line to your .htaccess file:</p>
<p><code><br />
RewriteEngine On<br />
</code></p>
<p><em><strong>Important Note!</strong> Setting <code>RewriteEngine On</code> multiple times in the same file or in multiple files (such as in a subdirectory) can trigger Internal Server Errors. If some (or all) pages return an HTTP 500 status code after enabling this, check to see if it is already enabled in the current .htaccess, or in the parent directory (check all the way back until you hit your <code>DocumentRoot</code> (usually public_html).</em></p>
<p>With it enabled, we can check which port the request is for (by default 80 is HTTP, 443 is HTTPS). If it is HTTP, silently rewrite the request to HTTPS:</p>
<p><code>RewriteCond %{SERVER_PORT} 80<br />
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]<br />
</code></p>
<p>As mentioned about, this can cause problems with RSS feeds. For example, <a href="http://www.feedburner.com/">FeedBurner</a> is not SSL-aware at the time of this writing, and is unable to parse feeds that have SSL enforced like this. For the specific case of FeedBurner, add the following line before the RewriteRule line:</p>
<p><code>RewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]<br />
</code></p>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/XwMBA4Dh_9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/howto/force-ssl-with-mod_rewrite/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/howto/force-ssl-with-mod_rewrite/</feedburner:origLink></item>
		<item>
		<title>Under New Management</title>
		<link>http://feeds.whatthefork.org/~r/SlackTux/~3/4IXtNvGa1Dg/</link>
		<comments>http://www.slack-tux.org/news/under-new-management/#comments</comments>
		<pubDate>Sun, 29 Oct 2006 06:46:42 +0000</pubDate>
		<dc:creator>Chris Olstrom</dc:creator>
		
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://slack-tux.whatthefork.org/?p=33</guid>
		<description>Slack/Tux has been bought by Chris Olstrom.
Anyone familiar with the previous site will notice that the ad-farm has been taken down in favour of a quality content (in time, of course. I&amp;#8217;m sure it looks rather barren at the moment). Though a large number of the links floating around out there indicate that Slackware-related content [...]&lt;p&gt;Post from: &lt;a href="http://www.slack-tux.org"&gt;Slack/Tux&lt;/a&gt;&lt;/p&gt;</description>
			<content:encoded><![CDATA[<p>Slack/Tux has been bought by <a href="http://chris.olstrom.com" title="Chris Olstrom">Chris Olstrom</a>.</p>
<p>Anyone familiar with the previous site will notice that the ad-farm has been taken down in favour of a quality content (in time, of course. I&#8217;m sure it looks rather barren at the moment). Though a large number of the links floating around out there indicate that Slackware-related content is available here (Italian documentation, as far as I understand), this is not the case. Allow me to extend my apologies for this deception. These links exist from days long past, and are beyond the reach of my editing powers.</p>
<p>I look forward to this space becoming something of value to the GNU/Linux community, and welcome you all (regardless of your chosen distribution).</p>
<p>Post from: <a href="http://www.slack-tux.org">Slack/Tux</a></p>
<img src="http://feeds.feedburner.com/~r/SlackTux/~4/4IXtNvGa1Dg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.slack-tux.org/news/under-new-management/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.slack-tux.org/news/under-new-management/</feedburner:origLink></item>
	</channel>
</rss>
