<?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>Nejko's randomness &#187; Technology</title>
	<atom:link href="http://nejc.skoberne.net/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://nejc.skoberne.net</link>
	<description>Random thoughts with high entropy</description>
	<lastBuildDate>Sun, 20 Mar 2011 22:12:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>phpBB: Export all posts for a user into a file</title>
		<link>http://nejc.skoberne.net/2011/02/phpbb-export-all-posts-for-a-user-into-a-file/</link>
		<comments>http://nejc.skoberne.net/2011/02/phpbb-export-all-posts-for-a-user-into-a-file/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 23:58:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=164</guid>
		<description><![CDATA[Few days ago, one of the users of the phpBB-based forum I administer, asked if he could have all his posts (few hundreds of them) exported as text and delivered via e-mail. After a quick Google search, I could find any such script, so I created my own. I wrote it in Python and the [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago, one of the users of the phpBB-based forum I administer, asked if he could have all his posts (few hundreds of them) exported as text and delivered via e-mail. After a quick Google search, I could find any such script, so I created my own. I wrote it in Python and the only requirement is that you have MySQLdb Python module installed (python-mysqldb in Debian).</p>
<p>Here it goes (I am a Python beginner, so beware):</p>
<div class="codecolorer-container python default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="python codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">import</span> MySQLdb<br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">getopt</span><br />
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Usage: PhpbbExportPosts.py [options]'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Obligatory arguments:'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;DBHOST: MySQL database hostname'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;DBUSER: MySQL database user<span style="color: #000099; font-weight: bold;">\'</span>s username'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;DBPASS: MySQL database user<span style="color: #000099; font-weight: bold;">\'</span>s password'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;DBNAME: MySQL database name of phpBB'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;POSTER: Username of the author of the posts to be exported'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Options:'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;--prefix=PREFIX<span style="color: #000099; font-weight: bold;">\t</span>Table name prefix (default: phpbb_)'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;--file=FILE<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Output file name (default: none (stdout))'</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">' &nbsp;--help<span style="color: #000099; font-weight: bold;">\t</span><span style="color: #000099; font-weight: bold;">\t</span>Print this help'</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">def</span> main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Finish at once if there are to few arguments</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> <span style="color: #ff4500;">6</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># (Try to) parse the options</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">try</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; opts<span style="color: #66cc66;">,</span> args <span style="color: #66cc66;">=</span> <span style="color: #dc143c;">getopt</span>.<span style="color: #dc143c;">getopt</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">6</span>:<span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'pfh'</span><span style="color: #66cc66;">,</span> <span style="color: black;">&#91;</span><span style="color: #483d8b;">'prefix='</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'file='</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'help'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #dc143c;">getopt</span>.<span style="color: black;">GetoptError</span><span style="color: #66cc66;">,</span> err:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span>err<span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Set options defaults</span><br />
&nbsp; &nbsp; <span style="color: #008000;">file</span> <span style="color: #66cc66;">=</span> <span style="color: #008000;">None</span><br />
&nbsp; &nbsp; prefix <span style="color: #66cc66;">=</span> <span style="color: #483d8b;">'phpbb_'</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Set the variables regarding to the options</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">for</span> o<span style="color: #66cc66;">,</span> a <span style="color: #ff7700;font-weight:bold;">in</span> opts:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> o <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'-h'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'--help'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; usage<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #dc143c;">sys</span>.<span style="color: black;">exit</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">elif</span> o <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'-p'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'--prefix'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; prefix <span style="color: #66cc66;">=</span> a<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">elif</span> o <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: black;">&#40;</span><span style="color: #483d8b;">'-f'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'--file'</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000;">file</span> <span style="color: #66cc66;">=</span> a<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">assert</span> <span style="color: #008000;">False</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">&quot;Unhandled option&quot;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Establish connection to MySQL</span><br />
&nbsp; &nbsp; conn<span style="color: #66cc66;">=</span>MySQLdb.<span style="color: black;">connect</span><span style="color: black;">&#40;</span>host<span style="color: #66cc66;">=</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span><span style="color: #dc143c;">user</span><span style="color: #66cc66;">=</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span> \<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;passwd<span style="color: #66cc66;">=</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span>db<span style="color: #66cc66;">=</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Set character set to UTF-8, which should be correct for phpBB</span><br />
&nbsp; &nbsp; conn.<span style="color: black;">set_character_set</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'utf8'</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Get a database cursor and set UTF-8 everywhere where possible</span><br />
&nbsp; &nbsp; cursor <span style="color: #66cc66;">=</span> conn.<span style="color: black;">cursor</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SET NAMES utf8;&quot;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SET CHARACTER SET utf8;&quot;</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SET character_set_connection=utf8;&quot;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Run the MySQL query to get all the posts of the selected poster</span><br />
&nbsp; &nbsp; cursor.<span style="color: black;">execute</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;SELECT a.post_time, a.post_subject, a.post_text <span style="color: #000099; font-weight: bold;">\</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; FROM &quot;</span> + prefix + <span style="color: #483d8b;">&quot;posts a, &quot;</span> + prefix + <span style="color: #483d8b;">&quot;users b <span style="color: #000099; font-weight: bold;">\</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WHERE a.poster_id=b.user_id <span style="color: #000099; font-weight: bold;">\</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AND b.username='&quot;</span> + <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">5</span><span style="color: black;">&#93;</span> + <span style="color: #483d8b;">&quot;'&quot;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Open file for writing or use standard output</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">file</span> <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; output<span style="color: #66cc66;">=</span><span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #008000;">file</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">'w'</span><span style="color: black;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">else</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; output<span style="color: #66cc66;">=</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">stdout</span><br />
<br />
&nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Print the formatted posts into a file one by one</span><br />
&nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Get the next post</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; row <span style="color: #66cc66;">=</span> cursor.<span style="color: black;">fetchone</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Exit when there are no more posts</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">if</span> row <span style="color: #66cc66;">==</span> <span style="color: #008000;">None</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">break</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Inter-post delimiter line</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; output.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'================================================================================<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #808080; font-style: italic;"># Also remove all HTML tags with a regular expression</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; output.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Post date: %s<span style="color: #000099; font-weight: bold;">\n</span>Post subject: %s<span style="color: #000099; font-weight: bold;">\n</span>Post content:<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>%s<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>'</span> % <span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: black;">ctime</span><span style="color: black;">&#40;</span>row<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: #66cc66;">,</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: #66cc66;">,</span> <span style="color: #dc143c;">re</span>.<span style="color: black;">sub</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;.*&gt;'</span><span style="color: #66cc66;">,</span> <span style="color: #483d8b;">''</span><span style="color: #66cc66;">,</span> row<span style="color: black;">&#91;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Number of posts exported: %d&quot;</span> % cursor.<span style="color: black;">rowcount</span><br />
<br />
<span style="color: #ff7700;font-weight:bold;">if</span> __name__ <span style="color: #66cc66;">==</span> <span style="color: #483d8b;">&quot;__main__&quot;</span>:<br />
&nbsp; &nbsp; main<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></div>
<p>Alternatively, you can download it from <a href="http://nejc.skoberne.net/transfer/PhpbbExportPosts.py" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2011/02/phpbb-export-all-posts-for-a-user-into-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IPv6 address database: ipv6list.com</title>
		<link>http://nejc.skoberne.net/2011/02/ipv6-address-database-ipv6list-com/</link>
		<comments>http://nejc.skoberne.net/2011/02/ipv6-address-database-ipv6list-com/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 23:10:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=150</guid>
		<description><![CDATA[A few weeks ago I saw a presentation from van Hauser titled Recent advances in IPv6 insecurities. He merges three different sources of IPv6 addresses to obtain a database of IPv6 addresses: search engines and databases (directories), DNS (bruteforcing), common addresses. He shows that this method is quite successful for those who are interested in [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I saw a <a title="Recent advances in IPv6 insecurities" href="http://vimeo.com/18318798" target="_blank">presentation</a> from van Hauser titled <em>Recent advances in IPv6 insecurities</em>. He merges three different sources of IPv6 addresses to obtain a database of IPv6 addresses:</p>
<ul>
<li>search engines and databases (directories),</li>
<li>DNS (bruteforcing),</li>
<li>common addresses.</li>
</ul>
<p>He shows that this method is quite successful for those who are interested in getting as many IPv6 addresses as possible. So I was thinking &#8211; why not put up a public databases of such addresses and provide a way for anybody to contribute them.</p>
<p>The main purpose of such database is to make IPv6 Internet a bit more &#8220;enumeratable&#8221; for those who would like doing any kind of research on the nature and behaviour of IPv6 Internet. Also, it may convince those who would like to not be listed (I guess for security through obscurity reasons) to actually renumber from &lt;prefix&gt;::1 to something else.</p>
<p>Of course, any ideas about other possible techniques for harvesting IPv6 addresses, are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2011/02/ipv6-address-database-ipv6list-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>netfilter&#8217;s way of tracking ICMPv6 connections</title>
		<link>http://nejc.skoberne.net/2011/02/netfilters-way-of-tracking-icmpv6-connections/</link>
		<comments>http://nejc.skoberne.net/2011/02/netfilters-way-of-tracking-icmpv6-connections/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 02:06:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=145</guid>
		<description><![CDATA[These days I am configuring a Debian-based firewall, whose iptables policy is being managed by Firewall Builder tool. Check it out, it&#8217;s a really cool, object-based firewall policy management tool. However, I was quite stumped when I realized that if I make an &#8220;allow all&#8221; mixed (IPv4/IPv6) policy, the ICMPv6 packets are not let through [...]]]></description>
			<content:encoded><![CDATA[<p>These days I am configuring a Debian-based firewall, whose iptables policy is being managed by Firewall Builder tool. Check it out, it&#8217;s a really cool, object-based firewall policy management tool.</p>
<p>However, I was quite stumped when I realized that if I make an &#8220;allow all&#8221; mixed (IPv4/IPv6) policy, the ICMPv6 packets are not let through the bridge (I am doing filtering on a bridge interface). This is not really intuitive, so I thought it must be some kind of bug. I still recall, that some time ago, netfilter had serious problems tracking IPv6 connections (it would match improperly match valid connections, which made it impossible to drop the packets, which matched INVALID state).</p>
<p>My rationale was: I should pass all IPv6 packets, which match NEW, RELATED or ESTABLISHED state in both directions and I should be fine. This is also what Firewall Builder generates. However, I found out that ICMPv6 packets other than PING (echo/reply) don&#8217;t match netfilter states at all! So that was why Firewall Builder&#8217;s policy wouldn&#8217;t let my ICMPv6 packets (e.g. neighbor discovery) through.</p>
<p>The solution is straightforward: make an additional &#8220;allow any&#8221; rule only for ICMPv6 packets and make it stateless. Firewall Builder nicely supports that, you can double click the Options column and check the &#8220;Stateless&#8221; check box.</p>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2011/02/netfilters-way-of-tracking-icmpv6-connections/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint Services 3.0 dead after applying KB983444</title>
		<link>http://nejc.skoberne.net/2010/10/sharepoint-services-3-0-dead-after-applying-kb983444/</link>
		<comments>http://nejc.skoberne.net/2010/10/sharepoint-services-3-0-dead-after-applying-kb983444/#comments</comments>
		<pubDate>Wed, 13 Oct 2010 12:01:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=140</guid>
		<description><![CDATA[I am not a Windows administrator, really. But I do take care of one Windows 2008 SBS machine and we have Exchange 2007 and SharePoint Services 3.0 installed. Recently, I installed a security update for Windows SharePoint Services 3.0 (KB983444). After rebooting, all my SharePoint sites were down (404 error). It took me quite a [...]]]></description>
			<content:encoded><![CDATA[<p>I am not a Windows administrator, really. But I do take care of one Windows 2008 SBS machine and we have Exchange 2007 and SharePoint Services 3.0 installed. Recently, I installed a security update for Windows SharePoint Services 3.0 (KB983444). After rebooting, all my SharePoint sites were down (404 error). It took me quite a few hours to put them back online. I did tried many things, among them:</p>
<ul>
<li>running SharePoint Products and Technologies Configuration Wizard, which failed at step 9/10,</li>
<li>running &#8220;<em>psconfig -cmd upgrade -inplace b2b -wait -force</em>&#8220;, which failed with various errors.</li>
</ul>
<p>Finally, I did this to solve the problem: I connected to Central Administration and then went to &#8220;Operations&#8221; tab. Then, I chose &#8220;Services on Server&#8221; and clicked &#8220;Windows SharePoint Services Search&#8221;. There, I entered my administrator account as the &#8220;Service Account&#8221;. I saved the changes and then rerun SharePoint Products and Technologies Configuration Wizard, which worked this time (although it took it very long time to do everything it had to do).</p>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2010/10/sharepoint-services-3-0-dead-after-applying-kb983444/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RCPFA 1.0.5 available</title>
		<link>http://nejc.skoberne.net/2009/02/rcpfa-105-available/</link>
		<comments>http://nejc.skoberne.net/2009/02/rcpfa-105-available/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 23:05:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=123</guid>
		<description><![CDATA[The 1.0.5 version is out. It makes RCPFA compatible with RoundCube 0.2-stable. Thanks to Andrey Sharandakov!]]></description>
			<content:encoded><![CDATA[<p>The 1.0.5 version is <a href="http://nejc.skoberne.net/projects/rcpfa/" target="_self">out</a>. It makes RCPFA compatible with RoundCube 0.2-stable. Thanks to Andrey Sharandakov!</p>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2009/02/rcpfa-105-available/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>gmirror and gvinum on the same drives</title>
		<link>http://nejc.skoberne.net/2008/11/gmirror-and-gvinum-on-the-same-drives/</link>
		<comments>http://nejc.skoberne.net/2008/11/gmirror-and-gvinum-on-the-same-drives/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 21:05:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[gmirror]]></category>
		<category><![CDATA[gvinum]]></category>
		<category><![CDATA[RAID]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=99</guid>
		<description><![CDATA[In 2006, when I was installing a FreeBSD server for our client, one of the requests was also a RAID-5 array of some kind. I checked out and discovered GEOM vinum (or gvinum), which provided what I needed at that time. It is a file server, but throughput is not a critical issue, so I [...]]]></description>
			<content:encoded><![CDATA[<p>In 2006, when I was installing a <a class="zem_slink" title="FreeBSD" rel="homepage" href="http://www.freebsd.org">FreeBSD</a> server for our client, one of the requests was also a <a class="zem_slink" title="RAID" rel="wikipedia" href="http://en.wikipedia.org/wiki/RAID">RAID</a>-5 array of some kind. I checked out and discovered <a href="http://www.freebsdwiki.net/index.php/Gvinum" target="_blank">GEOM vinum</a> (or gvinum), which provided what I needed at that time. It is a <a class="zem_slink" title="File server" rel="wikipedia" href="http://en.wikipedia.org/wiki/File_server">file server</a>, but throughput is not a critical issue, so I tried it (at that time, <a href="http://en.wikipedia.org/wiki/Geom_raid5" target="_blank">graid5</a> was not yet available, AFAIK). I am writing this because this weekend I had to rebuild the array (and copy the data) with new, larger drives, which took me many hours to do it, because there is not so many documentation on how to make different <a href="http://en.wikipedia.org/wiki/GEOM" target="_blank">GEOM</a> RAID subsystems share the same three drives.</p>
<p>This is what I wanted to achieve: have three drives, which would contain two <a href="http://www.freebsd.org/doc/en/books/handbook/geom-mirror.html" target="_blank">gmirror</a> (RAID-1) arrays (one for root partition, the other for swap) and three gvinum (RAID-5) volumes &#8211; for <a class="zem_slink" title="Filesystem Hierarchy Standard" rel="wikipedia" href="http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard"></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/var</div></div>
<p></a>,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/tmp</div></div>
<p>and</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr</div></div>
<p>. For the latter, it is best to use volume management capabilities of gvinum, which allows you to join only three physical devices (or slices or partitions) with it, so that the logical volumes are created &#8220;inside&#8221; the vinum manager.</p>
<p>The main problem was, that I forgot how to do this &#8220;properly&#8221;. It was 2 years since I did this (of course, I didn&#8217;t write it down how I did it, although it took me a few hours) last time and since the machine is far away, I don&#8217;t have physical access. This would have helped, because I could just put the old drives back and see how they were configured, but the remote system administrator already exchanged the drives and I didn&#8217;t want to bother him.</p>
<p>In FreeBSD terms, a partition is a logical unit, which resides on a slice (which is actually a partition from other operating systems&#8217; point of view).  Let&#8217;s have four drives on the system:</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad0</div></div>
<p>,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad1</div></div>
<p>,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad2</div></div>
<p>and</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad3</div></div>
<p>. We&#8217;ll assume that on</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad0</div></div>
<p>there is the system we are booting and running FreeBSD at the moment and we wan&#8217;t to create the arrays on the other three drives, which will eventually run by themselves (we&#8217;ll pull the</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad0</div></div>
<p>out when we finish). When you create a slice on</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad1</div></div>
<p>, for example, you&#8217;ll be able to access it via</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad1s1</div></div>
<p>. When you create a partition on this slice, you&#8217;ll see it as</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad1s1a</div></div>
<p>, where the last letter &#8220;a&#8221; can also be &#8220;b&#8221;, &#8220;d&#8221;, &#8220;e&#8221;, and so on, you know the alphabet. This naming system is somewhat <a href="http://www.freebsd.org/doc/en/books/handbook/disk-organization.html" target="_blank">peculiar</a>, and I don&#8217;t like it but I can live with it. The letter &#8220;a&#8221; usually hosts the root partition, and the letter &#8220;b&#8221; provides swap space. As you can see, there is no letter &#8220;c&#8221;. This is because it specifies the whole slice and therefore it should not be used for anything else.</p>
<p>Usually, when you&#8217;re setting up the gmirror RAID-1 on FreeBSD, you make put it on the physical drive directly, i.e. you make the</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad0</div></div>
<p>visible as</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/mirror/gm0</div></div>
<p>(after you put the metadata on the drive, by running &#8216;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gmirror create</div></div>
<p>&#8216;), which also means that all existing slices and partitions will be visible at the new location. If you had</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad0s1a</div></div>
<p>, you&#8217;ll now have</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/mirror/gm0s1a</div></div>
<p>. Which is very nice and makes gmirror very easy to set up after the system was installed. In the end, you just add other mirrors (</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad1</div></div>
<p>, &#8230;) in the array and that&#8217;s it.</p>
<p>However, if you want to use gvinum on the same drives (to make RAID-5 arrays, for example), you can&#8217;t do that. You&#8217;ll need to gmirror something else: the slices or the partitions, but not the whole drives. Now FreeBSD allows you to have no slices at all &#8211; to create the FreeBSD partitions (the letters) directly on the drive (so you&#8217;ll have</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/ad1a</div></div>
<p>). So when I started to think about how I would partition the drives and which units will I merge with gvinum and gmirror, I became a bit confused. So I tried a few ideas I had and none of them really worked because I didn&#8217;t know what actually the command such as &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">bsdlabel -w</div></div>
<p>&#8220;, &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">boot0cfg</div></div>
<p>&#8220;, &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gmirror label</div></div>
<p>&#8220;, &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gvinum create</div></div>
<p>&#8221; and creating slices via &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sysinstall</div></div>
<p>&#8221; actually do. Where do they write their data? At what offsets and what are the sizes of these metadata? I found it quite annoying that there isn&#8217;t much documentation about this (at least not well organized), so I had to do some homework. Here is what I discovered:</p>
<p><strong>gvinum &#8212; </strong>When you run &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gvinum create</div></div>
<p>&#8220;, it will rewrite the bytes from <strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">0x1000</div></div>
<p></strong> to <strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">0x21200</div></div>
<p></strong>, that is from block 8 (first 8 blocks are left untouched) to block 265 with its own configuration data, so you have to be careful not to mess with these blocks.</p>
<p><strong>gmirror &#8212; </strong>Running &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gmirror label</div></div>
<p>&#8221; puts gmirror&#8217;s metadata on the last block of the device. The size in blocks of the mirror is then number of block of the device &#8211; 1.</p>
<p><strong>bsdlabel &#8212; </strong>When labelling a slice (or the drive directly), bsdlabel writes label information to the second block (from address <strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">0x200</div></div>
<p></strong> on, in my tests it never passed the <strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">0x2c0</div></div>
<p></strong> limit, which still fits into the second block).</p>
<p><strong>boot0cfg &#8212; </strong>Since it rewrites the <a class="zem_slink" title="Master boot record" rel="wikipedia" href="http://en.wikipedia.org/wiki/Master_boot_record">MBR</a> with BootMgr, this means it rewrites the first block (block 0) of the drive.</p>
<p><strong>fdisk &#8212; </strong>Fdisk writes the slice information into first 16 blocks of <strong>the slice</strong>. This means, that you shouldn&#8217;t label them with bsdlabel (don&#8217;t assign them to any of the partitions), or you can have problems.</p>
<p>To sum up, the only configuration, which worked for me on FreeBSD 6.1 (yes, quite old one) was the following. First I created slices on all of the drives (one on each drive) and wrote the BootMgr onto them (you can do this easily by running <strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">sysinstall</div></div>
<p></strong> and then going to <strong>Custom </strong>and then <strong>Partition</strong>. You select the first drive (of the three) and then, when in fdisk-editor, press <strong>a</strong> and then <strong>w</strong> to write the slice. When asked about MBR, just say <strong>BootMgr</strong> and that&#8217;s it. This will ensure that there is a boot manager on the drive (which means you can boot from it). You have to repeat this procedure for the other (two) drives as well.</p>
<p>Then, you have to edit the label of all three slices, running &#8220;<strong></p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">bsdlabel -e /dev/ad1s1</div></div>
<p></strong>&#8221; (for the slice on the first drive). You have to provide the following partition set:</p>
<pre>a:  1048576       16    4.2BSD        0     0     0
b:  4194304  1048592      swap
c: 976768002       0    unused        0     0         # "raw" part, don't edit
d: 971525106 5242896     vinum</pre>
<p>In this configuration you can see that the size of &#8220;a&#8221; (root) partition is 1048576 512-byte blocks which means 512 MB. The offset of 16 blocks for the &#8220;a&#8221; partition is very important, since the slice needs the first 16 blocks for itself. The size of the &#8220;b&#8221; (swap) partition is 4 times the size of &#8220;a&#8221; (2 GB) and the &#8220;d&#8221; takes all the space left on the slice.</p>
<p>So the idea is to make two gmirror arrays, the first one will consist of the three &#8220;a&#8221; partitions (remember, we have three hard drives) and will be used as the root partition. The second one will consist of the three &#8220;b&#8221; partitions and will be used as swap space. All the &#8220;d&#8221; partitions will be used for the construction of the gvinum array.</p>
<p>First, you need to load the</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">geom_mirror module</div></div>
<p>, which enables kernel to handle the gmirror arrays. You do this by running &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">kldload geom_mirror</div></div>
<p>&#8220;. But, it is needed to make this change permanent (so the module will load at boot) so you need to add these two lines to</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/boot/loader.conf</div></div>
<p>:</p>
<pre>geom_mirror_load="YES"
geom_vinum_load="YES"</pre>
<p>This will also enable loading gvinum at boot, which we will need later (when the system will boot from the new arrays). No it&#8217;s time to create the arrays. You&#8217;ll run something like:</p>
<pre># gmirror label -v -b round-robin root /dev/ad1s1a
# gmirror label -v -b round-robin swap /dev/ad1s1b
# gmirror insert root /dev/ad2s1a
# gmirror insert root /dev/ad3s1a
# gmirror insert swap /dev/ad2s1b
# gmirror insert swap /dev/ad3s1b</pre>
<p>This was for the gmirror arrays. Now make a file named</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gvinum.conf</div></div>
<p>and put this in it:</p>
<pre>drive disk1 device /dev/ad1s1d
drive disk2 device /dev/ad2s1d
drive disk3 device /dev/ad3s1d
 volume var
  plex org raid5 491k
   sd length 1024m drive disk1
   sd length 1024m drive disk2
   sd length 1024m drive disk3
 volume tmp
  plex org raid5 491k
   sd length 512m drive disk1
   sd length 512m drive disk2
   sd length 512m drive disk3
 volume usr
  plex org raid5 491k
   sd length 0 drive disk1
   sd length 0 drive disk2
   sd length 0 drive disk3</pre>
<p>And then you run:</p>
<pre># gvinum create gvinum.conf</pre>
<p>This will create three gvinum RAID-5 arrays &#8211; for</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/var</div></div>
<p>,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr</div></div>
<p>and</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/tmp</div></div>
<p>. They will be accessible via</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/gvinum/var</div></div>
<p>,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/gvinum/usr</div></div>
<p>and</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/dev/gvinum/tmp</div></div>
<p>respectively. You should know, that the size of the RAID-5 array is the sum of the size of all drives &#8211; the size of one drive. This makes our</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/var</div></div>
<p>2 GB,</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/tmp</div></div>
<p>1GB and</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/usr</div></div>
<p>the rest. If you execute &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gvinum list</div></div>
<p>&#8221; now, you&#8217;ll see that all the arrays are marked as <strong>up</strong>. However, this will not be the case after you reboot. I don&#8217;t know exactly why, perhaps this is a bug. Also I am not sure if it is present in the newest FreeBSD releases. So it is very important now, that you <strong>reboot</strong> the system now. After it comes back online, you have to run:</p>
<pre># gvinum start var
# gvinum start usr
# gvinum start tmp</pre>
<p>Then you have to wait for the arrays to become synchronized. It may take a while. You can always check status with &#8221;</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">gvinum list</div></div>
<p>&#8220;. When the arrays are synchronized, you need to create the filesystems on all of them:</p>
<pre># newfs /dev/mirror/root
# newfs -U /dev/gvinum/var
# newfs -U /dev/gvinum/usr
# newfs -U /dev/gvinum/tmp</pre>
<p>After that, you should mount these new arrays in</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/mnt</div></div>
<p>and copy the system, you are running now onto them:</p>
<pre># mount /dev/mirror/root /mnt
# cd /mnt
# mkdir var tmp usr
# chmod 1777 tmp
# mount /dev/gvinum/var /mnt/var
# mount /dev/gvinum/usr /mnt/usr
# mount /dev/gvinum/tmp /mnt/tmp
# cd / &amp;&amp; find . -xdev | cpio -pm /mnt
# cd /var &amp;&amp; find . -xdev | cpio -pm /mnt/var
# cd /usr &amp;&amp; find . -xdev | cpio -pm /mnt/usr
# cd /tmp &amp;&amp; find . -xdev | cpio -pm /mnt/tmp</pre>
<p>Finally, you have to modify your</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">fstab</div></div>
<p>file on the root gmirror array. Edit</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/mnt/etc/fstab</div></div>
<p>as follows:</p>
<pre># Device                Mountpoint      FStype  Options         Dump    Pass#
/dev/mirror/swap        none            swap    sw              0       0
/dev/mirror/root        /               ufs     rw              1       1
/dev/gvinum/tmp         /tmp            ufs     rw              2       2
/dev/gvinum/usr         /usr            ufs     rw              2       2
/dev/gvinum/var         /var            ufs     rw              2       2
/dev/acd0               /cdrom          cd9660  ro,noauto       0       0</pre>
<p>Now you can try to boot the system from one of the three drives which hold the RAID arrays and you should be lucky. If you aren&#8217;t, you are welcome to post comments here and we&#8217;ll try to sort it out together.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/e81a812b-6bbf-4f2b-a7fd-73e32c29517d/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=e81a812b-6bbf-4f2b-a7fd-73e32c29517d" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2008/11/gmirror-and-gvinum-on-the-same-drives/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenVPN package generator</title>
		<link>http://nejc.skoberne.net/2008/11/openvpn-package-generator/</link>
		<comments>http://nejc.skoberne.net/2008/11/openvpn-package-generator/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 09:42:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[EJBCA]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[OpenVPN]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Virtual private network]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=83</guid>
		<description><![CDATA[OpenVPN is an open, secure and thoroughly tested VPN technology. Our company Infrax d.o.o. also provides OpenVPN clients for customers to be able to access their companies&#8217; networks. We don&#8217;t use password-based authentication, but certificate-based one, which means we have our own full-blown Certificate Authority (self signed, of course). We use EJBCA for that and [...]]]></description>
			<content:encoded><![CDATA[<p><a class="zem_slink" title="OpenVPN" rel="homepage" href="http://openvpn.net/">OpenVPN</a> is an open, secure and thoroughly tested <a class="zem_slink" title="Virtual private network" rel="wikipedia" href="http://en.wikipedia.org/wiki/Virtual_private_network">VPN</a> technology. Our company Infrax d.o.o. also provides OpenVPN clients for customers to be able to access their companies&#8217; networks. We don&#8217;t use password-based authentication, but certificate-based one, which means we have our own full-blown <a class="zem_slink" title="Certificate authority" rel="wikipedia" href="http://en.wikipedia.org/wiki/Certificate_authority">Certificate Authority</a> (self signed, of course). We use <a href="http://www.ejbca.org/" target="_blank">EJBCA</a> for that and it works beautifully.</p>
<p>However, our customers are expecting simple solutions: a single package with their own config file and certificate. Although EJBCA supports generating OpenVPN packages on the fly on the server, it would be a bit more complicated to make it work, because we need to generate different config files for our customers. Which means we would need a special <a class="zem_slink" title="Lookup table" rel="wikipedia" href="http://en.wikipedia.org/wiki/Lookup_table">lookup-table</a> (we could use the EJBCA&#8217;s <a class="zem_slink" title="MySQL" rel="homepage" href="http://www.mysql.com">MySQL</a> database) which would link specific fields in certificates&#8217; &#8220;distingished name&#8221; with corresponding OpenVPN config files. This would be possible, but a bit too complicated for now.</p>
<p>So I decided that we create the packages &#8220;semi-manually&#8221;, i.e. manually but in &#8220;batch&#8221; mode. First, you need <a href="http://nejc.skoberne.net/wp-content/uploads/2008/11/openvpn-generator.zip" target="_blank">my package</a> which includes OpenVPN source environment (OpenVPN 2.1 RC7) which will be compiled with <a class="zem_slink" title="Nullsoft Scriptable Install System" rel="homepage" href="http://nsis.sourceforge.net/">NSIS</a> into an <a class="zem_slink" title="Executable" rel="wikipedia" href="http://en.wikipedia.org/wiki/Executable">executable</a> together with the certificate and config files.</p>
<p>Then you need to obtain the certificates for the clients you want to create the packages for and provide the config file as well. You must also install <a href="http://nsis.sourceforge.net/" target="_blank">NSIS</a> and then you are ready. Just run &#8220;generate.cmd&#8221; file in the &#8220;openvpn-generator&#8221; directory and the executables will be created in &#8220;openvpn-generator/exes&#8221;.</p>
<p>If you have problems, questions, just let me know.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/cf12f832-416a-4e71-834f-83bc1bb1929d/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=cf12f832-416a-4e71-834f-83bc1bb1929d" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2008/11/openvpn-package-generator/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Nejc Škoberne, univ. dipl. inž. rač. in inf.</title>
		<link>http://nejc.skoberne.net/2008/11/nejc-skoberne-univ-dipl-inz-rac-in-inf/</link>
		<comments>http://nejc.skoberne.net/2008/11/nejc-skoberne-univ-dipl-inz-rac-in-inf/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 01:50:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[graduation]]></category>
		<category><![CDATA[pfSense]]></category>
		<category><![CDATA[thesis]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=74</guid>
		<description><![CDATA[Voilà. I just graduated today (actually yesterday, it is early morning when I am writing this). A chapter of my life which lasted for the last 6 years is closed now. And it feels good. Thanks to everybody who came to my presentation. It is very nice to have friends like you. Also thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>Voilà. I just graduated today (actually yesterday, it is early morning when I am writing this). A chapter of my life which lasted for the last 6 years is closed now. And it feels good.</p>
<p>Thanks to everybody who came to my presentation. It is very nice to have friends like you. Also thanks to my mentor, Borut Robič and to my parents who supported me for all those years. Thanks to mom, Janja and Anica who baked all the cookies for the short after-party in the LALG laboratory. Finally, special thanks to my wife Mica and my son Jakob, who felt a bit of stress in the last days too.</p>
<p>You can get my thesis <a href="http://nejc.skoberne.net/wp-content/uploads/2008/11/diplomska.pdf">here</a>. It is titled &#8220;Improvement of <a class="zem_slink" title="PfSense" rel="homepage" href="http://www.pfsense.org/">pfSense</a> firewall with user services&#8221; or &#8220;Nadgradnja požarnega zidu pfSense z uporabniškimi storitvami&#8221; (Slovenian translation). For non-Slovenian readers, the text is in <a class="zem_slink" title="Slovene language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Slovene_language">Slovenian language</a>, so probably you won&#8217;t understand most of it. However, I plan to translate at least the most important parts into English so it could be used by pfSense developers as well. I&#8217;ll make a special page called Papers soon, so all my papers will be there some day.<a href="http://nejc.skoberne.net/wp-content/uploads/2008/11/diplomska.pdf"><br />
</a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/d5207079-9e74-45a0-9a8d-d05a0a2310d8/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=d5207079-9e74-45a0-9a8d-d05a0a2310d8" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2008/11/nejc-skoberne-univ-dipl-inz-rac-in-inf/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>RCPFA 1.0.4 released</title>
		<link>http://nejc.skoberne.net/2008/11/rcpfa-104-released/</link>
		<comments>http://nejc.skoberne.net/2008/11/rcpfa-104-released/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 09:28:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[PostfixAdmin]]></category>
		<category><![CDATA[RoundCube]]></category>
		<category><![CDATA[System administration]]></category>
		<category><![CDATA[Webmail]]></category>

		<guid isPermaLink="false">http://nejc.skoberne.net/?p=65</guid>
		<description><![CDATA[Dear RoundCube and PostfixAdmin users, I just released the 1.0.4 version of RCPFA bridge, which makes RoundCube and PostfixAdmin interoperate. Many people have requested that it would be nice to have RCPFA for RoundCube 0.2beta available, and here it is. So this version doesn&#8217;t provide any new features, it only provides compatibility with 0.2beta. Hope [...]]]></description>
			<content:encoded><![CDATA[<p>Dear <a class="zem_slink" title="RoundCube" rel="homepage" href="http://www.roundcube.net/">RoundCube</a> and PostfixAdmin users, I just released the 1.0.4 version of <a href="http://nejc.skoberne.net/projects/rcpfa" target="_self">RCPFA bridge</a>, which makes RoundCube and <a href="http://postfixadmin.sourceforge.net" target="_blank">PostfixAdmin</a> <a class="zem_slink" title="Interoperability" rel="wikipedia" href="http://en.wikipedia.org/wiki/Interoperability">interoperate</a>. Many people have requested that it would be nice to have RCPFA for RoundCube 0.2beta available, and here it is. So this version doesn&#8217;t provide any new features, it only provides compatibility with 0.2beta. Hope it works for you too.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Zemified by Zemanta" href="http://reblog.zemanta.com/zemified/3672d28b-a742-4ae3-be50-19feac2ebf5c/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=3672d28b-a742-4ae3-be50-19feac2ebf5c" alt="Reblog this post [with Zemanta]" /></a></div>
]]></content:encoded>
			<wfw:commentRss>http://nejc.skoberne.net/2008/11/rcpfa-104-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

