<?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>No Znx!</title>
	<atom:link href="http://znx.no/feed/" rel="self" type="application/rss+xml" />
	<link>http://znx.no</link>
	<description>the pigeons!!!!</description>
	<lastBuildDate>Tue, 20 Dec 2011 22:42:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Tmux Running But No Sessions</title>
		<link>http://znx.no/2011/12/tmux-running-but-no-sessions/</link>
		<comments>http://znx.no/2011/12/tmux-running-but-no-sessions/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 22:42:26 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[session]]></category>
		<category><![CDATA[tmux]]></category>

		<guid isPermaLink="false">http://znx.no/?p=368</guid>
		<description><![CDATA[I recently attempted to reattach to a tmux session only to discover that it didn&#8217;t think any sessions were running. Reviewing the running processes proved that there was a session still active. A quick review indicated that that the socket was still present as well. Attempting to run tmux but attach to the socket (the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently attempted to reattach to a <code>tmux</code> session only to discover that it didn&#8217;t think any sessions were running. Reviewing the running processes proved that there was a session still active. A quick review indicated that that the socket was still present as well. Attempting to run tmux but attach to the socket (the -L option) didn&#8217;t work either.</p>
<p>Reviewing the manpage for tmux indicated that SIGUSR1 can be sent to force the sockets to be recreated thus as my users I did the following:</p>
<pre>$ killall -s SIGUSR1 tmux</pre>
<p>Then I was able to reattach to the session. Further reading suggest that I must have updated my tmux whilst it was still running which is officially unsupported, so I was lucky!</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/12/tmux-running-but-no-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Arch / Yum</title>
		<link>http://znx.no/2011/12/arch-yum/</link>
		<comments>http://znx.no/2011/12/arch-yum/#comments</comments>
		<pubDate>Sat, 03 Dec 2011 23:52:29 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[archlinux]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://znx.no/?p=364</guid>
		<description><![CDATA[I recently switched to Archlinux and I have to say I love it a great deal. I really like the simplicity of it, unfortunately due to my long standing usage or yum I have been spoilt. It means that I find myself wishing to have commands like yum install package, so switching pacman&#8217;s -S was [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched to Archlinux and I have to say I love it a great deal. I really like the simplicity of it, unfortunately due to my long standing usage or <code>yum</code> I have been spoilt. It means that I find myself wishing to have commands like <code>yum install package</code>, so switching pacman&#8217;s <code>-S</code> was a little too much. I therefore wrote a wrapper to make it easier for me. Maybe it can help others just starting out in the path to using Archlinux.</p>
<p>In preparation for this, you will need to install <code>yaourt</code> and enable it with sudo access. Either that or replace all the references to <code>yaourt</code> below with <code>pacman</code>.</p>
<p>Drop this into your <i>~/.bashrc</i> (or zshrc):</p>
<pre>function arch() {
        if [ -z "$1" ]; then
                echo "arch <command> <blah...>" >&#038;2
                return -1
        fi

        case $1 in
                upgrade)
                        # Synchronize, upgrade
                        shift
                        sudo yaourt -Syu $@
                        ;;
                install)
                        # Install stuff
                        shift
                        sudo yaourt -S $@
                        ;;
                localinstall)
                        # Install file
                        shift
                        sudo yaourt -U $@
                        ;;
                remove)
                        # Remove
                        shift
                        sudo yaourt -R $@
                        ;;
                fullremove)
                        # Remove file
                        shift
                        sudo yaourt -Rns $@
                        ;;
                info)
                        # Display information
                        shift
                        yaourt -Si $@
                        ;;
                search)
                        # Search
                        shift
                        yaourt -Ss $@
                        ;;
        esac
}</pre>
<p>Now you can do things like:</p>
<pre>$ arch install git
$ arch remove git
$ arch info git
$ arch search git</pre>
<p>Hope its handy!</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/12/arch-yum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Twitter App and Music Issues on Android</title>
		<link>http://znx.no/2011/06/twitter-app-and-music-issues-on-android/</link>
		<comments>http://znx.no/2011/06/twitter-app-and-music-issues-on-android/#comments</comments>
		<pubDate>Sun, 12 Jun 2011 15:40:29 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[SGS]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[sgs]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://znx.no/?p=353</guid>
		<description><![CDATA[If you have been following me you will know that I recently got an android powered phone, specifically a Samsung Galaxy S (or SGS for short). Now I installed the official Twitter for all my tweeting needs and I can say that its a great app. Unfortunately around the same time I started to experience [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been following me you will know that I recently got an android powered phone, specifically a Samsung Galaxy S (or SGS for short). Now I installed the official <a href='http://www.twitter.com/'>Twitter</a> for all my tweeting needs and I can say that its a great app.</p>
<p>Unfortunately around the same time I started to experience a strange issue when playing music. When using either the Amazon MP3 player or the built in Music Player, it would simply not play music. Saying something like &#8220;Sorry, the player does not support this type of audio file&#8221;. The only way to &#8220;fix&#8221; this was to reboot the phone (power down and up). Most annoying especially since the phone has replaced my iPod as my default music device.</p>
<p>Strangely I have discovered that by uninstalling the official Twitter app, all is well again. It no longer cuts out ever. I cannot provide any evidence as to why the twitter application would related to my music players but the music works when it isn&#8217;t installed and breaks when it is.</p>
<p>It&#8217;s a shame as well because the twitter app is a good one. Hopefully an update at some point will correct this flaw or at least explain it!</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/06/twitter-app-and-music-issues-on-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Keys</title>
		<link>http://znx.no/2011/04/ssh-keys/</link>
		<comments>http://znx.no/2011/04/ssh-keys/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 22:05:26 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[SSH]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://znx.no/?p=342</guid>
		<description><![CDATA[I have for the longest time been using public key authentication on almost every shell I use. One of the things that most people do with these keys is set them up without passwords to allow them to open connections to shells without typing passwords. Whilst this increases the ease of use it obviously misses [...]]]></description>
			<content:encoded><![CDATA[<p>I have for the longest time been using public key authentication on almost every shell I use. One of the things that most people do with these keys is set them up without passwords to allow them to open connections to shells without typing passwords. Whilst this increases the ease of use it obviously misses the point. That sort of short-cut is taken without considering how you can use passwords but still have the ease of use.</p>
<p>Lets see how SSH works without any setup:</p>
<pre>$ ssh znx@work.host.com
 znx@work.host.com's password: <b>(password)</b></pre>
<p>Type in your password and you get a shell. Now lets generate some keys and login with those.</p>
<pre>$ cd ~/.ssh
$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/home/mark/.ssh/id_rsa): id_workhost
Enter passphrase (empty for no passphrase): <b>(passphrase)</b>
Enter same passphrase again: <b>(passphrase)</b>
Your identification has been saved in id_workhost.
Your public key has been saved in id_workhost.pub.
The key fingerprint is:
75:9c:c0:a3:52:7e:92:3c:f7:9d:c0:ff:0b:18:8c:48 znx@home.local
The key's randomart image is:
+--[ RSA 2048]----+
|         ..      |
|        . oo .   |
|       E o.o+    |
|      o O.=.o    |
|       oS* + + . |
|            + +  |
|           . . . |
|              . .|
|               ..|
+-----------------+</pre>
<p>So the private key is called <i>id_workhost</i> and the public key is called <i>id_workhost.pub</i>. The private key should be kept safe at all times; the public key however is what we need to put out onto the other machine. If you have ssh-copy-id you can use that instead of the follow. So lets do that now:</p>
<pre>$ scp ~/.ssh/id_workhost.pub znx@work.host.com:
znx@work.host.com's password:  <b>(password)</b>
id_workhost.pub                                100% 1766     1.7KB/s   00:00
$ ssh znx@work.host.com
znx@work.host.com's password:  <b>(password)</b>
work$ cat id_workhost.pub >> ~/.ssh/authorized_keys
work$ rm id_workhost.pub
work$ logout
$ ssh -i ~/.ssh/id_workhost znx@work.host.com
Enter passphrase for key '/home/znx/.ssh/id_workhost': <b>(passphrase)</b>
Last login: Wed Apr  6 08:25:16 2011 from home.local
work$</pre>
<p>So we are now using keys to login rather than passwords but it still requires a passphrase to be type in. The next step is to look at <b>ssh-agent</b>. This tool will hold keys in memory and allow thus allowing you to login without needing to unlock the key. So lets run it and see what it does:</p>
<pre>$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-SdjNGn3604/agent.3604; export SSH_AUTH_SOCK;
SSH_AGENT_PID=3605; export SSH_AGENT_PID;
echo Agent pid 3605;</pre>
<p>Not exactly useful until you spot that it is actually setting up bash variables. So the way we want to run ssh-agent is as follows:</p>
<pre>$ eval `ssh-agent`
Agent pid 3609
$ echo $SSH_AGENT_PID
3609</pre>
<p>That&#8217;s more like it, so once you have a running agent you can now start to add keys into its memory.</p>
<pre>$ ssh-add ~/.ssh/id_workhost
Enter passphrase for /home/mark/.ssh/id_workhost: <b>(passphrase)</b>
Identity added: /home/mark/.ssh/id_workhost (/home/mark/.ssh/id_workhost)</pre>
<p>With the key added we can now login to the host with the unlocked key:</p>
<pre>$ ssh znx@work.host.com
Last login: Wed Apr  6 22:14:49 2011 from home.local
work$</pre>
<p>Now that is a login without a password or a passphrase because the key is unlocked and held by ssh-agent. Whilst <b>ssh-agent</b> is useful if you retain one shell open all the time, the moment you close that shell you lose the variables of the running ssh-agent which means that you will not be able to use it. This also means that if you are running scripts (say via cron) that you can no longer automate the logins. So back to keys without passphrase? NO!</p>
<p>There is a very nice tool that can help us out and it is called <b>keychain</b>. Simply add this to your <i>~/.bash_profile</i>:</p>
<pre>keychain --quiet ~/.ssh/id_workhost
source ~/.keychain/*-sh</pre>
<p>You should also add this to your ~/.bashrc:</p>
<pre>source ~/.keychain/*-sh</pre>
<p>Now login to your shell again and you should see that you are prompted to put in passwords. This is keychain loading your keys in. It looks something like this:</p>
<pre>Identity added: /home/mark/.ssh/id_mine (/home/mark/.ssh/id_mine)</pre>
<p>You will see that you can now login without passphrase to your host again. Indeed all the shells you open will now grab the keychain information and login immediately.</p>
<p>This means that you will only get prompted for passphrases once when you login and then you will have the ability to login to your shells without passphrases. Obviously you should add keys for your regular hosts. You can add keys on the fly with keychain at the command line:</p>
<pre>$ keychain ~/.ssh/id_someotherkey</pre>
<p>And it will be stored until your ssh-agent is closed. If you wish to clear the keys you have added then simply do:</p>
<pre>$ keychain --clear</pre>
<p>What all this means is that you can now run scripts with passphrase protected keys because all you need to do is source the running ssh-agent within your script:</p>
<pre>#!/bin/sh
# Some remote copy script
source ~/.keychain/*-sh

scp znx@work.host.com:nightly-copy.file local/nightly-copy.file</pre>
<p>As long as the key is load the script will work.</p>
<p>Doing this ensures that even if the private key falls into the wrong hands that it is still secured with a passphrase and you haven&#8217;t just opened up your remote hosts to attack.</p>
<p>There is solutions for this under Windows as well; the PuTTY installer will provide you with a tool called Pageant. This works in an identical way to ssh-agent; loading keys into its memory to allow PuTTY to login with unlocked keys.</p>
<p>Check out some of the other SSH tips I&#8217;ve published which will ease the logins even further!</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/04/ssh-keys/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android Wi-Fi Error</title>
		<link>http://znx.no/2011/03/android-wi-fi-error/</link>
		<comments>http://znx.no/2011/03/android-wi-fi-error/#comments</comments>
		<pubDate>Sat, 26 Mar 2011 22:06:44 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[SGS]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[config]]></category>
		<category><![CDATA[sgs]]></category>

		<guid isPermaLink="false">http://znx.no/?p=338</guid>
		<description><![CDATA[There seems to be a known issue which affects my Samsung Galaxy S and other Android based phones. Sometimes you will discover that the wireless is disconnected and it hasn&#8217;t reconnected automatically. Then when you go to the wireless settings (via Applications > Settings > Wireless and network > Wif-Fi settings) you will see the [...]]]></description>
			<content:encoded><![CDATA[<p>There seems to be a known issue which affects my Samsung Galaxy S and other Android based phones. Sometimes you will discover that the wireless is disconnected and it hasn&#8217;t reconnected automatically. Then when you go to the wireless settings (via Applications > Settings > Wireless and network > Wif-Fi settings) you will see the words &#8220;Error&#8221; under the Wi-Fi. Tapping to re-enable the wireless will instantly reconnect.</p>
<p>After a brief amount of time searching I found a rather good explanation via <a href='http://kb.mit.edu/confluence/pages/viewpage.action?pageId=7144856'>MIT</a>. It turns out that if you are running a mixed wireless network at home (i.e. providing B, G and N types at the same time) you could find your phone sometimes disconnects in this way.</p>
<p>Foruntately the page also points out a possible solution; <a href='http://wififixer.wordpress.com/'>Wi-Fi Fixer</a> which is also available via <a href='https://market.android.com/details?id=org.wahtod.wififixer'>Marketplace</a> and I do recommend donations!</p>
<p>This has left a little tool running in the background that detects the loss of wireless and sorts it out.</p>
<p>My wireless is now reconnecting automatically; Perfect!</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/03/android-wi-fi-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kies Air Hidden?</title>
		<link>http://znx.no/2011/03/kies-air-hidden/</link>
		<comments>http://znx.no/2011/03/kies-air-hidden/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 21:52:14 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[SGS]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[kies]]></category>
		<category><![CDATA[sgs]]></category>

		<guid isPermaLink="false">http://znx.no/?p=331</guid>
		<description><![CDATA[I note that the recent update to Samsung Apps has moved the list into a more Marketplace style. Unfortunately they have somewhat hidden the tool and it isn&#8217;t obvious to find it (nor the updates!). So the process is as follows: Applications > Samsung Apps > Category > Utilities > Kies Air To find your [...]]]></description>
			<content:encoded><![CDATA[<p>I note that the recent update to Samsung Apps has moved the list into a more Marketplace style. Unfortunately they have somewhat hidden the tool and it isn&#8217;t obvious to find it (nor the updates!).</p>
<p>So the process is as follows:</p>
<pre>Applications > Samsung Apps > Category > Utilities > Kies Air</pre>
<p>To find your updates:</p>
<pre>Applications > Samsung Apps > Menu Button (bottom left) > Downloads</pre>
<p>Select and pick your updates.</p>
<p>Only thing that I&#8217;d like to see with Kies Air is general file management (i.e. to upload any file not just categories like Music/Images etc).</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/03/kies-air-hidden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick Reads</title>
		<link>http://znx.no/2011/03/quick-reads/</link>
		<comments>http://znx.no/2011/03/quick-reads/#comments</comments>
		<pubDate>Wed, 02 Mar 2011 17:14:32 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[amazing]]></category>
		<category><![CDATA[book]]></category>

		<guid isPermaLink="false">http://znx.no/?p=328</guid>
		<description><![CDATA[I am constantly reading some book or other and since I got a Kindle for an Christmas present (thanks Dad!); it&#8217;s got even easier to find new books and read them. I am however aware that not everyone reads and that some see a book as a hurdle rather than a joy. If you find [...]]]></description>
			<content:encoded><![CDATA[<p>I am constantly reading some book or other and since I got a Kindle for an Christmas present (thanks Dad!); it&#8217;s got even easier to find new books and read them. I am however aware that not everyone reads and that some see a book as a hurdle rather than a joy.</p>
<p>If you find yourself in that state then I can suggest <a href='http://www.quickreads.org.uk/'>Quick Reads</a>; a superb organisation that has got some amazing authors to write some sharp and quick reads to entice people into reading again.</p>
<p>I just got a bundle and will be reading my way through them!</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/03/quick-reads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kies Air</title>
		<link>http://znx.no/2011/02/kies-air/</link>
		<comments>http://znx.no/2011/02/kies-air/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 19:39:03 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[SGS]]></category>
		<category><![CDATA[app]]></category>
		<category><![CDATA[kies]]></category>
		<category><![CDATA[sgs]]></category>

		<guid isPermaLink="false">http://znx.no/?p=322</guid>
		<description><![CDATA[I got myself a new phone recently and I can&#8217;t say anything bad about it at all; it&#8217;s a Samsung Galaxy S. There are some awesome apps available for it; indeed I&#8217;m using a WordPress app to write this. But one app in particular has become a requirement for me. The software that you can sync you [...]]]></description>
			<content:encoded><![CDATA[<p>I got myself a new phone recently and I can&#8217;t say anything bad about it at all; it&#8217;s a Samsung Galaxy S.</p>
<p>There are some awesome apps available for it; indeed I&#8217;m using a WordPress app to write this. But one app in particular has become a requirement for me.</p>
<p>The software that you can sync you phone is called Kies and it isn&#8217;t just bad; it&#8217;s awful. I found that it failed to work over USB initially until I managed to Google an answer. Next I attempted to set it up over Bluetooth; the phone happily paired and I was able to transfer manually but Kies similar gives a cryptic error (it says that the device denied the connection) at which point it then deletes the pairing.</p>
<p>There is salvation and it comes in the form of Kies Air. This app allows you to directly access you device via wirelesswith nothing more than a browser (and Java). The interface looks very much like Kies but actually works! The only thing you can&#8217;t do is upgrade the phone firmware but lets be honest that is infrequent anyway.</p>
<p>To get this software you must first allow non-marketplace apps to be installed:</p>
<pre>Menu &gt; Settings &gt; Applications &gt; Unknown Sources</pre>
<p>Then open up the application called Samsung Apps:</p>
<pre>Applications &gt; Samsung Apps</pre>
<p>There isn&#8217;t a search so you will need to scroll through and look for &#8220;Kies Air&#8221;. Once it installs to use it is simple enough.</p>
<pre>Applications &gt; Kies Air &gt; Start</pre>
<p>It will tell you a website to go to on your browser. Put that into your browser; you phone will ask if you wish to allow someone access so accept it. Then you will get the java application that looks and functions like Kies. Super!</p>
<p>As a side; I selected the Samsung Galaxy S over the Google Nexus S based on the fact that I can use the expansion slot. Lets hope that the SGS gets an Android update to 2.3 soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/02/kies-air/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Conntrack Memory Usage</title>
		<link>http://znx.no/2011/02/conntrack-memory-usage/</link>
		<comments>http://znx.no/2011/02/conntrack-memory-usage/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 21:02:17 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://znx.no/?p=315</guid>
		<description><![CDATA[Every so often you see messages in your logs regarding ip_conntrack like the following: ip_conntrack: table full, dropping packet So my first thought it that it might relate to memory usage. Fortunately enough the kernel provides all the information we need to work it out. The kernel will allocate a &#8220;slab&#8221; when ever conntrack requires [...]]]></description>
			<content:encoded><![CDATA[<p>Every so often you see messages in your logs regarding <code>ip_conntrack</code> like the following:</p>
<pre>ip_conntrack: table full, dropping packet</pre>
<p>So my first thought it that it might relate to memory usage. Fortunately enough the kernel provides all the information we need to work it out. The kernel will allocate a &#8220;slab&#8221; when ever conntrack requires more memory, equally it will retain these slabs for a period of time and reuse if required. Each &#8220;slab&#8221; represents a number of pages of kernel memory, we can retrieve the current page size by using the following command:</p>
<pre># getconf PAGESIZE
4096</pre>
<p>So each page is 4096 bytes. Next lets see how many slabs conntrack is using:</p>
<pre># grep conntrack /proc/slabinfo
ip_conntrack        6537  16620    384  984 1662    1 :  496  124</pre>
<p>So that represents the following:</p>
<ul>
<li><b>ip_conntrack</b>; a human readable name</li>
<li><b>6537</b>; total number of objects in use.</li>
<li><b>16620</b>; total available objects (including unused)
<li><b>384</b>; size of each object.</li>
<li><b>984</b>; the number of slabs that are active</li>
<li><b>1662</b>; the total number of slabs</li>
<li><b>1</b>; the number of pages required to make a slab (normally 1)</li>
</ul>
<p>The two other columns after the colon relate to SMP CPU information; we don&#8217;t need to discuss them.</p>
<p>So 6537 objects each of size 384 bytes, which means that we can fix around 10 per slab (4096/384=10.66). That means that the objects represent 2510208 bytes (~2.4Mb), but because of the overhead we are actually using 654 (6537/10=653.7) slabs or 2.6Mb (654*4096=2678784). So we are wasting around 256 bytes per slab (4096-384*10).</p>
<p>In other words an extremely small amount of memory. So it is very unlikely that is the cause. Further investigation reveal that it is normally due to the conntrack hitting the maximum count which can be viewed by looking at:</p>
<pre># cat /proc/sys/net/ipv4/ip_conntrack_max
65536</pre>
<p>Comparing this to the current count:</p>
<pre>#  wc -l ./proc/sys/net/ip_conntrack
   5602 /proc/net/ip_conntrack</pre>
<p>We now know that it doesn&#8217;t use any great deal of memory at all, so we can easily double the count by doing the following:</p>
<pre># echo 131072 >/proc/sys/net/ipv4/ip_conntrack_max</pre>
<p>Obviously in this example the memory usage was minor and there was little need to double the count but you can review your own system and increase as you wish now we know that it has a very small memory footprint.</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/02/conntrack-memory-usage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RAM and dmidecode</title>
		<link>http://znx.no/2011/01/ram-and-dmidecode/</link>
		<comments>http://znx.no/2011/01/ram-and-dmidecode/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 21:14:54 +0000</pubDate>
		<dc:creator>znx</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[amazing]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://znx.no/?p=310</guid>
		<description><![CDATA[There is a very useful command on Linux systems called dmidecode. This is a command that speaks to a computer&#8217;s DMI; sometimes called SMBIOS (System Management BIOS). Basically this is an area of your computer that stores various pieces of information about your hardware. You can just type dmidecode and put the output through a [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very useful command on Linux systems called <code>dmidecode</code>. This is a command that speaks to a computer&#8217;s DMI; sometimes called SMBIOS (System Management BIOS). Basically this is an area of your computer that stores various pieces of information about your hardware.</p>
<p>You can just type <code>dmidecode</code> and put the output through a pager but if you look at the man page you can see the DMI type and specifically pick it.</p>
<p>So let&#8217;s see an example usage by finding out what sort of RAM my system has by looking at type DMI types:</p>
<ol start=16>
<li>Physical Memory Array</li>
<li>Memory Device</li>
</ol>
<pre>[root@marine ~]# dmidecode -t 16
# dmidecode 2.10
SMBIOS 2.3 present.

Handle 0x0021, DMI type 16, 15 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: None
        Maximum Capacity: 1 GB
        Error Information Handle: Not Provided
        Number Of Devices: 2

Handle 0x0022, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0021
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 512 MB
        Form Factor: DIMM
        Set: None
        Locator: A0
        Bank Locator: Bank0/1
        Type: Unknown
        Type Detail: None
        Speed: Unknown
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None

Handle 0x0023, DMI type 17, 27 bytes
Memory Device
        Array Handle: 0x0021
        Error Information Handle: Not Provided
        Total Width: 64 bits
        Data Width: 64 bits
        Size: 512 MB
        Form Factor: DIMM
        Set: None
        Locator: A1
        Bank Locator: Bank2/3
        Type: Unknown
        Type Detail: None
        Speed: Unknown
        Manufacturer: None
        Serial Number: None
        Asset Tag: None
        Part Number: None</pre>
<p>So you can see that I have a system with 2 banks and it is capable of a maximum of 1Gb (YES it is old). Each bank is carrying 512Mb of RAM. Unfortunately the output doesn&#8217;t indicate the type of RAM but maybe we can work it out by looking at another DMI type.</p>
<pre># dmidecode -t 2
# dmidecode 2.10
SMBIOS 2.3 present.

Handle 0x0002, DMI type 2, 8 bytes
Base Board Information
        Manufacturer:
        Product Name: RS/RX482SB400
        Version:
        Serial Number:</pre>
<p>A quick google reveals that the motherboard supports &#8220;Dual DDR SDRAM&#8221;. You can see that the information obtain wasn&#8217;t that useful against my personal PC. You will obviously find that the results vary depending on the vendor providing the information (and in some cases valid information).</p>
<p>Nevertheless it is useful, for people who are running Windows this information is accessible to you as well with a great tool called <a href='http://www.cpuid.com/softwares/cpu-z.html'>CPU-Z</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://znx.no/2011/01/ram-and-dmidecode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

