<?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>Notes &#187; Blog</title>
	<atom:link href="http://notes.endnode.se/category/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.endnode.se</link>
	<description></description>
	<lastBuildDate>Thu, 02 Sep 2010 07:39:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Explaining Creative Commons</title>
		<link>http://notes.endnode.se/2010/09/explaining-creative-commons/</link>
		<comments>http://notes.endnode.se/2010/09/explaining-creative-commons/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 07:39:38 +0000</pubDate>
		<dc:creator>Peter Hultqvist</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[cc]]></category>
		<category><![CDATA[creative-commons]]></category>

		<guid isPermaLink="false">http://notes.endnode.se/?p=287</guid>
		<description><![CDATA[Jonas Öberg asked How do you explain Creative Commons? Here is my shot at it: This is a new world This is a different world Where listening and watching is copying Copies that are modified and copied again by others And no one may stop anyone from doing it]]></description>
			<content:encoded><![CDATA[<p>Jonas Öberg asked <a href="http://jonasoberg.net/2010/08/25/how-do-you-explain-creative-commons">How do you explain Creative Commons?</a></p>
<p>Here is my shot at it:</p>
<ul>
<li>This is a new world</li>
<li>This is a different world</li>
<li>Where listening and watching is copying</li>
<li>Copies that are modified and copied again by others</li>
<li>And no one may stop anyone from doing it</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://notes.endnode.se/2010/09/explaining-creative-commons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VPS monitoring update</title>
		<link>http://notes.endnode.se/2010/08/vps-monitoring-update/</link>
		<comments>http://notes.endnode.se/2010/08/vps-monitoring-update/#comments</comments>
		<pubDate>Tue, 24 Aug 2010 20:08:47 +0000</pubDate>
		<dc:creator>Peter Hultqvist</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[vps]]></category>

		<guid isPermaLink="false">http://notes.endnode.se/?p=269</guid>
		<description><![CDATA[A year ago a presented a tool to monitor system resource usage on OpenVZ VPS. Since then I have moved from OpenVZ to XEN hosted services and I have added a few more measurements. The OpenVZ parts still work but will not collect any information unless you run it under an OpenVZ system. New since [...]]]></description>
			<content:encoded><![CDATA[<p>A year ago a presented a tool to monitor system resource usage on OpenVZ VPS. Since then I have moved from OpenVZ to XEN hosted services and I have added a few more measurements.<span id="more-269"></span></p>
<p>The OpenVZ parts still work but will not collect any information unless you run it under an OpenVZ system.</p>
<p>New since last post is another network traffic visualization, remote server ping monitoring, per user cpu and memory usage monitoring. Most important feature though is the automatic detection of users and network interfaces, you no longer need to configure which network card and users to monitor, now they all are recorded.</p>
<h2>Network visualization</h2>
<p>I am running a TOR node which generates a lot of traffic that usually hides all other traffic. My solution here is a diff plot that visualizes the difference in input and output traffic.</p>
<p><a href="/wp-content/uploads/2010/08/net-eth0-1.png"><img class="aligncenter size-full wp-image-271" title="net-eth0 (1)" src="/wp-content/uploads/2010/08/net-eth0-1.png" alt="" width="481" height="221" /></a></p>
<p>As can be seen around the 19th and 20th the yellow spikes show output traffic when the symmetric traffic is subtracted. The total assymetric output was 3.78 GB.</p>
<p>Another issue that I cannot truly say I have solved is the spikes of transfer that sometimes occur when I transfer large amounts of data between servers. Since the upper bounds in the graph is determined automatically from the data, a short time hig bandwidth transfer will scale the graph so that the normal level traffic is barely noticeable.</p>
<p><a href="/wp-content/uploads/2010/08/net-eth0.png"><img class="aligncenter size-full wp-image-270" title="net-eth0" src="/wp-content/uploads/2010/08/net-eth0.png" alt="" width="481" height="221" /></a></p>
<p>My attempt to solve this is by using a logarithmic scale. As this kind of scale does not work with negative numbers I designed another graph with the sum yellow and below the diff overlay. The diff is represented by color where magenta represents the extra output traffic compared to the input, and cyan the other way around.</p>
<p><a href="/wp-content/uploads/2010/08/net-eth0-log.png"><img class="aligncenter size-full wp-image-272" title="net-eth0-log" src="/wp-content/uploads/2010/08/net-eth0-log.png" alt="" width="481" height="221" /></a></p>
<p>I don&#8217;t like this representation very much for two reasons. One the log scale fail to give a relevant visual representation of this kind of data, the output overlap looks like it is half the traffic of the total traffic, but since we know it is logarithmic we also know that it&#8217;s not the fact. Two, it is very hard to notice any irregularities such as spikes in the data transfer.</p>
<h2>Remote server ping</h2>
<p>The latest contibution is the remote ping monitoring. It is a simple ping rtt(round trip time) monitoring that came from the need to know for how long a server has been unreachable. It is also good to monitor local internet connection quality.</p>
<p>With the current configuration, each measurement is done using three ping requests and the average rtt is recorded.</p>
<p><a href="/wp-content/uploads/2010/08/ping-t.png"><img class="aligncenter size-full wp-image-276" title="ping-t" src="/wp-content/uploads/2010/08/ping-t.png" alt="" width="481" height="179" /></a></p>
<p>This feature must be configured in the config.py file, you can use the template file config-dist.py.</p>
<p><a href="/wp-content/uploads/2010/08/ping-e.png"><img class="aligncenter size-full wp-image-275" title="ping-e" src="/wp-content/uploads/2010/08/ping-e.png" alt="" width="481" height="174" /></a></p>
<h2>User CPU/memory usage</h2>
<p>As with the network monitoring the per user memory usage is now also automatic, there is no need to configure which users to monitor &#8211; all is monitored.</p>
<p><a href="/wp-content/uploads/2010/08/user-dovecot-memory.png"><img class="aligncenter size-full wp-image-278" title="user-dovecot-memory" src="/wp-content/uploads/2010/08/user-dovecot-memory.png" alt="" width="481" height="165" /></a></p>
<p>As an addition we now also monitor the CPU usage per user. If you run on a multicore server 100 equals full utilization of one core.</p>
<p><a href="/wp-content/uploads/2010/08/user-dovecot-cpu.png"><img class="aligncenter size-full wp-image-277" title="user-dovecot-cpu" src="/wp-content/uploads/2010/08/user-dovecot-cpu.png" alt="" width="481" height="165" /></a></p>
<h2>How to get it</h2>
<p>Download it from the git repo:</p>
<pre>git clone http://src.endnode.se/git/csm</pre>
]]></content:encoded>
			<wfw:commentRss>http://notes.endnode.se/2010/08/vps-monitoring-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxy for personal web filtering</title>
		<link>http://notes.endnode.se/2010/06/proxy-for-personal-web-filtering/</link>
		<comments>http://notes.endnode.se/2010/06/proxy-for-personal-web-filtering/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 13:49:25 +0000</pubDate>
		<dc:creator>Peter Hultqvist</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[filtering]]></category>
		<category><![CDATA[monodevelop]]></category>
		<category><![CDATA[personal-proxy]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[proxy]]></category>

		<guid isPermaLink="false">http://notes.endnode.se/?p=259</guid>
		<description><![CDATA[Moving from Firefox to Chromium I found it difficult to transfer all filtering and adblocking tweaks that was done in firefox using extensions. Some of them wasn&#8217;t even possible like prevent content from being downloaded. I have also had other ideas of how web filtering can be done which so far could not be found [...]]]></description>
			<content:encoded><![CDATA[<p>Moving from <a href="http://firefox.com">Firefox</a> to <a href="http://www.chromium.org/Home">Chromium</a> I found it difficult to transfer all filtering and adblocking tweaks that was done in firefox using extensions. Some of them wasn&#8217;t even possible like <a href="http://code.google.com/p/chromium/issues/detail?id=6975">prevent content from being downloaded</a>. I have also had other ideas of how web filtering can be done which so far could not be found in any current implementation.</p>
<p><span id="more-259"></span></p>
<h2>The Proxy Solution</h2>
<p>The answer to these need is writing a new http proxy intended for personal use. The main goal of the proxy is a modular filtering design. These filters can be applied on both requests and responses. They can modify the requests before being sent and also totally block them.</p>
<p>Using a proxy makes it easier in the future for me to change browser and keep my filtering with minor setup. Even running multiple browsers at the same time using the same live settings would be possible.</p>
<p>By writing this program myself I will make it easier for me to later add one hour hacks that I want to try out.</p>
<h2>Program design</h2>
<p>I want the program to be easy to use for average users, probably a single executable where all configuration is done in the web interface.</p>
<p>To achieve this simplicity the bar for making additions to the program is raised. Filters are described as modules but they are build into the binary. New modules means a new binary, that will work by simply replacing the binary executable. For other developers this mean that when you write a new module it must be included into the source tree.<br />
This stand of &#8220;module&#8221; design  is untested and I will gladly accept any ideas on this. Practically there could be a more external modules design using dll or similar.</p>
<h2>Personal Proxy</h2>
<p>The project is named &#8220;Personal Proxy&#8221; and is available at BitBucket<a href="http://bitbucket.org/">.org</a> under <a href="http://bitbucket.org/phq/personal-proxy">phq/personal-proxy</a>.</p>
<p>The program i written in C# and developed in <a href="http://monodevelop.com/">Monodevelop</a> but it works in VisualStudio as welll.</p>
<p>Source code can be downloaded using the download links on the project page. However if your want to conrtibute I suggest you use <a href="http://mercurial.selenic.com/">mercurial</a> and get the source code from the bitbucket repo.</p>
<pre>hg clone <a href="https://bitbucket.org/phq/personal-proxy">https://bitbucket.org/phq/personal-proxy</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://notes.endnode.se/2010/06/proxy-for-personal-web-filtering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inverse Privacy Pad</title>
		<link>http://notes.endnode.se/2010/02/inverse-privacy-pad/</link>
		<comments>http://notes.endnode.se/2010/02/inverse-privacy-pad/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 10:31:43 +0000</pubDate>
		<dc:creator>Peter Hultqvist</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[headers]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[privacy]]></category>

		<guid isPermaLink="false">http://notes.endnode.se/?p=224</guid>
		<description><![CDATA[From EFF:s latest initiative about browsers carrying identifying bits you can now test how many identifying bits your own browser has at Panopticlick. From this I got the idea for this online notepad. If you already know the basics in http you can skip to the privacy pad part. What your browser reveal about itself [...]]]></description>
			<content:encoded><![CDATA[<p>From EFF:s latest initiative about <a href="https://www.eff.org/deeplinks/2009/09/new-cookie-technologies-harder-see-and-remove-wide">browsers carrying identifying bits</a> you can now test how many identifying bits your own browser has at <a href="https://panopticlick.eff.org/">Panopticlick</a>. From this I got the idea for this online notepad.<span id="more-224"></span></p>
<p>If you already know the basics in http you can <a href="#ipp">skip to the privacy pad part</a>.</p>
<h2>What your browser reveal about itself</h2>
<p>For every page you visit, your browser must first download the page. This is done by sending a request to the server that usually looks like this:</p>
<p><code>GET / HTTP/1.1<br />
Host: notes.endnode.se<br />
User-Agent: <strong>Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.2pre) Gecko/20100130 Ubuntu/9.10 (karmic) Namoroka/3.6.2pre</strong><br />
Accept: <strong>text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8</strong><br />
Accept-Language: <strong>en-us,en;q=0.7,sv;q=0.3</strong><br />
Accept-Encoding: <strong>gzip,deflate</strong><br />
Accept-Charset: <strong>UTF-8,*</strong><br />
Keep-Alive: 115<br />
Connection: keep-alive<br />
</code></p>
<p>This is sent with every request for each html page, css-stylesheet and image that is requested. Especially the User-Agent line is mostly addressed since it is not only complex in contents but also that this varies a lot between different computers.</p>
<p>These headers can be combined into a fingerprint that the browser will reveal with every request.</p>
<h2><a name="ipp"></a>Inverse Privacy Pad</h2>
<p>The <a href="http://privacy.endnode.se/pad.php">inverse privacy pad</a> is an online notepad where you can write some notes and save them for later. Each visitor is presented a notepad based on their browsers fingerprint. This way every visitor will see a different text in their where their browser configuration differs.</p>
<p style="text-align: center;"><img class="aligncenter size-medium wp-image-227" title="privacy-pad" src="http://notes.endnode.se/wp-content/uploads/2010/02/privacy-pad-300x183.png" alt="Web browsers recieveing different notepads depending on their user-agent" width="300" height="183" /></p>
<p style="text-align: left;">Notes saved can only be accessed by others using the exact same configuration(or faking the same headers). Therefore the more unique your browser is, the easier you will be to track but you can be sure that there is a less chance for others to read you notes on this page.</p>
<p style="text-align: left;">Try it out yourself at the <a href="http://privacy.endnode.se/pad.php">inverse privacy pad</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.endnode.se/2010/02/inverse-privacy-pad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Event based programming</title>
		<link>http://notes.endnode.se/2010/01/event-based-programming/</link>
		<comments>http://notes.endnode.se/2010/01/event-based-programming/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 21:04:27 +0000</pubDate>
		<dc:creator>Peter Hultqvist</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[event-programming]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[proof-of-concept]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[thread]]></category>

		<guid isPermaLink="false">http://notes.endnode.se/?p=167</guid>
		<description><![CDATA[Let&#8217;s write a simple tcp server/terminal. Usually my way of thinking must be adapted to the programming language being used. This is my small attempt to modify how the language works to my thinking. I call it event based problem solving. First of all, this is not a typical example of writing a tcp server [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s write a simple tcp server/terminal. Usually my way of thinking must be adapted to the programming language being used. This is my small attempt to modify how the language works to my thinking. I call it event based problem solving.</p>
<p><span id="more-167"></span><em>First of all, this is not a typical example of writing a tcp server in python. As a beginner you might still be able to get some knowledge, but to be able to understand the whole example you must understand threads and python decorators.</em></p>
<p>I want a program that listens on a tcp port. When a remote connection is established it will be connected to the terminal so that when I type on the terminal it is sent to the remote machine and when the remote machine send text it is printed on the terminal. Think of it as a reversed telnet client.</p>
<h2>My intuitive solution</h2>
<p>To make this work I need one function that listens for new connections, waitConnect(). When I get this new connection I initiate two new functions. First socket_reader() which read all incoming data and print it to the screen, stdout.write() and then terminal_reader() which will read what I type and send it to the connection, con.send(). Here is what it looks like:</p>
<div id="attachment_208" class="wp-caption aligncenter" style="width: 291px"><a href="https://notes.endnode.se/wp-content/uploads/2010/01/tcp.png"><img class="size-full wp-image-208" title="tcp" src="https://notes.endnode.se/wp-content/uploads/2010/01/tcp.png" alt="" width="281" height="180" /></a><p class="wp-caption-text">Simple TCP server</p></div>
<h3>The code</h3>
<p>A simplified version, without error checking, looks like this:</p>
<pre>def terminal_reader(con):
	while True:
		line = sys.stdin.readline()
		con.send(line.encode('utf-8'))
def socket_reader(con):
	while True:
		data = con.recv(1)
		sys.stdout.write(data.decode('utf-8'))
def waitConnect(s):
	while True:
		connection, address = s.accept() #
		sr = socket_reader(connection)
		tr = terminal_reader(connection)

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind(("127.0.0.1", 8082))
s.listen(5)
waitConnect(s)</pre>
<h2>Simple right?</h2>
<p>Everyone who is somewhat familiar with programming have already noticed that there is something missing. Ordinary functions would not work alone.</p>
<p>Many of the internal function calls within our functions are blocking, such as accept(), readline() and recv(). Without threads it is impossible to use blocking functions and still have the program responsive to both tcp input and terminal input at the same time.</p>
<h2>Event magic</h2>
<p>To make this possible we will do some slight modification to our program. We add the decorator <strong>@ed.function</strong> to all our three functions and in the end of our code we add ed.join(). Finally we must also add an import ed in the beginning of the code.</p>
<p>The ed is a library I wrote in python to accomplish something similar to the example above. It initiates a queue and a number of worker threads. The @ed.function decoration modifies the functions so that instead of being called immediately they will be queued. The worker threads will then run each function call. Finally the ed.join() will wait until the queue is empty and then exit.</p>
<p>What we have now is events in the form of function calls.</p>
<p>This is a proof-of-concept with only the basic functions as presented here. The code can be downloaded using <strong>&#8220;git clone <a href="http://src.endnode.se/git/event-demo">http://src.endnode.se/git/event-demo</a>&#8220;</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.endnode.se/2010/01/event-based-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.407 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-05 13:53:49 -->
