<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Žiga's code</title>
	
	<link>http://ziga.hamsworld.net</link>
	<description>Just another programmer's weblog (by Žiga Ham)</description>
	<lastBuildDate>Tue, 05 Jun 2012 19:37:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/zigaham" /><feedburner:info uri="zigaham" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>List Unfinished Tasks in Moodle (ucilnica.*.uni-lj.si)</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/7LY9ZEBzvzs/</link>
		<comments>http://ziga.hamsworld.net/2011/03/12/moodle-todo/#comments</comments>
		<pubDate>Sat, 12 Mar 2011 01:11:58 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/?p=174</guid>
		<description><![CDATA[If you hate Moodle, often miss homework deadlines or if you&#8217;re constantly checking if there are any tasks you haven&#8217;t finished, this is just the thing for you! After installing, just type &#8220;todo&#8221; in your terminal, and your unfinished tasks will be listed for you. Source: https://github.com/hamax/moodle-todo Quick start: - install Python &#8211; Beautiful Soup (&#62;= [...]]]></description>
				<content:encoded><![CDATA[<p>If you hate Moodle, often miss homework deadlines or if you&#8217;re constantly checking if there are any tasks you haven&#8217;t finished, this is just the thing for you! <img src='http://ziga.hamsworld.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>After installing, just type &#8220;todo&#8221; in your terminal, and your unfinished tasks will be listed for you.</p>
<p><a href="http://ziga.hamsworld.net/uploads/2011/03/moodle-todo.png" rel="lightbox[174]"><img class="alignnone size-full wp-image-176" title="moodle-todo" src="/uploads/2011/03/moodle-todo.png" alt="" width="911" height="231" /></a></p>
<p>Source: <a href="https://github.com/hamax/moodle-todo">https://github.com/hamax/moodle-todo</a></p>
<p>Quick start:<br />
- install Python &#8211; Beautiful Soup (&gt;= 3.1)<br />
- download one and only source file: <a href="https://github.com/hamax/moodle-todo/raw/master/todo.py">https://github.com/hamax/moodle-todo/raw/master/todo.py<br />
</a>- set your username and password in todo.py (or make a config file ~/.moodle-todo.conf)<br />
- (optional) add it to PATH (I recommend making a link in /bin)<br />
- run it <img src='http://ziga.hamsworld.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/7LY9ZEBzvzs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2011/03/12/moodle-todo/feed/</wfw:commentRss>
		<slash:comments>505</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2011/03/12/moodle-todo/</feedburner:origLink></item>
		<item>
		<title>Surviving without Apache (with Nginx, mod_wsgi and php-cgi)</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/Lr1QcHL76ew/</link>
		<comments>http://ziga.hamsworld.net/2010/12/04/surviving-without-apache-with-nginx-mod_wsgi-and-php-cgi/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 19:10:44 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/?p=119</guid>
		<description><![CDATA[This tutorial is very simple, anyone with basic understanding of linux should be able to get it up and running. (this blog and everything else on hamsworld.net is running on this configuration) Side note: If you don&#8217;t want to compile nginx and/or want a more stable solution consider gunicorn. Download nginx and mod_wsgi from the [...]]]></description>
				<content:encoded><![CDATA[<p>This tutorial is very simple, anyone with basic understanding of linux should be able to get it up and running.<br />
(this blog and everything else on hamsworld.net is running on this configuration)</p>
<p><strong>Side note: </strong>If you don&#8217;t want to compile nginx and/or want a more stable solution consider <a href="http://gunicorn.org/">gunicorn</a>.</p>
<ul>
<li>Download <strong>nginx</strong> and <strong>mod_wsgi</strong> from the web and extract them</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
wget http://nginx.org/download/nginx-0.8.53.tar.gz
whet http://bitbucket.org/lifeeth/mod_wsgi/get/6975f0ec7eeb.gz
tar xvzf nginx-0.8.53.tar.gz 6975f0ec7eeb.gz
</pre>
<ul>
<li>Make sure there are folders &#8220;nginx-0.8.53&#8243; and &#8220;mod_wsgi&#8221;</li>
<li>Install <strong>nginx</strong> (you will need gcc, libssl-dev and libpcre3-dev packages installed, you can just apt-get install them)</li>
</ul>
<pre class="brush: bash; title: ; notranslate">
cd nginx-0.8.53
./configure --sbin-path=/usr/sbin --conf-path=/etc/nginx/nginx.conf --add-module=../mod_wsgi/ --with-debug
make
sudo make install
cd ..
</pre>
<ul>
<li>Install <strong>mod_wsgi</strong></li>
</ul>
<pre class="brush: bash; title: ; notranslate">
cd mod_wsgi
sudo python setup.py install --sbin-path=/usr/sbin --conf-path=/etc/nginx
cd ..
</pre>
<ul>
<li>Configure nginx</li>
</ul>
<p>Go to <strong>/etc/nginx/</strong> and create a directory <strong>sites</strong> or something like that for per virtual server configs and then edit your <strong>nginx.conf</strong> to something like that:</p>
<pre class="brush: bash; title: ; notranslate">
user    www-data;
worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;
    tcp_nodelay        on;

    #gzip  on;

    wsgi_python_optimize 0;
    #wsgi_python_executable /usr/bin/python;
    #wsgi_python_home /usr/;
    wsgi_enable_subinterpreters on;

    include /etc/nginx/sites/*;
}
</pre>
<ul>
<li>If you need <strong>php</strong>, follow this few simple steps to get php-cgi up and running (<strong>skip &#8220;Install nginx&#8221;</strong> and &#8220;test&#8221;): <a href="http://davidwinter.me/articles/2009/06/13/php-and-nginx-the-easy-way/">http://davidwinter.me/articles/2009/06/13/php-and-nginx-the-easy-way/</a></li>
<li>Now all that is left are per-site configurations. For every site create a file in <strong>/etc/nginx/sites/</strong> and paste something like that in it:</li>
</ul>
<p><strong>Django or other wsgi</strong> (you&#8217;ll need django.wsgi file from here <a href="http://docs.djangoproject.com/en/1.2/howto/deployment/modwsgi/">http://docs.djangoproject.com/en/1.2/howto/deployment/modwsgi/</a>):</p>
<pre class="brush: bash; title: ; notranslate">
server {
    listen       80;
    server_name  www.example.com; #change this

    location /media/ {
        root   /path/to/django/project/; #change this; without media at the end
    }

    location / {
        wsgi_pass /path/to/django/project/django.wsgi; #change this

        include wsgi_vars;

        wsgi_pass_authorization off;
        wsgi_script_reloading on;
        wsgi_use_main_interpreter on;
    }

}
</pre>
<p><strong>WordPress:</strong></p>
<pre class="brush: bash; title: ; notranslate">
server {
    listen 80;
    server_name www.example.com; #change this
    root /path/to/wordpress/; #change this
    index index.php;

    try_files $uri $uri/ /index.php?q=$uri&amp;$args;

    location ~ \.php$ {
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }

}
</pre>
<p><strong>Other PHP</strong>:<br />
Same as wordpress, just delete the try_files if you don&#8217;t want it (it redirects everything that doesn&#8217;t exist to index).</p>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/Lr1QcHL76ew" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2010/12/04/surviving-without-apache-with-nginx-mod_wsgi-and-php-cgi/feed/</wfw:commentRss>
		<slash:comments>537</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2010/12/04/surviving-without-apache-with-nginx-mod_wsgi-and-php-cgi/</feedburner:origLink></item>
		<item>
		<title>IRC Scripts and Bots and stuff and things</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/bQCMbZajkuo/</link>
		<comments>http://ziga.hamsworld.net/2010/09/21/irc-scripts-and-bots-and-stuff-and-things/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 22:46:24 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[Wiki]]></category>
		<category><![CDATA[XChat]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/?p=105</guid>
		<description><![CDATA[Some cool IRC stuff that I made during this weekend: XChat script, that lowercases &#8220;caps-lock retard&#8221; messages: ShikiScript (unzip it first) You can place it in ~/.xchat2/ for automatic loading on every start or just load it with the xchat GUI: Window -&#62; Plugins and Scripts Modules for pyfibot &#8211; IRC bot written in python: [...]]]></description>
				<content:encoded><![CDATA[<p>Some cool <a class="zem_slink" title="Internet Relay Chat" rel="wikipedia" href="http://en.wikipedia.org/wiki/Internet_Relay_Chat">IRC</a> stuff that I made during this weekend:</p>
<p><a class="zem_slink" title="XChat" rel="wikipedia" href="http://en.wikipedia.org/wiki/XChat">XChat</a> script, that lowercases &#8220;caps-lock retard&#8221; messages: <a href="http://ziga.hamsworld.net/uploads/2010/09/ShikiScript.py_.gz">ShikiScript</a> (unzip it first)<br />
You can place it in ~/.xchat2/ for automatic loading on every start or just load it with the xchat GUI: Window -&gt; Plugins and Scripts</p>
<p>Modules for <a href="http://code.google.com/p/pyfibot/">pyfibot</a> &#8211; <a class="zem_slink" title="Internet Relay Chat bot" rel="wikipedia" href="http://en.wikipedia.org/wiki/Internet_Relay_Chat_bot">IRC bot</a> written in python:<br />
<a href="http://ziga.hamsworld.net/uploads/2010/09/module_joke.py_.gz">module_joke</a>: gets a random joke (.joke)<br />
<a href="http://ziga.hamsworld.net/uploads/2010/09/module_wiki.py_.gz">module_wiki</a>: does a google search (.search/.s &#8211; they are not the same thing) or displays the first paragraph of wiki article (.wiki/.w &#8211; they are the same thing)</p>
<p>If you want to see it in action, you can join <a href="irc://irc.freenode.net:8001/hamsworld">#hamsworld@irc.freenode.net:8001</a> (you can use this <a href="http://webchat.freenode.net/?channels=#hamsworld">webchat</a>).</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=f1330a0d-7754-42b6-acd5-087da848f502" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/bQCMbZajkuo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2010/09/21/irc-scripts-and-bots-and-stuff-and-things/feed/</wfw:commentRss>
		<slash:comments>365</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2010/09/21/irc-scripts-and-bots-and-stuff-and-things/</feedburner:origLink></item>
		<item>
		<title>Broken Samsung 22″ Display</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/-y11ZPfu7EM/</link>
		<comments>http://ziga.hamsworld.net/2010/09/09/broken-samsung-22-display/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 18:18:53 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[broken]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[lcd]]></category>
		<category><![CDATA[Samsung]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/?p=92</guid>
		<description><![CDATA[This story is way shorter, and not so educational, as the Asus EEE one, but it does suggest that I&#8217;m not lucky with any lcd displays &#8211; big or small. So I had this Samsung 226BW display and it was great up until the day it decided that it had it, and that it won&#8217;t [...]]]></description>
				<content:encoded><![CDATA[<p>This story is way shorter, and not so educational, as the <a href="http://ziga.hamsworld.net/2009/12/07/replacing-lcd-on-asus-eee-100h/">Asus EEE one</a>, but it does suggest that I&#8217;m not lucky with any lcd displays &#8211; big or small.</p>
<p>So I had this<a href="http://www.mimovrste.com/katalog/product.php?product_id=2650024120"> Samsung 226BW display</a> and it was great up until the day it decided that it had it, and that it won&#8217;t display my video anymore  (black screen &#8211; not even the detecting signal thingy was there).<br />
So I opened it&#8230;<br />
<a href="http://ziga.hamsworld.net/uploads/2010/09/IMG_1550.jpg" rel="lightbox[92]"><img class="alignnone size-medium wp-image-96" title="Samsung Display 1" src="/uploads/2010/09/IMG_1550-300x225.jpg" alt="" width="300" height="225" /></a><br />
&#8230;figured out I don&#8217;t know much about electronics&#8230;<br />
<a href="http://ziga.hamsworld.net/uploads/2010/09/IMG_1554.jpg" rel="lightbox[92]"><img class="alignnone size-medium wp-image-95" title="Samsung Display 2" src="/uploads/2010/09/IMG_1554-300x225.jpg" alt="" width="300" height="225" /></a><br />
&#8230;and bought a new one (<a href="http://www.mimovrste.com/artikel/2650087533/monitor-lcd-24-philips-241e1sb-e-line">Philips 241E1SB E-Line</a>).<br />
<a href="http://ziga.hamsworld.net/uploads/2010/09/IMG_1556.jpg" rel="lightbox[92]"><img class="alignnone size-medium wp-image-97" title="Philips Display" src="/uploads/2010/09/IMG_1556-300x225.jpg" alt="" width="300" height="225" /></a></p>
<p>Maybe replacing the power supply would work, but I don&#8217;t know. New power supply from China would cost 30€.</p>
<p>Now I&#8217;m off to watching some full HD animes (It sure gonna feel different on full HD resolution compared to 1680&#215;1050 &#8211; before you start commenting know that this was sarcasm) <img src='http://ziga.hamsworld.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
The main thing is that I can work, chat, browse, tweet, etc. at the same time again without going crazy.</p>
<p>p.s. There was some sticker saying something like &#8220;compatible with win 7&#8243;, but I have no idea what happed to it <img src='http://ziga.hamsworld.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/-y11ZPfu7EM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2010/09/09/broken-samsung-22-display/feed/</wfw:commentRss>
		<slash:comments>257</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2010/09/09/broken-samsung-22-display/</feedburner:origLink></item>
		<item>
		<title>APE-Project How To: Build Server-Side Module in C to use with Javascript</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/jKn_y5xM5Mg/</link>
		<comments>http://ziga.hamsworld.net/2010/04/27/ape-project-how-to-build-server-side-module-in-c-to-use-with-javascript/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 18:42:16 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[APE-Project]]></category>
		<category><![CDATA[Memcached]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/?p=50</guid>
		<description><![CDATA[Building a server-side javascript module is documented here (http://www.ape-project.org/wiki/index.php/How_to_create_a_server_Module), while building server-side modules in C is considered deprecated or at least not the best idea (it is not documented at all!). Programing in javascript is all fancy and stuff, but what are you supposed to do if you need Postgres, Memcached or something like that? [...]]]></description>
				<content:encoded><![CDATA[<p>Building a server-side javascript module is documented here (<a href="http://www.ape-project.org/wiki/index.php/How_to_create_a_server_Module">http://www.ape-project.org/wiki/index.php/How_to_create_a_server_Module</a>), while building server-side modules in C is considered deprecated or at least not the best idea (it is not documented at all!). Programing in javascript is all fancy and stuff, but what are you supposed to do if you need <a class="zem_slink" title="PostgreSQL" rel="homepage" href="http://www.postgresql.org/">Postgres</a>, <a class="zem_slink" title="Memcached" rel="homepage" href="http://www.memcached.org/">Memcached</a> or something like that? For C (and C++) there is tons of libraries available, APE-Project is based on C, so maybe we could do something about that. Read on if you&#8217;re interested.</p>
<p><span id="more-50"></span></p>
<p>We are going to make a javascript (mootools) class in C, like for example mysql class that is already there. For this example I&#8217;m going to create &#8220;Memcached&#8221; class.</p>
<p>First we need some structures:</p>
<div id="_mcePaste">
<div id="_mcePaste">
<pre class="brush: cpp; title: ; notranslate">struct _ape_memcached_data {
	memcached_st *server;
	JSObject *jsmemcached;
	JSContext *cx;
};
static JSClass memcached_class = {
	&quot;Memcached&quot;, JSCLASS_HAS_PRIVATE,
	    JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
	    JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
	    JSCLASS_NO_OPTIONAL_MEMBERS
};
static JSFunctionSpec apememcached_funcs[] = {
	JS_FS(&quot;get&quot;, apememcached_sm_get, 2, 0, 0),
	JS_FS_END
};
static JSFunctionSpec apememcached_funcs_static[] = {
	JS_FS_END
};</pre>
<p>We also need the actual functions that are going to be called from javascript:</p>
</div>
</div>
<pre class="brush: cpp; title: ; notranslate">APE_JS_NATIVE(ape_sm_memcached_constructor)
//{
	char *host;
	int port;

	struct _ape_memcached_data *myhandle;

	if (!JS_ConvertArguments(cx, argc, argv, &quot;si&quot;, &amp;host, &amp;port)) {
		return JS_TRUE;
	}

	myhandle = xmalloc(sizeof(*myhandle));

	memcached_st *server = memcached_create(NULL);
	memcached_server_add (server, host, port);

	myhandle-&gt;server = server;
	myhandle-&gt;jsmemcached = obj;
	myhandle-&gt;cx = cx;

	JS_SetPrivate(cx, obj, myhandle);

	return JS_TRUE;
}
APE_JS_NATIVE(apememcached_sm_get)
//{
	JSString *query;
	struct _ape_memcached_data *myhandle;
	jsval callback;

	if ((myhandle = JS_GetPrivate(cx, obj)) == NULL) {
		return JS_TRUE;
	}

	if (!JS_ConvertArguments(cx, 1, argv, &quot;S&quot;, &amp;query)) {
		return JS_TRUE;
	}

	size_t value_length;
	uint32_t flags;
	memcached_return_t error;

	char *value = memcached_get(myhandle-&gt;server, JS_GetStringBytes(query), JS_GetStringLength(query), &amp;value_length, &amp;flags, &amp;error);

	*rval = STRING_TO_JSVAL(JS_NewStringCopyN(cx, value, value_length));

	free(value);

	return JS_TRUE;
}</pre>
<p>Finally, we need to link this together. You need to find function called &#8220;ape_sm_define_ape&#8221; and add this:</p>
<pre class="brush: cpp; title: ; notranslate">JSObject *jsmemcached;
jsmemcached = JS_InitClass(asc-&gt;cx, obj, NULL, &amp;memcached_class, ape_sm_memcached_constructor, 2, NULL, NULL, NULL, apememcached_funcs_static);
JS_DefineFunctions(asc-&gt;cx, jsmemcached, apememcached_funcs);</pre>
<p>In your javascript code, you can use the newly created class like this:</p>
<pre class="brush: jscript; title: ; notranslate">var cache = new Ape.Memcached(&quot;localhost&quot;, 11211);
cache.get('test');</pre>
<p>Thats all, I&#8217;m sorry for the lack of explanation.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/fbfad708-56bf-471f-8f71-79845ab92bcf/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=fbfad708-56bf-471f-8f71-79845ab92bcf" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/jKn_y5xM5Mg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2010/04/27/ape-project-how-to-build-server-side-module-in-c-to-use-with-javascript/feed/</wfw:commentRss>
		<slash:comments>1706</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2010/04/27/ape-project-how-to-build-server-side-module-in-c-to-use-with-javascript/</feedburner:origLink></item>
		<item>
		<title>Reboot to Windows shortcut for Ubuntu 9.10+ (Grub 2)</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/HAKbJh8Shf8/</link>
		<comments>http://ziga.hamsworld.net/2010/03/26/reboot-to-windows-shortcut-for-ubuntu-9-10-grub-2/#comments</comments>
		<pubDate>Fri, 26 Mar 2010 13:27:01 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[Boot loader]]></category>
		<category><![CDATA[GNOME]]></category>
		<category><![CDATA[Grub 2]]></category>
		<category><![CDATA[Operating Systems]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/?p=33</guid>
		<description><![CDATA[If you&#8217;re dual booting Ubuntu and Windows, a simple shortcut &#8220;reboot to windows&#8221; might come in handy, so you don&#8217;t have to stare at the screen waiting for the boot loader to show up. This shortcut sets Windows as default grub option only for one reboot, so next time you start up the pc or [...]]]></description>
				<content:encoded><![CDATA[<p>If you&#8217;re dual booting <a class="zem_slink" title="Ubuntu (operating system)" rel="homepage" href="http://www.ubuntu.com/">Ubuntu</a> and <a class="zem_slink" title="Windows" rel="homepage" href="http://www.microsoft.com/WINDOWS">Windows</a>, a simple shortcut &#8220;reboot to windows&#8221; might come in handy, so you don&#8217;t have to stare at the screen waiting for the <a class="zem_slink" title="Booting" rel="wikipedia" href="http://en.wikipedia.org/wiki/Booting">boot loader</a> to show up.</p>
<p>This shortcut sets Windows as default grub option only for one reboot, so next time you start up the pc or reboot it from windows the default is back to Ubuntu.</p>
<p>Step By Step:<br />
1. Open terminal (Applications -&gt; Accessories -&gt; Terminal)<br />
2. Type &#8220;sudo <a class="zem_slink" title="Gedit" rel="homepage" href="http://www.gnome.org/projects/gedit/">gedit</a> /etc/default/grub&#8221; and hit return<br />
3. Change &#8220;GRUB_DEFAULT=0&#8243; (or whatever the value is) to &#8220;GRUB_DEFAULT=saved&#8221; (you might also want to lower the GRUB_TIMEOUT value)<br />
4. Save &amp; Close gedit<br />
5. Type &#8220;gedit ~/win-reboot.sh&#8221; and paste the following code into gedit (change &#8221;Windows 7 (loader) (on /dev/sda1)&#8221;  to the name or number of your Windows option in grub, you can check that by serching for windows keyword in /boot/grub/grub.cfg)</p>
<pre class="brush: bash; title: ; notranslate">#!/bin/bash
grub-reboot &quot;Windows 7 (loader) (on /dev/sda1)&quot;
reboot</pre>
<p>6. Save &amp; Close gedit<br />
7. Type &#8220;chmod +x ~/win-reboot.sh&#8221; to allow execution of this file<br />
8. Type &#8220;sudo update-grub&#8221; to apply changes to grub configuration<br />
9. Type exit or hit Ctrl+D to close the terminal</p>
<p>&#8211;If you are using <a class="zem_slink" title="GNOME" rel="homepage" href="http://www.gnome.org/">Gnome</a> (default Ubuntu desktop) you can proceed to step 9 to create the shortcut, but ~/win-reboot.sh should work already&#8211;<br />
10. Right click on a <a title="Gnome-panel" rel="homepage" href="http://en.wikipedia.org/wiki/Gnome-panel">gnome panel</a> and select &#8220;Add to panel&#8221;<br />
11. Select &#8220;Custom Application Launcher&#8221; and click &#8220;Add&#8221;<br />
12.  Fill out the form like this (replace &#8220;/home/ziga/&#8221; with your <a class="zem_slink" title="Home directory" rel="wikipedia" href="http://en.wikipedia.org/wiki/Home_directory">home directory</a>, you can find that out by opening terminal and typing &#8220;cd;pwd&#8221;):</p>
<p><a href="http://ziga.hamsworld.net/uploads/2010/03/Screenshot-Launcher-Properties.png" rel="lightbox[33]"><img class="alignnone size-medium wp-image-35" title="Windows Reboot Launcher Properties" src="http://ziga.hamsworld.net/uploads/2010/03/Screenshot-Launcher-Properties-300x114.png" alt="Windows Reboot Launcher Properties" width="300" height="114" /></a><br />
13. Click the shortcut, type your password and let it work</p>
<p>Please comment if you encounter any problems or have any additional questions.</p>
<p>EDIT (Thanks to Arttu): added update-grub step and changed the script to use grub-reboot</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">#!/bin/bash</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">grub-set-default &#8220;Windows 7 (loader) (on /dev/sda1)&#8221;</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">sed -i s/&#8217;${chosen}&#8217;/0/g /boot/grub/grub.cfg</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">reboot</div>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=9e7d32f9-10f1-45d2-b7cf-2fbdf40ff9a7" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/HAKbJh8Shf8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2010/03/26/reboot-to-windows-shortcut-for-ubuntu-9-10-grub-2/feed/</wfw:commentRss>
		<slash:comments>475</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2010/03/26/reboot-to-windows-shortcut-for-ubuntu-9-10-grub-2/</feedburner:origLink></item>
		<item>
		<title>Replacing LCD on Asus Eee 1000H</title>
		<link>http://feedproxy.google.com/~r/zigaham/~3/ZxfVNqDUzIU/</link>
		<comments>http://ziga.hamsworld.net/2009/12/07/replacing-lcd-on-asus-eee-100h/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 22:04:31 +0000</pubDate>
		<dc:creator>hamax</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[eee]]></category>
		<category><![CDATA[lcd]]></category>

		<guid isPermaLink="false">http://ziga.hamsworld.net/wordpress/?p=4</guid>
		<description><![CDATA[Yeah, I broke my eee&#8217;s lcd -.- hardware yay&#8230; not I&#8217;ve ordered one from ebay two weeks ago and got it today. They&#8217;ve charged me extra 17€ for vat and some other unknown expenses &#62;.&#60; But anyway, here it is: Next step, of course, is to disassemble eee immediately! kaboom  motherboard (PCB MADE IN CHINA) Throw the [...]]]></description>
				<content:encoded><![CDATA[<p>Yeah, I broke my eee&#8217;s lcd -.- hardware yay&#8230; not <img src='http://ziga.hamsworld.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>I&#8217;ve ordered one from <a href="http://cgi.ebay.com/10-LCD-Screen-ASUS-Eee-PC-1000-1000H-1000HD-1000HA_W0QQitemZ360183597171QQcmdZViewItemQQptZLH_DefaultDomain_0?hash=item53dc9d8873#ht_4964wt_1165" target="_blank">ebay</a> two weeks ago and got it today. They&#8217;ve charged me extra 17€ for vat and some other unknown expenses &gt;.&lt; But anyway, here it is:</p>
<p><a href="http://ziga.hamsworld.net/uploads/2009/12/IMG_1051-1024x768.jpg" rel="lightbox[4]"><img class="alignnone size-medium wp-image-7" title="eee - new lcd" src="http://ziga.hamsworld.net/uploads/2009/12/IMG_1051-300x225.jpg" alt="eee - new lcd" width="300" height="225" /></a></p>
<p>Next step, of course, is to disassemble eee immediately!</p>
<p><a href="http://ziga.hamsworld.net/uploads/2009/12/IMG_1055-Copy-1024x553.jpg" rel="lightbox[4]"><img class="alignnone size-medium wp-image-8" title="eee - boom" src="http://ziga.hamsworld.net/uploads/2009/12/IMG_1055-Copy-300x162.jpg" alt="eee - boom" width="300" height="162" /></a>kaboom <a href="http://ziga.hamsworld.net/uploads/2009/12/IMG_1047-1024x768.jpg" rel="lightbox[4]"><img class="alignnone size-medium wp-image-3" title="eee - motherboard" src="http://ziga.hamsworld.net/uploads/2009/12/IMG_1047-300x225.jpg" alt="eee - motherboard" width="300" height="225" /></a> motherboard (PCB MADE IN CHINA)</p>
<p>Throw the old lcd away, connect the new one&#8230; and&#8230;</p>
<p><a href="http://ziga.hamsworld.net/uploads/2009/12/IMG_1061-1024x768.jpg" rel="lightbox[4]"><img class="alignnone size-medium wp-image-9" title="eee - too big" src="http://ziga.hamsworld.net/uploads/2009/12/IMG_1061-300x225.jpg" alt="eee - too big" width="300" height="225" /></a> this lid is too small!!! <a href="http://ziga.hamsworld.net/uploads/2009/12/IMG_1063-1024x768.jpg" rel="lightbox[4]"><img class="alignnone size-medium wp-image-10" title="eee - yay" src="http://ziga.hamsworld.net/uploads/2009/12/IMG_1063-300x225.jpg" alt="eee - yay" width="300" height="225" /></a> false alarm <img src='http://ziga.hamsworld.net/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>And thats all. Pretty simple. Just connect the keyboard back with fancy connectors, screw back some screws&#8230;</p>
<p><a href="http://ziga.hamsworld.net/uploads/2009/12/IMG_1065-1024x986.jpg" rel="lightbox[4]"><img class="alignnone size-medium wp-image-11" title="eee - final" src="http://ziga.hamsworld.net/uploads/2009/12/IMG_1065-300x288.jpg" alt="eee - final" width="300" height="288" /></a> whoa, looks like eee again (got keyboard working in 2nd try)</p>
<p>Now I only hope that this one will stay in one piece for a while (current record is less than 1 year).</p>
<img src="http://feeds.feedburner.com/~r/zigaham/~4/ZxfVNqDUzIU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://ziga.hamsworld.net/2009/12/07/replacing-lcd-on-asus-eee-100h/feed/</wfw:commentRss>
		<slash:comments>898</slash:comments>
		<feedburner:origLink>http://ziga.hamsworld.net/2009/12/07/replacing-lcd-on-asus-eee-100h/</feedburner:origLink></item>
	</channel>
</rss>
