<?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>Blog.Project13.pl &#187; terminal</title>
	<atom:link href="http://www.blog.project13.pl/index.php/tag/terminal/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.project13.pl</link>
	<description>The Blog of a Coder</description>
	<lastBuildDate>Sun, 05 Feb 2012 02:28:52 +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>G73 keyboard backlight scripts</title>
		<link>http://www.blog.project13.pl/index.php/fun/1163/g73-keayboard-backlight-scripts/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/1163/g73-keayboard-backlight-scripts/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 19:09:42 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[gaming]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[fsf]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[notebook]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1163</guid>
		<description><![CDATA[I&#8217;ve upgraded my desktop and laptop last week. By &#8220;and&#8221; I mean that I&#8217;ve bought an desktop replacement class notebook &#8211; an Asus G73 series. Amongst many nice parts it has I&#8217;m very happy about the harddrives &#8211; Seagate Momentus XT, click the link to see an very interesting benchmark of it. Anyways, that&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve upgraded my desktop and laptop last week. By &#8220;and&#8221; I mean that I&#8217;ve bought an desktop replacement class notebook &#8211; an <strong>Asus G73 </strong>series. Amongst many nice parts it has I&#8217;m very happy about the harddrives &#8211; <a href="http://www.tomshardware.com/reviews/seagate-momentus-xt-hybrid-hard-drive-ssd,2638.html" onclick="urchinTracker('/outgoing/www.tomshardware.com/reviews/seagate-momentus-xt-hybrid-hard-drive-ssd_2638.html?referer=');">Seagate Momentus XT</a>, click the link to see an very interesting benchmark of it. Anyways, that&#8217;s not what this post should be about.</p>
<p>The G73 has an backlit keyboard, which may come in handy while late night coding without lights on as I like to code sometimes. (I&#8217;m using a X6 Sidewinder, even with this Notebook so it&#8217;s not like it&#8217;s keyboard matters to me most of the time ;-)) As usual with such &#8220;super cool addons&#8221; the funtion keys regulating the keyboard backlight seemed to only work on Windows &#8211; which I&#8217;m only using for gaming (but rarely) and testing if the software I happened to write runs ok on it. Anyways, turns out that the keyboard does really well integrate with linux, and you just need a few simple commands to use it, I&#8217;ve made them available on github :-)</p>
<p><a href="https://github.com/ktoso/g73-keyboard-backlight-sh/" onclick="urchinTracker('/outgoing/github.com/ktoso/g73-keyboard-backlight-sh/?referer=');">https://github.com/ktoso/<strong>g73-keyboard-backlight-sh</strong></a> &lt;- Go here to check it out :-)</p>
<div class="geshi no markdown">
<div class="head">Asus G73 Keyboard Backlight GNU/Linux Scripts</div>
<ol>
<li class="li1">
<div class="de1">=============================================
</div>
</li>
<li class="li1">
<div class="de1">To enable the `Fn + F3` and `Fn + F4` shortcuts to work under linux and really
</div>
</li>
<li class="li1">
<div class="de1">manipulate the backlight brighntess on your *Asus G73* series notebook, follow theese simple steps:
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">1. Clone this repository to your home directory (or wherever you want to, I&#39;ll do this example for ~/ for simplicity)
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;cd
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;git clone git://github.com/ktoso/g73-keyboard-backlight-sh.git g73
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;
</div>
</li>
<li class="li1">
<div class="de1">2. Make sure all scripts are marked executable:
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;cd g73
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;chmod +x *.sh
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">3. Take a look at these scripts to make sure you trust them, why? Because they&#39;ll need root access,
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;without asking for the password. Now we&#39;ll add these scripts to allow `sudo`to run them without
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;asking for any password:
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;su -c &#39;visudo&#39; # or &#39;sudo visudo&#39; if you&#39;re a sudoer (on ubuntu etc)
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;There just add the following lines at the end of this file (or similar, with the script names etc).
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;Of course, replace `ktoso` and `/home/ktoso/` with your *username* and *your home directory*.
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;## allow running keyboard backlight scripts
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;ktoso ALL=(ALL) NOPASSWD:/home/ktoso/g73/*
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">4. Now all that&#39;s left is to setup the key bindings for the scripts. If you&#39;re on KDE4, just go to
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;*System Settings -&amp;gt; Shortcuts and Gestures -&amp;gt; Custom Shortcuts* and *edit -&amp;gt; import&#8230;* the file **~/g73/g73_keyboard.khotkeys**
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; which contains ready keybindings for these scripts.
</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; Now you may use `Fn + F3` to make the keyboard backlight shine **less**, and the `Fn + F4` combination to make it shine **more**.</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/1163/g73-keayboard-backlight-scripts/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>[Terminal Heroes] sed mastery &#8211; group catching</title>
		<link>http://www.blog.project13.pl/index.php/terminal-heroes/884/terminal-heroes-sed-mastery-group-catching/</link>
		<comments>http://www.blog.project13.pl/index.php/terminal-heroes/884/terminal-heroes-sed-mastery-group-catching/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 19:24:36 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=884</guid>
		<description><![CDATA[Just a quick sed (the stream editor) example, as someone from work needed it a few minutes ago and I was more happy to supply an quick solution: # replace the href part &#91;ktoso@homunculus ~&#93;$ cat sedmastery &#160; &#160;&#60;a href=&#34;#&#34; id=&#34;hibernate&#34;&#62;Hibernate&#60;/a&#62; &#160; &#160;&#60;a href=&#34;#&#34; id=&#34;html&#34;&#62;HTML&#60;/a&#62; &#160; &#160;&#60;a href=&#34;#&#34; id=&#34;js&#34;&#62;JavaScript&#60;/a&#62; &#91;ktoso@homunculus ~&#93;$ sed &#39;s&#124;\([^#]*\)#\([^&#62;]*\)&#62;\([^&#60; ]*\)&#124;\1/\3\2&#62;\3&#124;g&#39; sedmastery [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick <strong>sed</strong> (the stream editor) example, as someone from work needed it a few minutes ago and I was more happy to supply an quick solution:</p>
<div class="geshi no bash">
<div class="head"># replace the href part</div>
<ol>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ktoso<span class="sy0">@</span>homunculus ~<span class="br0">&#93;</span>$ <span class="kw2">cat</span> sedmastery</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;#&quot;</span> <span class="re2">id=</span><span class="st0">&quot;hibernate&quot;</span><span class="sy0">&gt;</span>Hibernate<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;#&quot;</span> <span class="re2">id=</span><span class="st0">&quot;html&quot;</span><span class="sy0">&gt;</span>HTML<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;#&quot;</span> <span class="re2">id=</span><span class="st0">&quot;js&quot;</span><span class="sy0">&gt;</span>JavaScript<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ktoso<span class="sy0">@</span>homunculus ~<span class="br0">&#93;</span>$ <span class="kw2">sed</span> <span class="st0">&#39;s|<span class="es0">\(</span>[^#]*<span class="es0">\)</span>#<span class="es0">\(</span>[^&gt;]*<span class="es0">\)</span>&gt;<span class="es0">\(</span>[^&lt; ]*<span class="es0">\)</span>|<span class="es0">\1</span>/<span class="es0">\3</span><span class="es0">\2</span>&gt;<span class="es0">\3</span>|g&#39;</span> sedmastery</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;/Hibernate&quot;</span> <span class="re2">id=</span><span class="st0">&quot;hibernate&quot;</span><span class="sy0">&gt;</span>Hibernate<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;/HTML&quot;</span> <span class="re2">id=</span><span class="st0">&quot;html&quot;</span><span class="sy0">&gt;</span>HTML<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;/JavaScript&quot;</span> <span class="re2">id=</span><span class="st0">&quot;js&quot;</span><span class="sy0">&gt;</span>JavaScript<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
</ol>
</div>
<p>Yup, that&#8217;s basically it. You may also apply this <strong>directly in vim</strong> <a href="http://www.youtube.com/watch?v=MzxEt9sK5eM" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=MzxEt9sK5eM&amp;referer=');">as I&#8217;ve showed here a few years ago</a> and you&#8217;ll probably need to <a href="http://www.ibm.com/developerworks/linux/library/l-sed2.html" onclick="urchinTracker('/outgoing/www.ibm.com/developerworks/linux/library/l-sed2.html?referer=');">look some stuff up here</a> or on this <a href="http://www.grymoire.com/Unix/Sed.html#uh-4" onclick="urchinTracker('/outgoing/www.grymoire.com/Unix/Sed.html_uh-4?referer=');">awesome sed guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/terminal-heroes/884/terminal-heroes-sed-mastery-group-catching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Git with Gitosis</title>
		<link>http://www.blog.project13.pl/index.php/project13/477/installing-git-with-gitosis/</link>
		<comments>http://www.blog.project13.pl/index.php/project13/477/installing-git-with-gitosis/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 15:22:40 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Project13]]></category>
		<category><![CDATA[free software]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[gitosis]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[webdeveloper]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=477</guid>
		<description><![CDATA[Git is really simple and VERY powerfull. It makes svn look like an idiot &#8211; but that&#8217;s just my personal opinion ;-) Anyways, I&#8217;m using github most of the time, but now I&#8217;d like to hava a non public repository (yet remote) for some small project. I&#8217;ve been commiting to a local git instance from [...]]]></description>
			<content:encoded><![CDATA[<p>Git is really simple and VERY powerfull. It makes svn look like an idiot &#8211; but that&#8217;s just my personal opinion ;-)</p>
<p>Anyways, I&#8217;m using github most of the time, but now I&#8217;d like to hava a non public repository (yet remote) for some small project. I&#8217;ve been commiting to a local git instance from the begining of this project so just pushing it into a new repo will be really simple.</p>
<p>I wanted to have som easy to administer localozed git to serve hit hosting for my friends etc. So this is how I did it:</p>
<p>On server:</p>
<div class="geshi no bash">
<div class="head"># do this as root of course</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw3">cd</span> ~<span class="sy0">/</span>src</div>
</li>
<li class="li1">
<div class="de1">git clone git:<span class="sy0">//</span>eagain.net<span class="sy0">/</span>gitosis.git</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">cd</span> gitosis</div>
</li>
<li class="li1">
<div class="de1">.<span class="sy0">/</span>setup.py <span class="kw2">install</span></div>
</li>
<li class="li1">
<div class="de1">useradd git</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#end of obvious stuff</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">gitosis-init <span class="sy0">&lt;</span> <span class="sy0">/</span>location<span class="sy0">/</span>of<span class="sy0">/</span>administrators<span class="sy0">/</span>public<span class="sy0">/</span>id_rsa.pub <span class="co0">#this will allow you to administer gitosis remotely</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">sudo</span> <span class="kw2">chmod</span> <span class="nu0">755</span> <span class="sy0">/</span>home<span class="sy0">/</span>git<span class="sy0">/</span>repositories<span class="sy0">/</span>gitosis-admin.git<span class="sy0">/</span>hooks<span class="sy0">/</span>post-update <span class="co0"># in case gitosis-init didn&#39;t do this already</span></div>
</li>
</ol>
</div>
<p>Now we can do all the administration without being logged in into our server &#8211; just by using git!
</pre>
<div class="geshi no bash">
<div class="head">#all of the following is done LOCALLY!</div>
<ol>
<li class="li1">
<div class="de1">git clone git<span class="sy0">@</span>stratos:gitosis-admin.git</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">cd</span> gitosis-admin</div>
</li>
<li class="li1">
<div class="de1">vim gitosis.conf <span class="co0">#edit groups and repositories</span></div>
</li>
<li class="li1">
<div class="de1">writable = bla is responsible <span class="kw1">for</span> the repositories</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#for example you could setup:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#then just do the stuff you would normally do with git:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#[group secret-group]</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#writable = bla</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#members = ktoso@homunculus ktoso@protos</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#here&#39;s how your dir structure should look like</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#├── gitosis.conf #repository configuration</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#└── keydir #put all (ssh) public keys of your users in here</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp;├── ktoso@homunculus.pub</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp;└── ktoso@protos.pub</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#now just do what you would normally do with a git repository</span></div>
</li>
<li class="li1">
<div class="de1">git add .</div>
</li>
<li class="li1">
<div class="de1">git commit -m <span class="st0">&#39;new repo: bla&#39;</span></div>
</li>
<li class="li1">
<div class="de1">git push</div>
</li>
</ol>
</div>
<p>You can then just pull/clone this repo:</p>
<pre lang="bash">git clone git://stratos/bla.git</pre>
<p>Yeah, this post isn't much of an discovery - yet I wanted to show you how SIMPLE and SCALABLE a simple git repository can be. For mor information about git and gitosis see: <a href="http://www.google.com/search?q=google+gitosis" onclick="urchinTracker('/outgoing/www.google.com/search?q=google+gitosis&amp;referer=');">a simple google search</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/project13/477/installing-git-with-gitosis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal Heroes 8: Memory usage scripts</title>
		<link>http://www.blog.project13.pl/index.php/coding/442/memory-usage-scripts/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/442/memory-usage-scripts/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 10:54:21 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=442</guid>
		<description><![CDATA[I have a low-memory VPS running online and thus always have to worry about what uses how much memory&#8230; Of course top and my favorite htop are very good tools to check this, but sometimes I just want to get a super simple report if I&#8217;m overusing memory or not yet. The bellow scripts (most [...]]]></description>
			<content:encoded><![CDATA[<p>I have a low-memory VPS running online and thus always have to worry about what uses how much memory&#8230; Of course top and my favorite <strong>htop</strong> are very good tools to check this, but sometimes I just want to get a super simple report if I&#8217;m overusing memory or not yet. The bellow scripts (most of them was found online or hacked up from multiple scripts to fit my needs) print simple yet very readable memory usage information.</p>
<h2>memused</h2>
<div class="geshi no bash">
<div class="head">#!/bin/bash</div>
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#if [ $1 = &#39;&#39;]; then</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#    ps auxf | awk &#39;{sum=sum+$6}; END {print sum/1024}&#39;;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#else</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#    ps auxf | grep $1 | awk &#39;{sum=sum+$6}; END {print sum/1024}&#39;;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#fi</span></div>
</li>
<li class="li1">
<div class="de1"><span class="re2">bean=</span>`<span class="kw2">cat</span> <span class="sy0">/</span>proc<span class="sy0">/</span>user_beancounters` <span class="re2">guar=</span>`<span class="kw3">echo</span> <span class="st0">&quot;$bean&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> vmguar <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $4;}&#39;</span>` <span class="re2">burst=</span>`<span class="kw3">echo</span> <span class="st0">&quot;$bean&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> privvm <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $5;}&#39;</span>` <span class="re2">priv=</span>`<span class="kw3">echo</span> <span class="st0">&quot;$bean&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> privvm <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $2;}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="re2">total=</span>guar<span class="sy0">/</span><span class="nu0">256</span> <span class="kw3">let</span> <span class="re2">used=</span>priv<span class="sy0">/</span><span class="nu0">256</span> <span class="kw3">let</span> <span class="re2">burst=</span>burst<span class="sy0">/</span><span class="nu0">256</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;VPS memory usage:&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;Used: $used MB&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;Total: $total MB&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;Burstable to: $burst MB&quot;</span></div>
</li>
</ol>
</div>
<p>Sample output:<br />
<code>VPS memory usage:<br />
Used: 296 MB<br />
Total: 256 MB<br />
Burstable to: 512 MB</code></p>
<h2>memfree</h2>
<div class="geshi no bash">
<div class="head">#!/bin/bash</div>
<ol>
<li class="li1">
<div class="de1"><span class="co0">#</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># Revised 02-Feb-2007: include kernel memory (kmemsize) in &#39;used&#39; calculation</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># and show percentages in output.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">BEAN=</span>`<span class="kw2">cat</span> <span class="sy0">/</span>proc<span class="sy0">/</span>user_beancounters`</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">GUAR=</span>`<span class="kw3">echo</span> <span class="st0">&quot;$BEAN&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> vmguar <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $4;}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">PRIV=</span>`<span class="kw3">echo</span> <span class="st0">&quot;$BEAN&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> privvm <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $2;}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">KMEM=</span>`<span class="kw3">echo</span> <span class="st0">&quot;$BEAN&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> kmem <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $3;}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="re2">TOTL=</span><span class="re1">$GUAR</span><span class="sy0">/</span><span class="nu0">256</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="re2">KMMB=</span><span class="re1">$KMEM</span><span class="sy0">/</span><span class="nu0">1048576</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="re2">PVMB=</span><span class="re1">$PRIV</span><span class="sy0">/</span><span class="nu0">256</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="re2">USED=</span><span class="re1">$KMMB</span>+<span class="re1">$PVMB</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="re2">FREE=</span><span class="re1">$TOTL</span>-<span class="re1">$USED</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;$FREE&quot;</span> -gt <span class="st0">&quot;0&quot;</span> <span class="br0">&#93;</span>; <span class="kw1">then</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">let</span> <span class="re2">UPER=</span><span class="re1">$USED</span><span class="sy0">*</span><span class="nu0">100</span><span class="sy0">/</span><span class="re1">$TOTL</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">let</span> <span class="re2">FPER=</span><span class="nu0">100</span>-<span class="re1">$UPER</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">let</span> <span class="re2">UPER=</span><span class="st0">&quot;100&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">let</span> <span class="re2">FPER=</span><span class="st0">&quot;0&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">fi</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;VPS Memory:&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot; Total: $TOTL mb Used: $USED mb (${UPER}%) Free: $FREE mb (${FPER}%)&quot;</span></div>
</li>
</ol>
</div>
<p>Sample output:<br />
<code>VPS Memory:<br />
Total: 256 mb Used: 302 mb (100%) Free: -46 mb (0%)</code></p>
<h2>memheld</h2>
<div class="geshi no bash">
<div class="head">#!/bin/bash</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">grep</span> oomguarpages <span class="sy0">/</span>proc<span class="sy0">/</span>user_beancounters <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{s=$2;t=$3;u=$4; {print &quot;VPS Memory Usage<span class="es0">\n</span>Current Held: &quot; s/256 &quot;MB<span class="es0">\n</span>Max Held: &quot; t/256 &quot;MB<span class="es0">\n</span>Barrier: &quot;u/256&quot;MB&quot; }}&#39;</span></div>
</li>
</ol>
</div>
<p>Sample output:<br />
<code>VPS Memory Usage<br />
Current Held: 160.832MB<br />
Max Held: 294.605MB<br />
Barrier: 256MB</code></p>
<h2>memps</h2>
<div class="geshi no bash">
<div class="head">#!/bin/bash</div>
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;ps axo pmem,pcpu,comm | sort&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">ps</span> axo pmem,pcpu,<span class="kw2">comm</span> <span class="sy0">|</span> <span class="kw2">sort</span></div>
</li>
</ol>
</div>
<p>Sample output:<br />
<code>ps axo pmem,pcpu,comm | sort<br />
0.0  0.0 script<br />
0.0  0.0 script<br />
0.1  0.0 init<br />
#...<br />
2.2  0.0 httpd<br />
4.0  0.0 mysqld<br />
7.3  0.0 httpd<br />
8.0  0.0 httpd<br />
%MEM %CPU COMMAND</code></p>
<h2>memprivmpages</h2>
<div class="geshi no bash">
<div class="head">#!/bin/bash</div>
<ol>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">beans=</span>`<span class="kw2">cat</span> <span class="sy0">/</span>proc<span class="sy0">/</span>user_beancounters <span class="sy0">|</span> <span class="kw2">grep</span> priv`</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">max=</span>`<span class="kw3">echo</span> <span class="re1">$beans</span> <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $4;}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1"><span class="re2">use=</span>`<span class="kw3">echo</span> <span class="re1">$beans</span> <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{ print $2;}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="st0">&quot;per=$use*100/$max&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="st0">&quot;mb=$use/256&quot;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">let</span> <span class="st0">&quot;mmb=$max/256&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw3">echo</span> <span class="st0">&quot;privvmpages usage: $mb MB ($per% of $mmb)&quot;</span></div>
</li>
</ol>
</div>
<p>Sample output:<br />
<code>privvmpages usage: 296 MB (57% of 512)</code><br />
For those wondering, yes I do have memory usage <em>above &#8220;100%&#8221; </em>in the output of some of these scripts, and it&#8217;s partially true. A VPS does usually have some guaranteed memory, and some &#8220;burstable&#8221; &#8211; so you can use more than just the guaranteed memory for some period of time. On the mashine I ran this I have 256 guaranteed and a &#8220;total&#8221; of 512MB &#8211; including the burstable memory.</p>
<p>If you like any of these, feel free to use them. I use them by creating a scripts directory and adding it to the PATH, so I can simply invoke them from anywhere.</p>
<p>PS: For more <strong>detailed memory usage information</strong> (as graphs etc), I&#8217;m using <a href="http://munin.projects.linpro.no/" onclick="urchinTracker('/outgoing/munin.projects.linpro.no/?referer=');"><strong>Munin</strong></a> and really recommend it. The graphs it draws are really nice, and it <strong>doesn&#8217;t</strong> inflict heavy load on the server, and it can <strong>monitor remote hosts</strong> if needed!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/442/memory-usage-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kill only Tomcat</title>
		<link>http://www.blog.project13.pl/index.php/coding/422/easy-way-to-kill-tomcat/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/422/easy-way-to-kill-tomcat/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 22:14:47 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=422</guid>
		<description><![CDATA[There is sometimes the need to kill some JVM, I usually use &#8220;killall java&#8221; and that works fine as long as that&#8217;s in fact what I want &#8211; kill ALL. But let&#8217;s say i just want to kill Tomcat and not my IDE? The below method works quite well in such an situation: [ktoso@homunculus ~]$ [...]]]></description>
			<content:encoded><![CDATA[<p>There is sometimes the need to kill some JVM, I usually use &#8220;killall java&#8221; and that works fine as long as that&#8217;s in fact what I want &#8211; kill ALL. But let&#8217;s say i just want to kill Tomcat and not my IDE? The below method works quite well in such an situation:</p>
<div class="geshi no bash">
<div class="head">[ktoso@homunculus ~]$ sudo netstat -lpn | grep 8080</div>
<ol>
<li class="li1">
<div class="de1">tcp &nbsp; &nbsp; &nbsp; &nbsp;<span class="nu0">0</span> &nbsp; &nbsp; &nbsp;<span class="nu0">0</span> :::<span class="nu0">8080</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :::<span class="sy0">*</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;LISTEN &nbsp; &nbsp; &nbsp;<span class="nu0">18525</span><span class="sy0">/</span>java</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ktoso<span class="sy0">@</span>homunculus ~<span class="br0">&#93;</span>$ <span class="kw2">kill</span> <span class="nu0">18525</span> <span class="co0"># you might need to add -9 here (SIGKILL)</span></div>
</li>
</ol>
</div>
<p>A quickly hacked up version of an simple shell script to kill this tomcat could look like (I still suck at awk&#8230;):</p>
<div class="geshi no bash">
<div class="head">#!/bin/sh</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">kill</span> <span class="nu0">-9</span> `<span class="kw2">netstat</span> -lpn <span class="sy0">|</span> <span class="kw2">grep</span> <span class="nu0">8080</span> <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{print $7}&#39;</span> <span class="sy0">|</span> <span class="kw2">awk</span> -F<span class="sy0">/</span> <span class="st0">&#39;{print $1}&#39;</span>`</div>
</li>
</ol>
</div>
<p>The above obviously sux, as we&#8217;re using two awk commands after another&#8230; Ans also in the above examples, I&#8217;ve assumed that tomcat is listening on 8080, this may not always be the case, since with mod_proxy_ajp, there is no need fot it to listen on it&#8217;s default port and just the one to communicate by AJP. Let&#8217;s use it&#8217;s name to find it&#8217;s PID, we&#8217;ll use ps and grep and awk &#8211; life is simple with them. :-)<br />
Here&#8217;s the final version of this command: </p>
<div class="geshi no bash">
<div class="head">#!/bin/sh</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">kill</span> <span class="nu0">-9</span> `<span class="kw2">ps</span> aux <span class="sy0">|</span> <span class="kw2">grep</span> catalina <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{print $2}&#39;</span>`</div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/422/easy-way-to-kill-tomcat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQLIntegra: dbfiller &amp; wiki</title>
		<link>http://www.blog.project13.pl/index.php/null/401/mysqlintegra-dbfiller-wiki/</link>
		<comments>http://www.blog.project13.pl/index.php/null/401/mysqlintegra-dbfiller-wiki/#comments</comments>
		<pubDate>Tue, 09 Feb 2010 23:06:21 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[agh]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[jmeter]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mariadb]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[redhat]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=401</guid>
		<description><![CDATA[I passed all my exams at my first attempt and should have now some time to relax, right? Well something like that, I&#8217;m actually doing quite a lot these days. We&#8217;re on the roll with MySQL Integra. Our server &#8220;Kopiec&#8221; is somewhat online (running CentOS off course) &#8211; we&#8217;re able to start/stop if thanks to [...]]]></description>
			<content:encoded><![CDATA[<p>I passed all my exams at my first attempt and should have now some time to relax, right? Well something like that, I&#8217;m actually doing quite a lot these days. We&#8217;re on the roll with MySQL Integra.</p>
<p>Our server &#8220;<strong>Kopiec</strong>&#8221; is somewhat online (running <strong>CentOS</strong> off course) &#8211; we&#8217;re able to start/stop if thanks to a tool that&#8217;s called &#8220;remote insight&#8221;, and I&#8217;ve put 3 databases on there. <strong>MariaDB</strong>, <strong>InfiniDB</strong> and a clean <strong>MySQL</strong> instalation. We&#8217;re somewhat having problems with <strong>TokuDB</strong>, but that&#8217;s going to be our 4th database of interest. If you want to keep track of our test&#8217;s you can take a look at: <a href="http://mysqlintegra.project13.pl/" onclick="urchinTracker('/outgoing/mysqlintegra.project13.pl/?referer=');">http://mysqlintegra.project13.pl/</a>.</p>
<p>The first step in getting things tested is filling those db&#8217;s with some data, and I mean a LOT of data. So we hacked up a <em>more or less quick and dirty</em> <strong>python</strong> script called <strong>dbfiller</strong> (<a href="http://github.com/barthez/mysql.integra.dbfiller" onclick="urchinTracker('/outgoing/github.com/barthez/mysql.integra.dbfiller?referer=');"><strong>source code </strong>avaiable on github</a>) that would simulate a very simple table generation scheme (people working on shifts and checking in when they&#8217;re finished or start some activity). If you&#8217;re interested, our task is specyfied in the /doc/Opis.pdf file (sorry, only in polish). After a few days it&#8217;s up and running and we&#8217;re moving on to filling up those databases with some gigabytes of data.</p>
<p>Next we&#8217;re going to write some SQL Views/Procedures and then we&#8217;ll use <a href="http://mysqlintegra.project13.pl/index.php/Apache_JMeter" onclick="urchinTracker('/outgoing/mysqlintegra.project13.pl/index.php/Apache_JMeter?referer=');">Apache<strong> JMeter</strong></a> to run some<strong> performance</strong> benchmarks of some interesting <strong>data storage engines</strong>.</p>
<p>PS: If you&#8217;re wondering about my GWT-Crossword project &#8211; yeah, it&#8217;s still actual, and I&#8217;ll get right on it when done with some of the stuff here.<br />
PPS: Yes, an Linux powered phone AT LAST in my hands! The HTC HERO is comming to me really soon &#8211; never again shall I use a ShitOS like WindowsMobile 6.5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/null/401/mysqlintegra-dbfiller-wiki/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>(Almost) Automatically convert files into PDF</title>
		<link>http://www.blog.project13.pl/index.php/fun/285/almost-automatically-convert-files-into-pdf/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/285/almost-automatically-convert-files-into-pdf/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 00:56:55 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=285</guid>
		<description><![CDATA[I&#8217;m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( http://www.icsr.agh.edu.pl/~mownit/mownit.html ). I was really happy to see some *.ps but some people from my fellow students started complaining that they&#8217;d rather have pdf&#8217;s and not ghostscript files (who knows why they&#8217;d do..?). [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( <a href="http://www.icsr.agh.edu.pl/~mownit/mownit.html" onclick="urchinTracker('/outgoing/www.icsr.agh.edu.pl/_mownit/mownit.html?referer=');">http://www.icsr.agh.edu.pl/~mownit/mownit.html</a> ). I was really happy to see some *.ps but some people from my fellow students started complaining that they&#8217;d rather have pdf&#8217;s and not ghostscript files <em>(who knows why they&#8217;d do..?)</em>. Anyways, they all had &#8220;manual&#8221; repetitious methods for converting the files &#8211; even uploading to somewebsite to have them converted over there &#8220;in the cloud&#8221;&#8230; I though of a slightly quicker and more efficient way, here it is, hope you&#8217;ll like it. Ah, there is One &#8220;non standard&#8221; requirement for this to work, you have to install <strong>cups-pdf</strong> :-)</p>
<div class="geshi no bash">
<div class="head">wget http://www.icsr.agh.edu.pl/~mownit/mownit.html -r &#8211;level 1 -A.ps &#8211;cut-dirs 4</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">mv</span> www.icsr.agh.edu.pl<span class="sy0">/*</span> .</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">rm</span> -rf www.icsr.agh.edu.pl<span class="sy0">/</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">for</span> <span class="kw2">file</span> <span class="kw1">in</span> `<span class="kw2">dir</span> -f <span class="sy0">*</span>` ; <span class="kw1">do</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw2">lpr</span> -P <span class="st0">&#39;cups-PDF&#39;</span> <span class="re1">$file</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw3">echo</span> <span class="st0">&quot;press enter when cups is done printing&#8230;&quot;</span> <span class="co0">#yeah, i got lazy here, one could watch lpq for changes etc.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw2">read</span> oczekiwanie;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw2">mv</span> <span class="sy0">/</span>home<span class="sy0">/</span>ktoso<span class="sy0">/</span>Pulpit<span class="sy0">/</span>cups-pdf<span class="sy0">/</span>template.pdf .<span class="sy0">/</span><span class="re1">$file</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">done</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># ________________ </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&lt; Happy hacking! &gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &#8212;&#8212;&#8212;&#8212;&#8212;- </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; ^__^</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp;(oo)\_______</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(__)\ &nbsp; &nbsp; &nbsp; )\/\</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;||&#8212;-w |</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| &nbsp; &nbsp; ||</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/285/almost-automatically-convert-files-into-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Blender problems on IntelGMAX4500</title>
		<link>http://www.blog.project13.pl/index.php/coding/269/fixing-blender-problems-on-intelgmax4500/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/269/fixing-blender-problems-on-intelgmax4500/#comments</comments>
		<pubDate>Wed, 21 Oct 2009 19:30:07 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[blender]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=269</guid>
		<description><![CDATA[I&#8217;ve recently bought a new laptop, a 15.6&#8221; HP Probook, that replaced my netbook Asus EEE 900 (needed some bigger hardware to work on &#8220;on the move&#8221;). One problem I encountered was blender not displaying correctly if I&#8217;d expand any dropdown menu etc. The fix is very simple yet powerfull, just set the following: LIBGL_ALWAYS_SOFTWARE=1 [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently bought a new laptop, a 15.6&#8221; HP Probook, that replaced my netbook Asus EEE 900 (needed some bigger hardware to work on &#8220;on the move&#8221;). One problem I encountered was blender not displaying correctly if I&#8217;d expand any dropdown menu etc. The fix is very simple yet powerfull, just set the following:</p>
<p><code>LIBGL_ALWAYS_SOFTWARE=1 blender</code></p>
<p>This will launch blender and render it&#8217;s interface in software mode &#8211; runs perfectly, and no slowdowns could be detected by me so far :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/269/fixing-blender-problems-on-intelgmax4500/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim Hacking &#8211; 1 &#8211; vis</title>
		<link>http://www.blog.project13.pl/index.php/coding/233/vim-hacking-1-vis/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/233/vim-hacking-1-vis/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 18:33:42 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=233</guid>
		<description><![CDATA[Vim is a really amazing text editor (though I&#8217;d like to learn Emacs too soon&#8230; :-)) and it can be easily expanded to be even more useful. One super cool extension I found is: vis -- it allows powerful sed-like line modification (you could use sed from inside vim, but that&#8217;s not really &#8220;handy&#8221;). Vis [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Vi</strong>m is a really amazing text editor (though I&#8217;d like to learn <strong>Emacs</strong> too soon&#8230; :-)) and it can be easily expanded to be even more useful. One super cool extension I found is: <strong>vis</strong> -- it allows powerful sed-like line modification<em> (you could use sed from inside vim, but that&#8217;s not really &#8220;handy&#8221;)</em>. Vis is a vim plugin, and as such, it has to be installed before use, here is how to do this (asuming you have <strong>vim 7.0+</strong>):<br />
<code>echo 'read some about the plugin at:  http://vim.sourceforge.net/scripts/script.php?script_id=1195'<br />
vim /home/script/location/vis.vba<br />
:source %</code><br />
With this done you can doo stuff like in this video i did:</p>
<p style="text-align:center;"><span class="youtube">
<object width="480" height="360">
<param name="movie" value="http://www.youtube.com/v/MzxEt9sK5eM&amp;color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1&amp;hd=1" />
<param name="allowFullScreen" value="true" />
<embed wmode="transparent" src="http://www.youtube.com/v/MzxEt9sK5eM&amp;color1=3a3a3a&amp;color2=999999&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0?rel=1&amp;hd=1" type="application/x-shockwave-flash" allowfullscreen="true" width="480" height="360"></embed>
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=MzxEt9sK5eM&fmt=18" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=MzxEt9sK5eM_fmt=18&amp;referer=');"><img src="http://img.youtube.com/vi/MzxEt9sK5eM/default.jpg" width="130" height="97" border=0></a></p></p>
<p><a href="http://www.youtube.com/watch?v=MzxEt9sK5eM" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=MzxEt9sK5eM&amp;referer=');">Watch it on youtube</a> to see useful <strong>annotations</strong>! If your still new to vim you might want to start with simple editing as shown here: <a href="http://www.youtube.com/watch?v=71YTkxUNwmg&amp;NR=1" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=71YTkxUNwmg_amp_NR=1&amp;referer=');">http://www.youtube.com/watch?v=71YTkxUNwmg&amp;NR=1</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/233/vim-hacking-1-vis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal Heroes &#8211; 6 &#8211; Track X events</title>
		<link>http://www.blog.project13.pl/index.php/fun/236/terminal-heroes-6-track-x-events/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/236/terminal-heroes-6-track-x-events/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 22:53:33 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line fu]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=236</guid>
		<description><![CDATA[Another Command Line Fu oneliner I&#8217;ve sumbited today: #show X window events in chosen window $ xev -id `xwininfo &#124; grep &#39;Window id&#39; &#124; awk &#39;{print $4}&#39;` EnterNotify event, serial 13, synthetic NO, window 0&#215;6400053, &#160; &#160; root 0x13c, subw 0x640005b, time 42431610, &#40;367,0&#41;, root:&#40;369,63&#41;, &#160; &#160; mode NotifyNormal, detail NotifyVirtual, same_screen YES, &#160; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Another Command Line Fu oneliner I&#8217;ve sumbited today:</p>
<div class="geshi no bash">
<div class="head">#show X window events in chosen window</div>
<ol>
<li class="li1">
<div class="de1">$ xev -<span class="kw2">id</span> `xwininfo <span class="sy0">|</span> <span class="kw2">grep</span> <span class="st0">&#39;Window id&#39;</span> <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st0">&#39;{print $4}&#39;</span>`</div>
</li>
<li class="li1">
<div class="de1">EnterNotify event, serial <span class="nu0">13</span>, synthetic NO, window 0&#215;6400053,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; root 0x13c, subw 0x640005b, <span class="kw1">time</span> <span class="nu0">42431610</span>, <span class="br0">&#40;</span><span class="nu0">367</span>,<span class="nu0">0</span><span class="br0">&#41;</span>, root:<span class="br0">&#40;</span><span class="nu0">369</span>,<span class="nu0">63</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; mode NotifyNormal, detail NotifyVirtual, same_screen YES,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; focus NO, state <span class="nu0">16</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">MotionNotify event, serial <span class="nu0">13</span>, synthetic NO, window 0&#215;6400053,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; root 0x13c, subw 0x640005b, <span class="kw1">time</span> <span class="nu0">42431610</span>, <span class="br0">&#40;</span><span class="nu0">367</span>,<span class="nu0">0</span><span class="br0">&#41;</span>, root:<span class="br0">&#40;</span><span class="nu0">369</span>,<span class="nu0">63</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; state 0&#215;10, is_hint <span class="nu0">0</span>, same_screen YES</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">MotionNotify event, serial <span class="nu0">13</span>, synthetic NO, window 0&#215;6400053,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; root 0x13c, subw 0x640005b, <span class="kw1">time</span> <span class="nu0">42431618</span>, <span class="br0">&#40;</span><span class="nu0">366</span>,<span class="nu0">0</span><span class="br0">&#41;</span>, root:<span class="br0">&#40;</span><span class="nu0">368</span>,<span class="nu0">63</span><span class="br0">&#41;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; state 0&#215;10, is_hint <span class="nu0">0</span>, same_screen YES</div>
</li>
</ol>
</div>
<p>After executing this, click on a window you want to track X Window events in. You could &#8220;read&#8221; this command like this: &#8220;<em>xev will track events in the window with the following -id, which we get by greping window information obtained by xwininfo</em>&#8221; :-)</p>
<p>Ok, but why did I need such weird information? Well, I wanted to make a simple video showing vis, a vim plugin etc. But as it is always in vim, keypresses are essential &#8211; so I wanted to &#8220;show what i type&#8221; bigger :-) I&#8217;ll post it really soon btw&#8230; :-)</p>
<p>The command was <a href="http://www.commandlinefu.com/commands/view/3547/track-x-window-events-in-chosen-window#comment" onclick="urchinTracker('/outgoing/www.commandlinefu.com/commands/view/3547/track-x-window-events-in-chosen-window_comment?referer=');">posted on commandlinefu</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/236/terminal-heroes-6-track-x-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

