<?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>Péter Molnár Portfolio &#38; Blog &#187; linux, tech, coding</title>
	<atom:link href="http://petermolnar.eu/linux-tech-coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://petermolnar.eu</link>
	<description></description>
	<lastBuildDate>Tue, 08 May 2012 18:52:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>String interchange between C# to and ANSI C DLL</title>
		<link>http://petermolnar.eu/linux-tech-coding/interfacing-c-with-c/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/interfacing-c-with-c/#comments</comments>
		<pubDate>Tue, 08 May 2012 07:30:51 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2801</guid>
		<description><![CDATA[<p>How to send and receive a string between C# and C.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/interfacing-c-with-c/">String interchange between C# to and ANSI C DLL</a></p></p>]]></description>
			<content:encoded><![CDATA[<p>Recently we had some problems interfacing a C# code with a C ( especially MinGW ) DLL. The main problem was that we needed to interchange strings, send ans received from both directions.</p>
<h2>Sending a registry entry from C# to C</h2>
<p><pre class="hljs"><code class="cs">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
namespace CODE
{
    public unsafe class Connector
    {
        private string PathKey = "Path";
        // needs to be constant...
        private const string PathToCDLL = @"C:\path\to\c\dll"; 
        public void InitPath()
        {
            string Path = new Globals().getRegistryEntry(this.PathKey);
            // string characters are 2 bytes long in C#, C needs 1 byte chars:
            System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
            Byte[] path = encoding.GetBytes( Path );
            init_path_c(path);
        }
        [DllImport(PathToCDLL, EntryPoint = "init_path", ExactSpelling = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        private static extern void init_path_c([MarshalAs(UnmanagedType.LPArray)] byte[] Path );
    }
}</code></pre><br />
<pre class="hljs"><code class="cpp">char* global_path;
void init_path( char* path )
{
  global_path = path;
}</code></pre></p>
<h2>Receicing a string in C# from C</h2>
<p><pre class="hljs"><code class="cs">using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using System.Threading;
namespace CODE
{
    public unsafe class Connector
    {
        public string getCString()
        {
            IntPtr strPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(int)));
            get_c_string(strPtr);
            return Marshal.PtrToStringAnsi(strPtr);
        }
        [DllImport(PathToCDLL, EntryPoint = "c_string", ExactSpelling = true, CharSet = CharSet.Ansi, CallingConvention = CallingConvention.Cdecl)]
        private static extern void get_c_string( IntPtr Path );
    }
}</code></pre><br />
<pre class="hljs"><code class="cpp">#include &lt;string.h&gt;
void c_string( char* path )
{
  char* str = "This is a test string";
  strcpy ( path, str );
}</code></pre></p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/interfacing-c-with-c/">String interchange between C# to and ANSI C DLL</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/interfacing-c-with-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make Ubuntu 12.04 LTS ( Precise Pangolin) usable</title>
		<link>http://petermolnar.eu/linux-tech-coding/how-to-make-ubuntu-12-04-lts-precise-pangolin-usable/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/how-to-make-ubuntu-12-04-lts-precise-pangolin-usable/#comments</comments>
		<pubDate>Fri, 04 May 2012 14:30:42 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[aircrack-ng]]></category>
		<category><![CDATA[Cinnamon desktop]]></category>
		<category><![CDATA[gnome-panel]]></category>
		<category><![CDATA[ThinkPad]]></category>
		<category><![CDATA[tp-smapi]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 12.04]]></category>
		<category><![CDATA[Ubuntu Precise Pangolin]]></category>
		<category><![CDATA[Unity]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2767</guid>
		<description><![CDATA[<p>Ubuntu 12.04 Precise(?) Pangolin
Tweaks after install in order to achieve the usability of Linux Mint 10, Julia, one of the last good Gnome2 based distributions.

But the new mascot is pretty cute.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/how-to-make-ubuntu-12-04-lts-precise-pangolin-usable/">How to make Ubuntu 12.04 LTS ( Precise Pangolin) usable</a></p></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://petermolnar.eu/files/2012/05/precise_pangolin_240x320.jpg"><img class="alignleft size-medium wp-image-2775" title="Ubuntu Precise Pangolin background featuring a cute pangolin" src="http://petermolnar.eu/files/2012/05/precise_pangolin_240x320-225x300.jpg" alt="" width="225" height="300" /></a><br />
I&#8217;ve started using Ubuntu on servers from version <a href="http://old-releases.ubuntu.com/releases/6.06/">6.06</a> and I still say, for server, it&#8217;s one of the best and most easily maintainable distributions out there &#8211; not mention the commercial support behind the system. On the desktop side however&#8230; from 9.04 to 10.04 Ubuntu was a good choice. Afterwards I&#8217;ve migrated to <a href="http://linuxmint.com">Linux Mint</a>, especially to<a href="http://www.linuxmint.com/release.php?id=15"> Mint 10, Julia</a> &#8211; I have to say that version was probably the best I&#8217;ve encountered with.</p>
<p>But time has passed and unfortunately, Mint 10 was not a long term support version and it&#8217;s official lifespan has ended. Also, it&#8217;s quite impossible to install <a href="http://www.webupd8.org/2012/05/gimp-28-stable-finally-available-for.html">the freshly released Gimp 2.8</a> on a 1,5 old system &#8211; <em>which is actually ridiculous and sad, but true</em> &#8211; so I needed to change. Ubuntu 11.04 and 11.10 was a total mess, mostly with the premature Unity and the forced kernel updates. <em>Between 2.6.36 and 3.2 there shouldn&#8217;t have been any update in my opinion</em>.</p>
<p><a href="http://www.linuxmint.com/release.php?id=17">Mint 12</a> &#8211; based on Ubuntu 11.10 &#8211; was near to useable with <a href="http://cinnamon.linuxmint.com">Cinnamon</a>: lots of version problems, PPA not recognizing the version, etc., so right after the release of the next long-term-support Ubuntu, I decided to move back AND have the Mint desktop Cinnamon on it.</p>
<p><a href="http://releases.ubuntu.com/releases/12.04/">12.04 LTS ( Precise Pangolin )</a> comes with <a href="http://unity.ubuntu.com/">Unity</a>. Unity is progressive and has a lot of ideas in it, unfortunately most of them just renders things unuseable for everyday work. It&#8217;s fun, yes, it&#8217;s nice and pretty and everything, but for someone using a linux desktop professionally, it&#8217;s simply ineffective.</p>
<h2>Fail at install: encrypt home without swap partition</h2>
<p>I have 4 GB memory in my notebook; it has been enough for years without swap. Even if I&#8217;m in the need of swap, I would not add it as partition just a simple file using `swapon` command. But&#8230; 12.04 requires a swap partition if you want your home folder encrypted &#8211; otherwise the whole install process will fail. Isn&#8217;t that nice from a version that&#8217;s planned for 5 years?! I&#8217;ve installed the system without encrypted home, and followed <a href="http://www.makeuseof.com/tag/author/danny/">Danny Stieben</a>&#8216;s <a href="http://www.makeuseof.com/tag/encrypt-home-folder-ubuntu-installation-linux/">guide how to encrypt it on an installed system</a>.</p>
<p>Yes, <a href="https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/991139">it&#8217;s already been reported</a>.</p>
<h2>Conquer your desktop once again</h2>
<p>Two possibilities to get a desktop like the good&#8217;ol Gnome2: `gnome-panel` ( a rearranged Gnome3 fallback mode) or Cinnamon. Both provides conventional desktops, meaning you do have a window list, screen is not jumpig on the move of your mouse, you can actually find the close button for a software ( <em>Not app. Program or software.</em>)</p>
<h3>gnome-panel</h3>
<p><a href="http://petermolnar.eu/files/2012/05/gnome-fallback.jpg"><img class="size-medium wp-image-2790 alignright" title="gnome-fallback" src="http://petermolnar.eu/files/2012/05/gnome-fallback-300x200.jpg" alt="" width="300" height="200" /></a>Gnome2 layout based on GTK3. Most of the functions are backward-compatible, meaning you can have applets again. For more information, see <a href="http://www.omgubuntu.co.uk/2012/03/gnome-classic-in-ubuntu-12-04-its-like-nothing-ever-changed/">the OMG! Ubuntu! article on gnome-panel</a>. It&#8217;s simple to install:</p>
<pre class="hljs"><code class="bash">apt-get install gnome-panel</code></pre>
<h3></h3>
<h3></h3>
<h3></h3>
<h3>Cinnamon desktop</h3>
<p><a href="http://petermolnar.eu/files/2012/05/cinnamon-dektop.png"><img class="alignright size-medium wp-image-2789" title="cinnamon-dektop" src="http://petermolnar.eu/files/2012/05/cinnamon-dektop-300x168.png" alt="" width="300" height="168" /></a><a href="http://cinnamon.linuxmint.com">Cinnamon</a> is the Linux Mint way to enlightenment: a GTK3, especiall Gnome Shell based desktop environment with traditional layout. It&#8217;s at version 1.4, lacks a lot of features, but it&#8217;s nice, fast, responsive and suprisingly low on CPU &amp; memory usage. It&#8217;s not the part of Ubuntu, so you&#8217;re going to need to add an additional repository.</p>
<pre class="hljs"><code class="bash">add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
apt-get update
apt-get install cinnamon</code></pre>
<p>I needed a dock in order to get this fully functional ( the lack of CPU applet for example ), my choose was <a href="https://launchpad.net/awn/">Avant Window Navigator</a>.</p>
<pre class="hljs"><code class="bash">apt-get install avant-window-navigator</code></pre>
<h2>The for people who use their machine both day and night</h2>
<p>I hate high contrast themes. Really. They are for vanilla people, using their pretty little machine only by day. For Gnome2 the choice was <a href="http://gnome-look.org/content/show.php/Shiki-Colors?content=86717">Shiki Colors</a>, especially Shiki Brave &#8211; a more-or-less replacement for GTK3 is <a href="http://lassekongo83.deviantart.com/art/Zukitwo-203936861">Zukitwo</a>.</p>
<h2>ThinkPad users: tp-smapi-dkms</h2>
<p>Even in 11.04, tp-smapi install was plain simple, working right after the apt-get install command. Not from 11.10; tp-smapi-dkms moved from version 0.40 to version 0.41 and thus not working anymore. <a href="http://packages.ubuntu.com/natty/all/tp-smapi-dkms/download">Get the package from Natty</a>, and install it by hand. Extract it to `/usr/src/` ( as `/usr/src/tp-smapi-0.40` ), and use the following:</p>
<pre class="hljs"><code class="bash">dkms add -m tp-smapi -v 0.40
dkms build -m tp-smapi -v 0.40
dkms install -m tp-smapi -v 0.40</code></pre>
<h2>Regain aircrack-ng</h2>
<p>These are my favourite ones: a slight but, it&#8217;s not maintaned, so it gets dropped. And oh, no alternatives. Anyway, <a title="author profile" href="http://www.blogger.com/profile/10553011445419057597" rel="author">Riyaz Ahemed Walikar</a> has written <a href="http://www.riyazwalikar.com/2010/12/installing-aircrack-ng-on-ubuntu-1204.html">a post on gettin aircrack work in Precise Pangolin</a>.</p>
<pre class="hljs"><code class="bash">apt-get install build-essential libssl-dev
wget http://download.aircrack-ng.org/aircrack-ng-1.1.tar.gz
tar -zxvf aircrack-ng-1.1.tar.gz
cd aircrack-ng-1.1</code></pre>
<p>Replace the line<br />
<pre class="hljs"><code class="c">CFLAGS ?= -g -W -Wall -Werror -O3</code></pre><br />
to:<br />
<pre class="hljs"><code class="c">CFLAGS ?= -g -W -Wall -O3</code></pre></p>
<p>in `common.mak`. Then<br />
<pre class="hljs"><code class="bash">make &amp;&amp; make install</code></pre></p>
<h2>From now on&#8230;</h2>
<p>I&#8217;m going to extend this post whenever I encounter something strange.</p>
<h2><ins datetime="2012-05-07-T11:00:00GMT">&#8220;Loggin in&#8230;&#8221; freeze in lightdm</ins></h2>
<p><a href="https://bugs.launchpad.net/unity-greeter/+bug/986967">Caused by disabling the login sound</a> with <a href="http://ubuntu-tweak.com">Ubuntu Tweak</a>. Either replace lightdm with gdm or don&#8217;t disable the logon sound.</p>
<h2><ins datetime="2012-05-08-T18:51:00GMT">Wireless semi-disconnecting</ins></h2>
<p>The connection itself stays but no data flows in any direction. Solution by <a href="https://plus.google.com/106676640127767267723/about">Sam Armstrong</a>:<br />
<pre class="hljs"><code class="bash">sudo iwconfig wlan0 power off</code></pre></p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/how-to-make-ubuntu-12-04-lts-precise-pangolin-usable/">How to make Ubuntu 12.04 LTS ( Precise Pangolin) usable</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/how-to-make-ubuntu-12-04-lts-precise-pangolin-usable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTC Desire (Bravo): ROMs, updates, pain and suffering</title>
		<link>http://petermolnar.eu/linux-tech-coding/htc-desire-bravo-roms-updates-pain-and-suffering/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/htc-desire-bravo-roms-updates-pain-and-suffering/#comments</comments>
		<pubDate>Thu, 19 Apr 2012 07:38:40 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[ClockworkMod]]></category>
		<category><![CDATA[CyanogenMod]]></category>
		<category><![CDATA[fastboot]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[HTC Desire]]></category>
		<category><![CDATA[Revolutionary]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2747</guid>
		<description><![CDATA[<p>Replacing the ROM of a HTC Desire; notes for myself if I'd ever want to do this again.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/htc-desire-bravo-roms-updates-pain-and-suffering/">HTC Desire (Bravo): ROMs, updates, pain and suffering</a></p></p>]]></description>
			<content:encoded><![CDATA[<p><em>Prelude: I currently work as an embedded developer, I learnt as one, I even got my degree on embedded systems &#8211; and flashing Android devices are far more complicated than I&#8217;ve ever thought.</em><em> Unless you do really have a reason, don&#8217;t do custom ROM upgrades.</em></p>
<h2 style="text-align: left;"><em></em>Only do this if you have TIME , PATIENCE and another phone with you.<br />
Also&#8230; this is not a tutorial. This is only a collection of links, tweaks troubleshoot methods, mostly for myself.<br />
I don&#8217;t say this is going to work. If you do anything to your phone, you&#8217;re on your own, no one to be blamed, so be aware.</h2>
<h2 style="text-align: left;">Why?</h2>
<p><a href="http://petermolnar.eu/files/2012/04/HTC-Desire-Bravo-Android-MWC-official.jpg"><img class="alignleft size-medium wp-image-2758" title="HTC-Desire-Bravo-Android-MWC-official" src="http://petermolnar.eu/files/2012/04/HTC-Desire-Bravo-Android-MWC-official-300x260.jpg" alt="" width="300" height="260" /></a></p>
<p>1 GHz, 576 MB RAM, has more RAM than a usual laptop 5 years ago, but 512MB flash and 150 MB for user is bloat.</p>
<p>Also there are no official, recommended, stable updates for HTC Desire GSM (Bravo) after Android 2.2. They released <a href="http://shipped-roms.com/download.php?category=android&amp;model=Bravo&amp;file=HTC_Desire_Android_2.3_Upgrade.zip">a semi-official  2.3 update</a>: only for experienced<br />
users &#8211; I&#8217;ve tried it after a custom ROM, it did not connect to wireless networks, I could not even start a call.</p>
<p>Another reason is that you want to replace the shipped apps, like I did. Sometimes there are far better applications out there than the stock ones &#8211; sometimes.</p>
<h2></h2>
<h2>Why not?</h2>
<p><strong>Because something will definately go wrong, no exception</strong>. <del>For me, it seems I cannot connect USB Mass Storage anymore, no idea why. ( I&#8217;ve tried it both in linux and Windows.)</del></p>
<h2></h2>
<h2 style="text-align: center;">Do not forget to make backups. Always.<br />
<em>And always verify them; belief is not enough.<br />
ClockwordMod backups DO CAN FAIL. </em></h2>
<h2></h2>
<h2>What you need to understand</h2>
<p>The system of an Android phone is made up of a lot .img files. These are byte-by-byte copies of the affs2 filesystems used in embedded devices. My HTC &#8211; and probably your device too &#8211; has the following parts:</p>
<dl>
<dt>bootloader</dt>
<dd>Don&#8217;t touch this by hand. If you make a bad move, the phone can only be restored by hardware hacks, and you really don&#8217;t want to do this. Use  <a href="http://revolutionary.io/">Revolutionary</a>, this will unlock the features of the bootloader (S-OFF), for example, fastboot via USB.</dd>
<dt>recovery (recovery.img) </dt>
<dd>This the &#8220;backup&#8221; system; an alternative small system you can boot into <del> to save the day</del> and modify the base system. This system is usually replaced with <a href="http://android-dls.com/wiki/index.php?title=Amon_Ra_recovery_tool">Amon_Ra</a> or <a href="http://download.clockworkmod.com/recoveries/">ClockworkMod</a>. Revolutionary installs ClockworkMod automatically.</dd>
<dt>boot (boot.img)</dt>
<dd>Loads the main kernel and the system itself. Do not confuse with bootloader: bootloader loads the boot image.</dd>
<dt>system (system.img)</dt>
<dd>This is your system, the root partition if it sounds better. <em>Clockwordmod says it makes a yaffs2 backup, but that&#8217;s not fully true: it dd-s the filesystem, while it should be cat-ed.</em></dd>
<dt>data (data.img)</dt>
<dd>User data; something between /var and /home.</dd>
<dt>cache (cache.img)</dt>
<dd>Cache. Not important.</dd>
</dl>
<h2>Tools &amp; resources</h2>
<ul>
<li><a href="http://revolutionary.io/">Revolutionary</a><br />
Makes things possible.</li>
<li><a href="http://htcdev.com/">HTC developer portal</a><br />
You can access the kernel source, but that&#8217;s only for really hardcore fans.</li>
<li><a href="http://shipped-roms.com">shipped-roms.com</a><br />
When you reach the point of crying, this is really handy: they are collecting the original stock roms and installers.</li>
<li><a href="http://petermolnar.eu/htc//2.10.405.5-initd-rooted-stock-v3_1.zip">original HTC Desire system rooted as .zip update</a> ( 2.10.405.5 )<br />
Origins from <a href="http://www.brutzelstube.de/2011/gerootetes-offizieles-htc-stock-rom-2-29-405-5-mit-addons/">a german forum</a>.</li>
</ul>
<h3>Custom ROMs</h3>
<ul>
<li><a href="http://www.cyanogenmod.com/">cyanogen</a><br />
One of the most commonly used custom ROMs: fast, easy to use, quite stable, but has some serious bugs, like the Sleep of Death. Anyway, <a href="http://wiki.cyanogenmod.com">their wiki is a life-saver</a>.</li>
<li><del><a href="http://leedroid.com/">LeeDroid</a></del><br />
<del> Some say the best ROM in the jungle; for me, it only threw errors over errors.</del></li>
</ul>
<div>I&#8217;ve tried some others, but without success, they were stucked at a <a href="http://wiki.cyanogenmod.com/wiki/Troubleshooting#Bootloop_problem">bootloop</a>, and nothing helped at all.</div>
<h2>Lifesavers</h2>
<ul>
<li><a href="http://developer.android.com/guide/developing/tools/adb.html">adb</a><br />
This is part of all android systems: imagine it as a backdoor telnet to Android core. It can be used with USB ( default ) or via <a href="http://stackoverflow.com/questions/2604727/how-can-i-connect-to-android-with-adb-over-tcp">WLAN</a>, this probably needs a rooted phone and a Terminal Emulator installed. adb can be installed as part of <a href="http://developer.android.com/sdk/index.html">Android SDK</a>.<br />
Also: <a href="http://jonwestfall.com/2009/08/backup-restore-android-apps-using-adb/">http://jonwestfall.com/2009/08/backup-restore-android-apps-using-adb/</a></li>
<li><a href="http://en.wikipedia.org/wiki/Fastboot">fastboot</a><br />
In short, fastboot is the interface to connect your computer to the bootloader via USB. It can re-flash any part of the system except the bootloader itself.<br />
To see all fastboot oem commands type: `fastboot oem ?`</li>
</ul>
<h2>Hacking</h2>
<h3>Step 1: <a href="http://revolutionary.io/">Revolutionary</a></h3>
<p>This is the only step without any danger, except you will lose warranty. Do as the site says; no tricks.</p>
<h3>Step 2: Backup</h3>
<p><em>Boot into recovery: hold vol down + power, wait, press vol down, wait, press vol down twice, press power, wait for boot.</em></p>
<p>This was the step that went partly wrong in my case, therefore I&#8217;m currently unable to restore the stock system. The thing is that I did do the backup in Clockworkmod but after reboot, it constantly says md5 mismatch. Later I&#8217;ve found that it says this for all backups but while most of them is correct ( <a href="http://forum.xda-developers.com/showthread.php?t=976453">and can be solved by regenerating md5 hashed, as described here</a> ), though my system.img really went wrong: I&#8217;m unable to re-flash it even with fastboot.</p>
<h3>Step 3: Flash your custom ROM</h3>
<p>This is really easy. Copy the .zip file to the sdcard, boot into recovery, wipe data, wipe cache, wipe dalvik cache, and install zip. That&#8217;s all.</p>
<h3>Step 4: Wait</h3>
<p>First boot takes a long time. The Dalvik ( imagine as JVM for android ) compiles what needs to be compiled. This is stored in /data/dalvik-cache.</p>
<h2>Troubles and solvings</h2>
<h3>Recovery claims: unable to mount sdcard</h3>
<p>Get into fastboot and send the following command:</p>
<pre class="hljs"><code class="">fastboot oem enableqxdm 0</code></pre>
<h3>No USB Mass storage</h3>
<p>Something happens, but the storage doesn&#8217;t show up.</p>
<p>Get into fastboot and try:</p>
<pre class="hljs"><code class="">fastboot oem eraseconfig</code></pre>
<p>Reboot, try mounting usb. If it fails: <a href="http://forum.xda-developers.com/showthread.php?t=1143252">http://forum.xda-developers.com/showthread.php?t=1143252</a></p>
<h2>Tweaks</h2>
<h3>Remove system apps</h3>
<p><a href="http://wiki.cyanogenmod.com/wiki/Barebones">http://wiki.cyanogenmod.com/wiki/Barebones</a></p>
<h2>Restore stock ROM</h2>
<p>Follow the instructions ( Hungarian, so use G translate :) )</p>
<p><a href="http://pzoley.matraszele.hu/desire.php?p=wiki&amp;i=27">http://pzoley.matraszele.hu/desire.php?p=wiki&amp;i=27</a></p>
<p>&nbsp;</p>
<p><em>And &#8230; don&#8217;t forget to sleep. It&#8217;s important. </em></p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/htc-desire-bravo-roms-updates-pain-and-suffering/">HTC Desire (Bravo): ROMs, updates, pain and suffering</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/htc-desire-bravo-roms-updates-pain-and-suffering/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rich Text comments for WordPress 3.3</title>
		<link>http://petermolnar.eu/linux-tech-coding/rich-text-comments-for-wordpress-3-3/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/rich-text-comments-for-wordpress-3-3/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 06:40:52 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2733</guid>
		<description><![CDATA[<p>Since WordPress 3.3 replaced their Rich Text editor system the need for additional editors for comments are gone with the wind. But how to enable TinyMCE on the frontend? I&#8217;ve came across with a blog post from revood.com with a very good tip on this. You need to add the following into your theme&#8217;s `functions.php`:</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/rich-text-comments-for-wordpress-3-3/">Rich Text comments for WordPress 3.3</a></p></p>]]></description>
			<content:encoded><![CDATA[<p>Since WordPress 3.3 replaced their Rich Text editor system the need for additional editors for comments are gone with the wind.</p>
<p>But how to enable TinyMCE on the frontend? I&#8217;ve came across with <a href="http://www.revood.com/blog/tag/tinymce-wordpress-comments-box/">a blog post from revood.com with a very good tip</a> on this. You need to add the following into your theme&#8217;s `functions.php`:</p>
<pre class="hljs"><code class="php">add_filter( 'comment_form_defaults', 'custom_comment_form_defaults' );
function custom_comment_form_defaults( $args ) {
    if ( is_user_logged_in() ) {
        $mce_plugins = 'inlinepopups, fullscreen, wordpress, wplink, wpdialogs';
    } else {
        $mce_plugins = 'fullscreen, wordpress';
    }
    ob_start();
    wp_editor( '', 'comment', array(
        'media_buttons' => true,
        'teeny' => true,
        'textarea_rows' => '7',
        'tinymce' => array( 'plugins' => $mce_plugins )
    ) );
    $args['comment_field'] = ob_get_clean();
    return $args;
}</code></pre>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/rich-text-comments-for-wordpress-3-3/">Rich Text comments for WordPress 3.3</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/rich-text-comments-for-wordpress-3-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook chat from linux command line</title>
		<link>http://petermolnar.eu/linux-tech-coding/facebook-chat-from-linux-command-line/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/facebook-chat-from-linux-command-line/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 10:09:23 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[ekg2]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2703</guid>
		<description><![CDATA[<p>I met a problem I think many of my colleagues encountered with: even though Facebook is not forbidden on the company web, I do not want to use it. First, it&#8217;s not for working time (except for HR), second it&#8217;s nuclear terror on bandwidth. What I have is access to my own server, running web [...]</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/facebook-chat-from-linux-command-line/">Facebook chat from linux command line</a></p></p>]]></description>
			<content:encoded><![CDATA[<p>I met a problem I think many of my colleagues encountered with: even though Facebook is not forbidden on the company web, I do not want to use it. First, it&#8217;s  not for working time (except for HR), second it&#8217;s nuclear terror on bandwidth.</p>
<p>What I have is access to my own server, running web &#038; email services, so there&#8217;s no graphical user interface on it. Also, command line makes really small data exchange footprint which is nice when your monthly bandwidth limited to 500MBs.</p>
<p>These two thing got connected when I needed to communicate with someone on Facebook. Just some messages, but it was urgent. </p>
<p>I&#8217;ve already known for a while that Facebook chat can be accessed with <a href="http://en.wikipedia.org/wiki/Xmpp">XMPP</a> protocoll (jabber, if you&#8217;d like it more), but is there any command line xmpp chat client which does not hurt? ( Anyone remember <a href="http://en.wikipedia.org/wiki/Talk_(software)">talk</a>?  )</p>
<p>Yes, and it&#8217;s named <a href="http://ekg2.org/">EKG2</a>.</p>
<p>The needed &#8220;configuration&#8221; commands after you started ekg2:<br />
<pre class="hljs"><code class="bash">session -a xmpp:YOUR_FACEBOOK_USERNAME@chat.facebook.com
session password YOUR_FACEBOOK_PASSWORD
save
connect</code></pre></p>
<p>Your facebook username is <strong>not</strong> the e-mail you log in with. <a href="http://www.facebook.com/help/?page=151408221595144">You can read about usernames at Facebook Help.</a>.</p>
<p>When you want to start chat with someone:<br />
<pre class="hljs"><code class="bash">query "His/her name"</code></pre></p>
<p>To finish a chat, press `ALT+K`, to exit, type `quit`.</p>
<p>I know, it&#8217;s kinda pervert.</p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/facebook-chat-from-linux-command-line/">Facebook chat from linux command line</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/facebook-chat-from-linux-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google PageSpeed says: optimize your WordPress images!</title>
		<link>http://petermolnar.eu/linux-tech-coding/google-pagespeed-says-optimize-your-wordpress-images/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/google-pagespeed-says-optimize-your-wordpress-images/#comments</comments>
		<pubDate>Thu, 08 Mar 2012 09:06:18 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2500</guid>
		<description><![CDATA[<p>Optimize your images for better page load time with the help of CW Image Optimizer and littleutils.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/google-pagespeed-says-optimize-your-wordpress-images/">Google PageSpeed says: optimize your WordPress images!</a></p></p>]]></description>
			<content:encoded><![CDATA[<p>Lately I was running <a href="https://developers.google.com/pagespeed/">Google PageSpeed</a> to test my site a few dozen times and one of the strangest thing was the following suggestion:</p>
<blockquote><p>Optimize images</p>
<p>Properly formatting and compressing images can save many bytes of data.<br />
<a href="http://code.google.com/intl/hu/speed/page-speed/docs/payload.html#CompressImages">Learn more</a>
</p></blockquote>
<p>It was all over, jpg, png files mixed, all that could be reduced significantly in size! This was something I should definately had to take a look at. The jpg files were created with either imagemagick or by WordPress, so I needed an image optimization tool for both command line and as a WordPress plugin as well.</p>
<p>The solution came easily with a search, named <a href="http://wordpress.org/extend/plugins/cw-image-optimizer/">CW Image Optimizer</a>. This is a special plugin, that requires two things:</p>
<ol>
<li>a command line tool package, named `<a href="http://sourceforge.net/projects/littleutils/">littleutils</a>`</li>
<li>PHP access to command line (exec, passthru, etc.) in this case, `<a href="http://php.net/manual/en/function.exec.php">exec</a>` is needed (although in a special case, you can replace exec to something else in the plugin&#8217;s code)</li>
</ol>
<p>The plugin is capable of bulk optimization on images already uploaded to the blog and also doing and optimization on all images uploaded from now on.</p>
<p>Littleutils gives you command line utilities, named `opt-*`, where `*` means the image type. Therefore `opt-png`, `opt-jpg`, `opt-gif` are the utils to optimize the images from command line. </p>
<p>As an example:</p>
<p><pre class="hljs"><code class="bash">user@host:/wordpress-themes-dir/twentyeleven/images$ opt-png *.png
comment-arrow-bypostauthor-dark.png: unchanged
comment-arrow-bypostauthor-dark-rtl.png: unchanged
comment-arrow-bypostauthor.png: unchanged
comment-arrow-bypostauthor-rtl.png: unchanged
comment-arrow-dark.png: unchanged
comment-arrow-dark-rtl.png: unchanged
comment-arrow.png: unchanged
comment-arrow-rtl.png: unchanged
comment-bubble-dark.png: 965 vs. 762
comment-bubble-dark-rtl.png: 1868 vs. 728
comment-bubble.png: 925 vs. 775
comment-bubble-rtl.png: 1782 vs. 779
search.png: 441 vs. 436
wordpress.png: unchanged</code></pre><br />
This was done on the default theme which is WordPress shipped with right now, named `twentyeleven`. Most of the images were optimized already, but not all. (The numbers are the size in bytes.)</p>
<p>It has a pretty nice <a href="http://wordpress.org/extend/plugins/cw-image-optimizer/installation/">install documentation</a>, which includes the install of littleutils as well. I did not find any PPA repositories for this very software, therefore you need to make &#038; install it by hand.</p>
<h2>The outcome</h2>
<p>And the suprising thing: this can dramatically boost both your site speed and your result at Google PageSpeed. Don&#8217;t believe me? <a href="https://developers.google.com/pagespeed/#url=http_3A_2F_2Fpetermolnar.eu_2Fphotoblog_2F&#038;mobile=false">See this</a>.</p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/google-pagespeed-says-optimize-your-wordpress-images/">Google PageSpeed says: optimize your WordPress images!</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/google-pagespeed-says-optimize-your-wordpress-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing WordPress: the importance of PHP opcode cache</title>
		<link>http://petermolnar.eu/linux-tech-coding/testing-wordpress-the-importance-of-php-opcode-cache/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/testing-wordpress-the-importance-of-php-opcode-cache/#comments</comments>
		<pubDate>Thu, 01 Mar 2012 16:06:55 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[object cache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Network]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2598</guid>
		<description><![CDATA[<p>Testing the limits of an nginx and PHP-FPM based WordPress Network with and without PHP APC opcode cache running on a really small KVM VPS. </p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/testing-wordpress-the-importance-of-php-opcode-cache/">Testing WordPress: the importance of PHP opcode cache</a></p></p>]]></description>
			<content:encoded><![CDATA[<h2>The why-s</h2>
<p>There were some discussions lately at LinkedIn mostly on the topic of choosing a VPS (virtual private server)  over a shared hosting provides any benefits.<br />
My opinion: a VPS can clearly outnumber a shared host in performance and freedom, but not in pricing. Price can only be matched when the VPS is an unmanaged one, meaning you (or someone you hire) has to take care of all the configurations, the server management, the monitoring &#8211; even the operating system install itself.</p>
<p>For most people this looks horrible and finding a cheap but good system operator is a nightmare for anybody. The problem is, that on a shared host you are limited to the system services. There are really few hosting providers how allow switching between web servers, or even switching PHP versions, and what&#8217;s worts: you clearly not allowed to tweak any of the services.</p>
<p>I know there are really few WordPress users who want &#8211; and are able &#8211; to fine tune the backend of the install, but there are tiny things which can make incredible difference.</p>
<p>I decided to make a little test to show how little is enough for, in this case a WordPress Network, to brutally gain on performace.<br />
Originally I wanted to show only the power of <a href="http://wordpress.org/extend/plugins/wp-ffpc">WP-FFPC</a>, a full page cache plugin written by me. The problem was that I left APC object cache plugin active, so I decided to show the importance of <a href="http://php.net/manual/en/book.apc.php">APC</a> instead.</p>
<h2>Test setup</h2>
<ul class="bullet-list">
<li><a href="http://cheapvps.co.uk/plans-kvm.php">KVM VPS V1 plan</a> from <a href="http://cheapvps.co.uk/">cheapVPS</a></li>
<li>Ubuntu server 11.10
<ul class="bullet-list">
<li>kernel 3.0.0-16-server</li>
</ul>
</li>
<li>nginx 1.0.11
<ul class="bullet-list">
<li>gzip compression enabled at level 1</li>
</ul>
</li>
<li>PHP 5.3.6-13ubuntu3.6 with Suhosin-Patch</li>
<li>Percona server (MySQL replacement) 5.5.20</li>
<li>opcode cache: APC-3.1.9*</li>
<li>WordPress Network 3.3.1, sunrine (domain mapping) enabled
<ul>
<li>WordPress cache enabled</li>
<li><a href="http://wordpress.org/extend/plugins/apc/">APC object cache</a> plugin*</li>
<li><a href="http://wordpress.org/extend/plugins/wp-ffpc/">WP-FFPC</a> full page cache for APC plugin*</li>
</ul>
</li>
</ul>
<p>* APC cache was only enabled for the first test</p>
<p>The page I was testing is a category archive page. It shows 4 special post: all posts include numerous small pictures, some larger ones, loading jQuery with some extensions and listing some CSS files as well. It&#8217;s also a domain mapped sub-blog of the site.</p>
<p><em>I have to add that I have a little trick made on my server config. Normally all sub-site content is server by PHP in a WordPress Network. This was change by my when <a href="http://petermolnar.eu/linux-tech-coding/nginx-config-for-wordpress-network/">I added some extra into my nginx setup</a>. If this test had been done with the default WordPress Network setup, I&#8217;m fairly sure my result would be pretty awful, please take this into your count.<br />
</em><br />
The address of the tested page: <a href="http://petermolnar.eu/photoblog/">http://petermolnar.eu/photoblog/</a></p>
<div class="grid33">
<h4>What is nginx?</h4>
<p>nginx is a webserver, similar to apache2 (running behind most of the web pages on the world).<br />
The main differences: nginx is a lot harder to extend (for example, there are no possibilities to use files like .htaccess in apache), but it eats significantly less memory and CPU time in exchange.
</p></div>
<div class="grid33">
<h4>What is PHP?</h4>
<p>PHP is one of the programming languages WordPress was written in. Traditional programming languages are needed to be compiled, thus they become and exe, or some kind of binary file. PHP instead is compiling all files, all the time on-the-fly -and this requires inmense computing power.
</p></div>
<div class="grid33">
<h4>What is PHP-FPM?</h4>
<p>The web server can load the PHP compiler in various ways; apache2 server has a built-in module for it, which, unfortunately, can eat up all the possible memory. An other way is to use a &#8220;PHP server&#8221;, which can than be access with a protocoll, named FastCGI. PHP-FPM is a FastCGI server version of the PHP compiler.
</p></div>
<h4>What is opcode caching?</h4>
<p>PHP Opcode cache can store compiled variables, pages and parts of the code. By default PHP always recompile everything which is really not neccessery at most times. The opcode cache therefore uplifts a lot of uneeded compilation, speeds up the program and saves CPU time.</p>
<h2>Load test setup</h2>
<p>I&#8217;ve used <a href="http://<br />
<tr>
<th>Max. 128 users</th>
<td>5 minutes</td>
</tr>
<p> < href="http://loadimpact.com">loadimpact.com</a> for making a stress test on my server. I have so low traffic on this very server that the stress test should make a clearly visible difference.</p>
<p>The test setup: 20 minutes total runtime splitted into 5 minute parts. All parts have limited maximum simultaneous users.</p>
<div class="grid33 right"><a href="http://petermolnar.eu/files/2012/03/loadimpact_test_plan.png"><img src="http://petermolnar.eu/files/2012/03/loadimpact_test_plan-300x162.png" alt="" title="loadimpact_test_plan" width="300" height="162" class="colorbox-2598 alignnone size-medium wp-image-2602" /></a></div>
<table>
<tr>
<th>Total runtime</th>
<td>20 minutes</td>
</tr>
<tr>
<th>Max. 16 users</th>
<td>5 minutes</td>
</tr>
<tr>
<th>Max. 32 users</th>
<td>5 minutes</td>
</tr>
<tr>
<th>Max. 64 users</th>
<td>5 minutes</td>
</tr>
<tr>
<th>Max. 128 users</th>
<td>5 minutes</td>
</tr>
</table>
<h3>Users geographical dispersion</h3>
<div class="grid33 right"><a href="http://petermolnar.eu/files/2012/03/loadimpact_user_scenarios.png"><img src="http://petermolnar.eu/files/2012/03/loadimpact_user_scenarios-300x102.png" alt="" title="loadimpact_user_scenarios" width="300" height="102" class="colorbox-2598 alignnone size-medium wp-image-2603" /></a></div>
<table>
<tr>
<th>Dublin, IE</th>
<td>50% of all users (server is located in UK)</td>
</tr>
<tr>
<th>Tokyo, JP</th>
<td>10% of all users</td>
</tr>
<tr>
<th>Portland, US</th>
<td>40% of all users</td>
</tr>
</table>
<h2>Load test results</h2>
<h3>User experience</h3>
<div class="grid50">
<h4>Without APC enabled</h4>
<p class="aligncenter"><a href="http://petermolnar.eu/files/2012/03/loadimpact_wo_apc_charts.png"><img src="http://petermolnar.eu/files/2012/03/loadimpact_wo_apc_charts-300x167.png" alt="" title="loadimpact_wo_apc_charts" width="300" height="167" class="colorbox-2598 alignnone size-medium wp-image-2605" /></a></p>
</div>
<div class="grid50">
<h4>With APC enabled</h4>
<p class="aligncenter"><a href="http://petermolnar.eu/files/2012/03/loadimpact_w_apc_charts.png"><img src="http://petermolnar.eu/files/2012/03/loadimpact_w_apc_charts-300x167.png" alt="" title="loadimpact_w_apc_charts" width="300" height="167" class="colorbox-2598 alignnone size-medium wp-image-2604" /></a></p>
</div>
<h3>Meanwhile on the server</h3>
<p>These are munin the graphs taken from the server while the tests were running. There are two highlited spikes, the first time was with APC on, the second (~1 day later) is without APC cache.</p>
<div class="grid50">
<h4>Number of nginx requests/sec</h4>
<p class="aligncenter"><a href="http://petermolnar.eu/files/2012/03/nginx_request.png"><img src="http://petermolnar.eu/files/2012/03/nginx_request-300x169.png" alt="" title="nginx_request" width="300" height="169" class="colorbox-2598 alignnone size-medium wp-image-2606" /></a></p>
</div>
<div class="grid50">
<h4>Traffic on ethernet device</h4>
<p class="aligncenter"><a href="http://petermolnar.eu/files/2012/03/ethtraff.png"><img src="http://petermolnar.eu/files/2012/03/ethtraff-300x169.png" alt="" title="ethtraff" width="300" height="169" class="colorbox-2598 alignnone size-medium wp-image-2600" /></a></p>
</div>
<div class="grid50">
<h4>Server load</h4>
<p>Server has 4 CPUs, therefore 4 means the full utilization.</p>
<p class="aligncenter"><a href="http://petermolnar.eu/files/2012/03/load.png"><img src="http://petermolnar.eu/files/2012/03/load-300x169.png" alt="" title="load" width="300" height="169" class="colorbox-2598 alignnone size-medium wp-image-2601" /></a></p>
</div>
<h2>Conclusions</h2>
<h3>CheapVPS performance</h3>
<p>The performance and the capacity of the smallest &#8211; and probably one of the cheapest KVM based virtual servers &#8211; suprised me again. It could handle 100 simultaneous connections per second without opcode cache!<br />
For calculation: if this would keep up for a day, it would result 8 640 000 hist on that day, which is way over a normal site&#8217;s traffic.<br />
For 14.40 £ (with taxes!), this is the best buy ever.</p>
<h3>The results</h3>
<p>Aggregated 5 seconds page load time is not really a bad result, but the system could only handle it just for limited number of requests/second. With cache enabled the load time went down by 2 seconds, which is really much (~40%) and also, I could not reach the limit of the server.<br />
For calculation: keeping 220 requests/second rate for a day would result 19 008 000 hits per day, and the server is still serving all the content with the same speed.</p>
<p>The munin graphs show another important thing: without cache, the server load can be measured at lest 3 times multiplied. This also results that the ethernet traffic and the handled nginx requests per second will fall off.</p>
<h3>Overall conclusion</h3>
<ul class="bullet-list">
<li>CheapVPS worths every penny</li>
<li>PHP opcode cache should be implemented in it by default, without the need if installing additions </li>
<li>always install PHP opcode on a server</li>
<li>tweaking the backend can bring out true performance even with WordPress</li>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/testing-wordpress-the-importance-of-php-opcode-cache/">Testing WordPress: the importance of PHP opcode cache</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/testing-wordpress-the-importance-of-php-opcode-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 11.10 disable &#8220;Waiting up to 60 more seconds for network configuration&#8221;</title>
		<link>http://petermolnar.eu/linux-tech-coding/ubuntu-11-10-disable-waiting-up-to-60-more-seconds-for-network-configuration/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/ubuntu-11-10-disable-waiting-up-to-60-more-seconds-for-network-configuration/#comments</comments>
		<pubDate>Wed, 29 Feb 2012 19:34:18 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[network configuration]]></category>
		<category><![CDATA[speedup]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Ubuntu 11.10]]></category>
		<category><![CDATA[Ubuntu Oneiric Ocelot]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2592</guid>
		<description><![CDATA[<p>After upgrading from Ubuntu 11.04 to 11.10 boot hangs for more than one minute, waiting for network. 
Here's how to solve it the correct way.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/ubuntu-11-10-disable-waiting-up-to-60-more-seconds-for-network-configuration/">Ubuntu 11.10 disable &#8220;Waiting up to 60 more seconds for network configuration&#8221;</a></p></p>]]></description>
			<content:encoded><![CDATA[<hr />
<p><strong>This post is made of copy-pasted parts from a blog post on <a href="http://www.codewhirl.com/">CodeWhirl</a>, from author <a href="http://www.codewhirl.com/author/wrostek/">Wrostek</a>. I only placed it here to make Google show better results for the correct solution instead of the symlink one.</strong></p>
<p>The original post can be visited here: <a href="http://www.codewhirl.com/2011/10/ubuntu-11-10-waiting-up-to-60-more-seconds-for-network-configuration/">http://www.codewhirl.com/2011/10/ubuntu-11-10-waiting-up-to-60-more-seconds-for-network-configuration/</a></p>
<hr />
<p>&nbsp;</p>
<p>So, the only other solution must be to edit ‘Waiting for network configuration…’ script. This script is actually located here: `/etc/init/failsafe.conf`</p>
<p>Around 25 lines down in the file you will see a section:</p>
<pre class="hljs"><code class="bash"># Plymouth errors should not stop the script because we *must* reach
# the end of this script to avoid letting the system spin forever
# waiting on it to start.
$PLYMOUTH message &#8211;text=&#8221;Waiting for network configuration&#8230;&#8221; || :
sleep 40
$PLYMOUTH message &#8211;text=&#8221;Waiting up to 60 more seconds for network configuration&#8230;&#8221; || :
sleep 59
$PLYMOUTH message &#8211;text=&#8221;Booting system without full network configuration&#8230;&#8221; || :</code></pre>
<p>To solve the problem, you can just remove the calls to sleep, by commenting the out ( or at least reduce the wait time if your network really does need to wait )</p>
<pre class="hljs"><code class="bash"># Plymouth errors should not stop the script because we *must* reach
# the end of this script to avoid letting the system spin forever
# waiting on it to start.
$PLYMOUTH message &#8211;text=&#8221;Waiting for network configuration&#8230;&#8221; || :
#sleep 40
$PLYMOUTH message &#8211;text=&#8221;Waiting up to 60 more seconds for network configuration&#8230;&#8221; || :
#sleep 59
$PLYMOUTH message &#8211;text=&#8221;Booting system without full network configuration&#8230;&#8221; || :</code></pre>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/ubuntu-11-10-disable-waiting-up-to-60-more-seconds-for-network-configuration/">Ubuntu 11.10 disable &#8220;Waiting up to 60 more seconds for network configuration&#8221;</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/ubuntu-11-10-disable-waiting-up-to-60-more-seconds-for-network-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>conky with ical</title>
		<link>http://petermolnar.eu/linux-tech-coding/conky-with-ical/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/conky-with-ical/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 09:45:15 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[conky]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2519</guid>
		<description><![CDATA[<p>Make conky display ical calendars from the web with the help of calcurse.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/conky-with-ical/">conky with ical</a></p></p>]]></description>
			<content:encoded><![CDATA[<p>I encountered a simple problem: how to display ical calendar events with conky without writing an ical parser.<br />
The solution came in the form of a suprising tool: calcurse. This is a command-line, text-based, slightly graphical-like interface for ical handling.</p>
<p>So: download the calendar, import it into calcurse, show it in conky. But how to manage possible remote update? Do this every 30 minutes.</p>
<h3>load_calendars.sh</h3>
<pre class="hljs"><code class="bash">#!/bin/bash
# clear calcurse data
rm ~/.calcurse/apts
# array for remote calendars
calendars=( &#8216;http://link-to-first-cal.ics&#8217; &#8216;http://link-to-second-cal.ics&#8217; &#8216;and so on&#8217; );
# temp file to save a calendar
TMPCAL=/tmp/temp.ics
# run through the calendars
for ical in &#8220;${calendars[@]}&#8221;
do
	# download ical file
	wget -q &#8220;$ical&#8221; -O $TMPCAL
	# import into calcurse, error &#038; output silenced
	calcurse -i $TMPCAL >/dev/null 2>&#038;1
	# clear the temp calendar file
	rm $TMPCAL
done
# display current &#038; next 6 days (7 altogether)
calcurse -r7</code></pre>
<h3>conky script to show elements</h3>
<p>Update interval is one hour, window placed to left top corner + 20 px left &#038; top gap.<br />
<pre class="hljs"><code class="apache">use_xft yes
xftfont DejaVu Sans:size=8
xftalpha 0.8
text_buffer_size 2048
total_run_times 0
no_buffers yes
uppercase no
cpu_avg_samples 1
net_avg_samples 1
override_utf8_locale yes
double_buffer yes
use_spacer none
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
minimum_size 420 0
maximum_width 420
draw_shades no
draw_outline no
draw_borders no
stippled_borders 0
border_width 0
default_color grey
own_window_colour grey
alignment top_left
update_interval 3600
gap_x 20
gap_y 20
TEXT
${font DejaVu Sans:style=Bold:size=10}EVENTS${font}
${font DejaVu Sans:size=9}${exec /path/to/load_calendars.sh}${font}</code></pre></p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/conky-with-ical/">conky with ical</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/conky-with-ical/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>reduced functionality switch &#8211;  case in nginx: map module</title>
		<link>http://petermolnar.eu/linux-tech-coding/reduced-functionality-switch-case-in-nginx-map-module/</link>
		<comments>http://petermolnar.eu/linux-tech-coding/reduced-functionality-switch-case-in-nginx-map-module/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 06:55:33 +0000</pubDate>
		<dc:creator>petermolnar</dc:creator>
				<category><![CDATA[linux, tech, coding]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://petermolnar.eu/?p=2490</guid>
		<description><![CDATA[<p>There's no switch-case in nginx, though map is available for similar but reduced functionality cases.</p><p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/reduced-functionality-switch-case-in-nginx-map-module/">reduced functionality switch &#8211;  case in nginx: map module</a></p></p>]]></description>
			<content:encoded><![CDATA[<p>I was searching for a switch-case possibility in nginx without success. Although a module named &#8220;map&#8221; can do something similar but only for setting a variable.</p>
<p>Like the following:<br />
<pre class="hljs"><code class="nginx">map $host $dirnum {
		default				0;
		domain1.com			1;
		domain2.com			2;
	}</code></pre></p>
<p>This has to be placed <em>outside</em> the `server` part but inside `http`.</p>
<p>Afterwards the variable becomes useable, in, for example rewrite rules:<br />
<pre class="hljs"><code class="nginx"># if domain is mapped
if ($dirnum != 0 )
{
	rewrite ^/files/(.*)$ /wp-content/blogs.dir/$dirnum/files/$1 last;
}
# otherwise fall back to "normal" rule
if ($dirnum = 0 )
{
	rewrite ^(.*)/files/(.*)$ /wp-includes/ms-files.php?file=$2 last;
}</code></pre></p>
<p><p>Visit the post at <a href="http://petermolnar.eu/linux-tech-coding/reduced-functionality-switch-case-in-nginx-map-module/">reduced functionality switch &#8211;  case in nginx: map module</a></p></p>]]></content:encoded>
			<wfw:commentRss>http://petermolnar.eu/linux-tech-coding/reduced-functionality-switch-case-in-nginx-map-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

