<?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>pofHQ</title>
	<atom:link href="http://pof.eslack.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://pof.eslack.org</link>
	<description>Pau Oliva Fora personal blog</description>
	<lastBuildDate>Sat, 12 Jan 2013 03:41:39 +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>
		<item>
		<title>SSD alignment on linux with ext4 and LVM</title>
		<link>http://pof.eslack.org/2013/01/12/ssd-alignment-on-linux-with-ext4-and-lvm/</link>
		<comments>http://pof.eslack.org/2013/01/12/ssd-alignment-on-linux-with-ext4-and-lvm/#comments</comments>
		<pubDate>Sat, 12 Jan 2013 01:08:36 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[align]]></category>
		<category><![CDATA[ext4]]></category>
		<category><![CDATA[fdisk]]></category>
		<category><![CDATA[lvm]]></category>
		<category><![CDATA[ssd]]></category>
		<category><![CDATA[trim]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1796</guid>
		<description><![CDATA[First make sure to create partitions aligned to your SSD erase block size (in my case 512k): sudo fdisk -H32 -S32 /dev/sdb You can check with fdisk -lu /dev/sdb that the start of each partition is divisible by 512. Then &#8230; <a href="http://pof.eslack.org/2013/01/12/ssd-alignment-on-linux-with-ext4-and-lvm/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[First make sure to create partitions aligned to your SSD erase block size (in my case 512k):
<code>sudo fdisk -H32 -S32 /dev/sdb</code>
You can check with <code>fdisk -lu /dev/sdb</code> that the start of each partition is divisible by 512.

Then initialize the desired partition to use with LVM2 using the <tt>dataalignment</tt> parameter:
<code>pvcreate --dataalignment 512k /dev/sdb1</code>
Make sure your <code>/etc/lvm/lvm.conf</code> contains the following options:
<pre>
    md_chunk_alignment = 1
    data_alignment_detection = 1
    data_alignment = 0
    data_alignment_offset_detection = 1
</pre>
Now you can use <code>vgcreate</code> to create your volume grup, and then <code>lvcreate</code> to create the logical volumes.

When creating ext4 filesystems (with TRIM support), use the following command:
<code>mkfs.ext4 -O extent -b 4096 -E stride=128,stripe-width=128 /dev/mapper/vg1-test</code>
<tt>stride</tt> and <tt>stripe-width</tt> are calculated as <code>sector size / block size</code> = 512k / 4k = 128

When mounting ext4 filesystems, use the &#8216;<tt>discard</tt>&#8216; parameter to enable TRIM support:
<code>mount -o discard,noatime,nodiratime /dev/mapper/vg1-test /mnt/</code>

<strong>Extra tip</strong>: for more speed you can consider turning off journaling (to avoid double-write overhead), at the cost of an easily corruptable filesystem.
Check if journaling is enabled: <code>dumpe2fs /dev/mapper/vg1-test |grep 'Filesystem features'</code>
Disable journaling: <code>tune2fs -O ^has_journal</code>]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2013/01/12/ssd-alignment-on-linux-with-ext4-and-lvm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fortifying a Galaxy Nexus with stock-ish image and root access</title>
		<link>http://pof.eslack.org/2012/07/30/fortifying-a-galaxy-nexus-with-stock-ish-image-and-root-access/</link>
		<comments>http://pof.eslack.org/2012/07/30/fortifying-a-galaxy-nexus-with-stock-ish-image-and-root-access/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 11:36:43 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[bootloader]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[fastboot]]></category>
		<category><![CDATA[galaxy nexus]]></category>
		<category><![CDATA[maguro]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[superuser]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1734</guid>
		<description><![CDATA[In this post I will describe my recipe to have a Samsung Galaxy Nexus (codename &#8220;maguro&#8221;) using a rooted factory image, capable of getting OTA updates without loosing root access and with a locked bootloader, keeping the user data safe &#8230; <a href="http://pof.eslack.org/2012/07/30/fortifying-a-galaxy-nexus-with-stock-ish-image-and-root-access/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[	<p><img src="http://pof.eslack.org/archives/images/gnex/gnex.jpg" alt="galaxy nexus" class="esquerra" />In this post I will describe my recipe to have a Samsung Galaxy Nexus (codename &#8220;maguro&#8221;) using a rooted factory image, capable of getting OTA updates without loosing root access and with a locked bootloader, keeping the user data safe in case it gets lost or stolen, in the sense that the person getting it will not be able to extract personal details from it like Google accounts, settings, downloaded apps and their data, media, etc.</p>
	<p>I assume the reader starts with a stock unmodified <a href="https://developers.google.com/android/nexus/images">factory image</a>, and knows how to use fastboot.</p>
	<p><span id="more-1734"></span></p>
	<h3>Step 1: Getting root access</h3>
	<p>The first step is getting root access, to accomplish this the easiest way is to temporarily unlock the bootloader (don&#8217;t worry, we will re-lock it later). </p>
	<p>Open a shell prompt and type <code>fastboot oem unlock</code>, all data on the phone will be lost as after <tt>oem unlock</tt> the bootloader performs a factory data reset (also called hard-reset or reset to factory default).</p>
	<p>Once the bootloader is unlocked, we can flash &#8220;unsigned&#8221; data through fastboot, this allows us to flash a customized recovery image, which will allow to flash an usable &#8216;su&#8217; binary with the proper suid permissions and a superuser app into the system.</p>
	<p><img src="http://pof.eslack.org/archives/images/gnex/clockworkmod.png" alt="clockworkmod recovery" class="dreta" /><br />
There are a few custom recovery images out there to choose from, the most popular being <a href="http://www.clockworkmod.com/rommanager/">ClockworkMod recovery</a> and <a href="http://teamw.in/project/twrp2/">TeamWin Recovery Project (TWRP)</a>. I recommend the later, because it supports decrypting an encrypted data partition on Galaxy Nexus since version 2.2.0.</p>
	<p>To successfully root the device, first flash the custom recovery image using fastboot: <code>fastboot flash recovery recovery-maguro.img</code>, then reboot into recovery <strong>without booting the system</strong> (this is important, as during boot the recovery image checksum is verified and if it doesn&#8217;t match the stock recovery the system will overwrite the custom recovery with the stock one).</p>
	<p><img src="http://pof.eslack.org/archives/images/gnex/superuser.png" alt="superuser apk" class="dreta" /><br />
Once we&#8217;re into the custom recovery, we need to flash the &#8216;su&#8217; binary and the superuser apk, again there are multiple possibilities out there, the most popular being <a href="https://play.google.com/store/apps/details?id=com.noshufou.android.su">ChainsDD Superuser</a> (<a href="http://androidsu.com/superuser/">flashable zip</a>) and <a href="https://play.google.com/store/apps/details?id=eu.chainfire.supersu">Chainfire SuperSU</a> (<a href="http://download.chainfire.eu/204/SuperSU/CWM-SuperSU-v0.94.zip">flashable zip</a>).</p>
	<p>Finally, when the phone is booted again the stock recovery will be automatically flashed and you will have a rooted phone with unlocked bootloader and stock recovery.</p>
	<h3>Step 2: Relocking the bootloader</h3>
	<p>Re-locking the bootloader is important, because with an unlocked bootloader any unauthorized user could access your private data by flashing a custom recovery and backing up or mounting your storage and data partitions. This is why the &#8216;<tt>oem unlock</tt>&#8216; process wipes your data, and this is why you should keep the bootloader locked.</p>
	<p><img src="http://pof.eslack.org/archives/images/gnex/bootunlocker.png" alt="bootunlocker" class="dreta" />The Galaxy Nexus bootloader stores the lock status at position 0x000007C (124 decimal) of the  <tt>param</tt> partition of the device&#8217;s internal storage. When the byte is set to &#8217;0&#8242;, bootloader is unlocked, when it is set to &#8217;1&#8242; bootloader is locked. As you can guess now, if you have root access you can manually change the bootloader status from the system, thus it is possible to unlock and relock it without using fastboot, and without wiping your data. You could do this process manually using &#8216;<tt>dd</tt>&#8216;, but of course the good folks at XDA have created an open source app to automate this process for you. Install <a href="https://play.google.com/store/apps/details?id=net.segv11.bootunlocker">BootUnlocker for Galaxy Nexus</a> from the play store, give it root permissions and re-lock your bootloader now. If you want to have a look at the application source code, check the <a href="https://code.google.com/p/boot-unlocker-gnex/">google code project page</a>.</p>
	<p>You now have a rooted phone with stock recovery and locked bootloader.</p>
	<h3>Step 3: Encrypting the phone</h3>
	<p>Encryption on Android uses the dm-crypt layer in the Linux kernel, to enable encryption go to Settings, Security, Encryption and click on &#8220;Encrypt phone&#8221;, for the encryption process to start battery should be fully charged and the phone AC adapter must be plugged in. For more details on how encryption works, read <a href="http://source.android.com/tech/encryption/android_crypto_implementation.html">Notes on the implementation of encryption in Android</a>.</p>
	<p><img src="http://pof.eslack.org/archives/images/gnex/encrypt.png" alt="android encryption" class="dreta" />Once the phone is encrypted, you need to type a numeric PIN or password to decrypt it each time you power it on. The master key to decrypt the filesystem is encrypted with a hash of the user&#8217;s lock screen password (that&#8217;s why you can only use pin or password in the lockscreen when encryption is enabled).</p>
	<p>Currently, there is only one password for both the encryption and lock screen. This is especially bad because you cannot turn off screen lock and therefore have to type it rather frequently, which makes it easier to get a glance on the screen while typing it. Until Google provides a way to use different passwords for encryption and screen lock, you can manually change password for encryption by issuing the following shell command as root:</p>
	<p><code>vdc cryptfs changepw &lt;new_password&gt;</code></p>
	<p>This command changes only encryption password requested at phone boot. The lock screen PIN or password remains unchanged. Please see (and star) <a href="http://code.google.com/p/android/issues/detail?id=29468">Android issue 29468</a> for Google to implement this in the UI.</p>
	<p><img src="http://pof.eslack.org/archives/images/gnex/cryptfs.png" alt="cryptfs password" class="dreta" />Again, there&#8217;s an app for that too! check out <a href="https://play.google.com/store/apps/details?id=org.nick.cryptfs.passwdmanager">Cryptfs Password</a> (<a href="https://github.com/nelenkov/cryptfs-password-manager">github source</a>) if you want to change the password without messing with the command line.</p>
	<p>Make sure to choose a good password not based on a dictionary word, as the encryption can be cracked using brute force (see <a href="https://viaforensics.com/mobile-security/droid-gaining-access-android-user-data.html">Into the Droid – Gaining Access to Android User Data</a> presentation from Thomas Cannon at Defcon 2012, <a href="https://viaforensics.com/wpinstall/wp-content/uploads/into-the-droid-viaForensics-Defcon-2012.026.png">slide 26</a> and <a href="https://viaforensics.com/wpinstall/wp-content/uploads/into-the-droid-viaForensics-Defcon-2012.027.png">slide 27</a>).</p>
	<p>You have now an encrypted rooted phone with stock recovery and locked bootloader.</p>
	<h3>Step 4: Keeping root access after OTA updates</h3>
	<p>When Over The Air updates are applied, the function <tt>set_perm_recursive</tt> is called from recovery, this removes the setuid bits on the &#8216;su&#8217; binary and disables your root access after the OTA has been applied.</p>
	<p><img src="http://pof.eslack.org/archives/images/gnex/otarootkeeper.png" alt="ota root keeper" class="dreta" /><br />
To prevent this form happening, one could change the file attributes for the &#8216;su&#8217; binary to immutable using <code>chattr +i /system/xbin/su</code>, again there&#8217;s an app that will do this for you automatically (and also keep a backup of your su binary, allowing to &#8220;temporarily unroot&#8221; your phone): <a href="https://play.google.com/store/apps/details?id=org.projectvoodoo.otarootkeeper">OTA RootKeeper</a>, the source code is <a href="https://github.com/project-voodoo/ota-rootkeeper-app">available on github</a>.</p>
	<p>The same functionality from OTA RootKeper has been recently included in recent versions of ChainsDD Superuser app.</p>
	<p>You have now an encrypted rooted phone with stock recovery, locked bootloader and capable of keeping root access through OTAs.</p>
	<h3>Some notes concerning OTA updates and backups</h3>
	<p>With this setup, you have not modified any system files so your phone should be able to automatically get OTA updates and apply them cleanly. If you are impatient and want to manually flash OTAs as soon as they are available you should keep in mind your setup is a bit different and instructions posted everywere won&#8217;t work exactly for your phone.</p>
	<p>To manually apply an OTA update, you should flash a custom recovery first, you can do it either from system using &#8216;<tt>dd</tt>&#8216; (you are root now), or through fastboot (but remember to oem-unlock your bootloader first using the BootUnlocker app, and re-lock when done).</p>
	<p>To flash the custom recovery from system, you can use the following command as root:</p>
	<pre>
$ su
# dd if=/sdcard/twrp-2.2.0-maguro.img of=/dev/block/platform/omap/omap_hsmmc.0/by-name/recovery
</pre>
	<p>You can then reboot into the custom recovery to apply the OTA from sdcard, or to backup your system, remember to use a custom recovery with support for encrypted partitions like TWRP. Again, remember that when you boot your phone again, the custom recovery will be overwritten with the stock recovery on boot.</p>
	<p><strong>Update</strong>: An avid reader (thanks Marc!) noticed that factory images don&#8217;t include the files <tt>/system/etc/install-recovery.sh</tt> and <tt>/system/recovery-from-boot.p</tt> which are responsible of re-installing the factory image on boot when the installed recovery checksum doesn&#8217;t match the stock recovery, these files are only present if you have updated through an OTA. This means that if you come from a factory image, you&#8217;ll need to reflash the stock recovery manually at the end of the process. To do this first extract the stock recovery from a factory image:</p>
	<pre>
$ tar zxvf takju-factory.tgz
$ cd takju-*/
$ unzip image-takju-*.zip
[...]
  inflating: recovery.img
</pre>
	<p>Then reboot into fastboot mode and flash it using fastboot: <code>fastboot flash recovery recovery.img</code>
</p>
]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2012/07/30/fortifying-a-galaxy-nexus-with-stock-ish-image-and-root-access/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu 12.04 on ONKYO BX407A4</title>
		<link>http://pof.eslack.org/2012/06/18/ubuntu-12-04-on-onkyo-bx407a4/</link>
		<comments>http://pof.eslack.org/2012/06/18/ubuntu-12-04-on-onkyo-bx407a4/#comments</comments>
		<pubDate>Mon, 18 Jun 2012 21:27:44 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[gadgets]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[minipost]]></category>
		<category><![CDATA[BX407A4]]></category>
		<category><![CDATA[egalax]]></category>
		<category><![CDATA[onkyo]]></category>
		<category><![CDATA[opengalax]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1711</guid>
		<description><![CDATA[Two years ago I wrote about installing Ubuntu 10.04 on ONKYO BX407A4, now I have upgraded it to 12.04 LTS, and here&#8217;s a reviewed procedure in case anyone still uses this UMPC. Basically everything works so well out of the &#8230; <a href="http://pof.eslack.org/2012/06/18/ubuntu-12-04-on-onkyo-bx407a4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[Two years ago I wrote about <a href="http://pof.eslack.org/2010/07/30/linux-on-onkyo-bx407a4/">installing Ubuntu 10.04 on ONKYO BX407A4</a>, now I have upgraded it to 12.04 LTS, and here&#8217;s a reviewed procedure in case anyone still uses this UMPC.

Basically everything works so well out of the box, except for a few things that need a little bit of tweaking:

Replace <tt>/etc/rc.local</tt> with the following: <a href="http://pof.eslack.org/archives/files/ONKYO/rc.local">rc.local</a>

Replace <tt>/etc/default/grub</tt> with the following: <a href="http://pof.eslack.org/archives/files/ONKYO/grub">grub</a>, when done run &#8216;<code>sudo update-grub</code>&#8216;.

Add the file <tt>/etc/modprobe.d/blacklist-onkyo.conf</tt>: <a href="http://pof.eslack.org/archives/files/ONKYO/blacklist-onkyo.conf">blacklist-onkyo.conf</a>

Add the file <tt>/etc/pm/power.d/99_onkyo</tt> and make it executable: <a href="http://pof.eslack.org/archives/files/ONKYO/99_onkyo">99_onkyo</a>

Add the file <tt>/etc/pm/sleep.d/74_onkyo</tt> and make it executable: <a href="http://pof.eslack.org/archives/files/ONKYO/74_onkyo">74_onkyo</a>

Add the file <tt>/etc/pm/sleep.d/00_onkyo</tt> and make it executable: <a href="http://pof.eslack.org/archives/files/ONKYO/00_onkyo">00_onkyo</a>

Add the file <tt>/etc/pm/config.d/onkyo_fix</tt>: <a href="http://pof.eslack.org/archives/files/ONKYO/onkyo_fix">onkyo_fix</a>

Install vbetool:
<pre>
sudo apt-get install vbetool
</pre>

Install the latest version of <a href="https://github.com/poliva/opengalax">opengalax Touch Screen Driver</a>:

<pre>
$ sudo add-apt-repository ppa:poliva/opengalax
$ sudo apt-get update
$ sudo apt-get install opengalax xinput-calibrator
</pre>

When done, edit the file /etc/opengalax.conf and set psmouse=1, this together with the changes in grub will make the touchscreen and the optical mouse work.

Reboot, and run <code>xinput_calibrator</code> to calibrate the screen, save the calibration data in <tt>/etc/X11/xorg.conf.d/99-calibration.conf</tt>.

Some other useful hints:

Rember to add the &#8216;discard&#8217; parameter to <tt>/etc/fstab</tt> for SSD trim.

For Ubuntu/Unity: 
<pre>
$ sudo add-apt-repository ppa:poliva/pof
$ sudo apt-get update
$ sudo apt-get install indicator-sysbat
$ echo "coretemp" |sudo tee -a /etc/modules
</pre>

For Lubuntu/LXDE: 
Install <a href="https://github.com/poliva/lxbat">lxbat</a> instead.

With all these changes everything works as expected, even suspend/resume <img src='http://pof.eslack.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2012/06/18/ubuntu-12-04-on-onkyo-bx407a4/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Why Broadcom 802.11 Linux STA driver sucks, and how to fix it</title>
		<link>http://pof.eslack.org/2012/05/23/why-broadcom-80211-linux-sta-driver-sucks-and-how-to-fix-it/</link>
		<comments>http://pof.eslack.org/2012/05/23/why-broadcom-80211-linux-sta-driver-sucks-and-how-to-fix-it/#comments</comments>
		<pubDate>Wed, 23 May 2012 00:49:17 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[brcmsmac]]></category>
		<category><![CDATA[broadcom]]></category>
		<category><![CDATA[CFG80211]]></category>
		<category><![CDATA[dkms]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[lkm]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[networkmanager]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[WEXT]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wl]]></category>
		<category><![CDATA[wpasupplicant]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1681</guid>
		<description><![CDATA[TL;DR &#8211; the broadcom sta linux driver always fails in the first scan request after the interface is brought up, this produces a long delay when connecting to a wireless network. There&#8217;s an open source driver which does not have &#8230; <a href="http://pof.eslack.org/2012/05/23/why-broadcom-80211-linux-sta-driver-sucks-and-how-to-fix-it/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[	<blockquote><p>TL;DR &#8211; the broadcom sta linux driver always fails in the first scan request after the interface is brought up, this produces a long delay when connecting to a wireless network. There&#8217;s an open source driver which does not have this problem, but is not good with power management. In this post I describe the steps I took to pinpoint the problem in the proprietary driver and to fix it.</p></blockquote>
	<p>The story begins when I updated Ubuntu from 11.10 to 12.04 on my MacBook Air, everything worked fine after upgrading except one thing that bothered me a lot: when resuming the laptop after suspending it, it took around 30 seconds to connect to my wireless network. It wouldn&#8217;t have bothered me if it had been the same in 11.10, but in 11.10 the time to connect was barely 5 or 6 seconds, so having to wait 30 seconds was totally unacceptable.</p>
	<p>Initially I thought it was a bug in NetworkManager, and increased the debug level in the config file to finally come out to the conclusion that I was using a different driver in 12.04 than in 11.10.</p>
	<p>There are two drivers available for the Broadcom BCM4353 802.11 Wireless Controller:</p>
	<ul>
	<li><strong><a title="Broadcom brcmsmac" href="http://linuxwireless.org/en/users/Drivers/brcm80211">Broadcom brcmsmac (mac80211-based softmac PCIe)</a></strong>: the completely open source drivers, included in the kernel</li>
	<li><strong><a title="Broadcom 802.11 Linux STA driver" href="http://www.broadcom.com/support/802.11/linux_sta.php">Broadcom 802.11 Linux STA driver</a></strong>: the broadcom mixed GPL source + a proprietary hybrid binary file agnostic to the specific version of the Linux kernel</li>
	</ul>
	<p><span id="more-1681"></span></p>
	<p>Both wl (broadcom proprietary driver) and brcmsmac (the open source driver) were installed in my Ubuntu 11.10 but the open source driver was used by default, and this driver connected to the wifi network in 5 seconds.</p>
	<p>In Ubuntu 12.04, the wl proprietary driver provided by the package bcmwl-kernel-source has been updated from version 5.100.82.38+bdcom-0ubuntu4 to version 5.100.82.38+bdcom-0ubuntu6.1 which includes the following fix:</p>
	<pre>---------------
bcmwl (5.100.82.38+bdcom-0ubuntu6.1) precise-proposed; urgency=low
	
  * debian/bcmwl-kernel-source.postinst:
    - Blacklist brcmfmac, brcmsmac and bcma so that they don't
      conflict with the closed driver (LP: #873117)
 -- Alberto Milone  Mon, 23 Apr 2012 16:11:56 +0200</pre>
	<p>Which basically blacklists the open source brcmsmac module, forcing the wl proprietary driver to be in use. When the brcmsmac was not blacklisted, even if the wl driver was loaded it failed silently and brcmsmac was used instead.</p>
	<p>So, the easy path to solve my problem would have been to blacklist the wl module, and add the brcmsmac to <tt>/etc/modules</tt> and live happy with my 5 seconds needed to associate when resuming, <strong>*BUT*</strong> I compared both drivers and the proprietary driver has better signal and way better power management, which makes my battery last longer, so I decided to go the long route. My goal was to achieve the lowest delay possible to connect to a wireless network when coming from a suspend using the proprietary driver.</p>
	<p>I went &#8220;down&#8221; one level and started looking at wpasupplicant, as NetworkManager communicates with it using the DBus control interface (dbus-monitor showed the problem was not in dbus communication) so, increased the debug level in wpa-supplicant by adding &#8216;<tt>-dd</tt>&#8216; switch in <tt>/usr/share/dbus-1/system-services/fi.w1.wpa_supplicant1.service</tt>, and looked through the logs, which quickly revealed the following:</p>
	<pre>
May 20 11:49:46 maco wpa_supplicant[12610]: Scan requested (ret=0) - scan timeout 5 seconds
May 20 11:49:52 maco wpa_supplicant[12610]: Scan timeout - try to get results
May 20 11:49:52 maco wpa_supplicant[12610]: Failed to get scan results
May 20 11:49:52 maco wpa_supplicant[12610]: Failed to get scan results - try scanning again
May 20 11:50:07 maco wpa_supplicant[12610]: Scan requested (ret=0) - scan timeout 5 seconds
</pre>
	<p>The first scan request (SIOCSIWSCAN), after the wireless interface was brought up always failed (?), and wpa_supplicant tried to get the scan results (SIOCGIWSCAN) because some drivers do not deliver SIOCGIWSCAN events to notify when scan is complete, but this failed too, so wpasupplicant requested a second scan after a timeout, which properly delivered the results this time. This first failing scan was adding 21 seconds of delay to the network association process.</p>
	<p>I googled the error and found I was not the only soul affected by this problem, Kalle Valo submitted 4 different patches to the hostap mailing list between October 2010 and March 2011, but the patches were never accepted upstream, nor included in the ubuntu package. The wpasupplicant code has changed a bit since Kalle submitted his patches, so I adapted them to the current wpa_supplicant version in Ubuntu. If you are curious, you can dig through <a href="https://bugs.launchpad.net/bugs/994739" title="wireless takes several seconds longer to connect from standby">ubuntu bug #994739</a>.</p>
	<p>In short, the <a href="http://lists.shmoo.com/pipermail/hostap/2011-March/022891.html" title="Add a workaround for Broadcom wl driver's first failing scan">version 4 patch</a> from Kalle basically patches the WEXT driver from wpasupplicant to  check the return value when trying to get scan results (SIOCGIWSCAN) from the wl driver, if the number of last error (errno) is <code>EINVAL</code> on the first scan, it requests another scan, so this one will go through (as only the first one fails) and return the scan results next time wpasupplicant tries to get them. This is far from perfect, but it works (and doesn&#8217;t seem to break anything), reducing the time needed to associate to the wireless network after the interface has been brought up from 30 seconds to 12 seconds.</p>
	<p>But I was still unhappy with this result, so I <a href="http://pof.eslack.org/archives/files/mba42/wpa-supplicant-fix-wl-driver.patch" title="wpa supplicant fix wl driver patch">patched</a> the wpasupplicant code to request a scan right after the driver init function, so this would be the first &#8220;failing&#8221; scan, and the real scan requested a bit later would return results. This was a very ugly patch, because it made wpasupplicant request a scan in INACTIVE state (when it should be SCANNING), but it worked and reduced the time from 30 seconds to 10 seconds.</p>
	<p>So, still unhappy with the results, I decided to go down one more level and have a look at the GPL&#8217;d source of the Broadcom&#8217;s Linux STA proprietary driver, and BINGO! this is how the <code>wl_iw_set_scan()</code> function ends:</p>
	<pre>
        (void) dev_wlc_ioctl(dev, WLC_SCAN, &#038;ssid, sizeof(ssid));
	
        return 0;
</pre>
	<p>They always return 0, even when the <code>dev_wlc_ioctl()</code> function fails!! and WTH is it casted to void?? It would have been easier to just return the result of this function!. Patching this shows that the first scan after the interface is up fails with errno <code>EBUSY</code> (device or resource busy), so I added a workaround here to make it request the scan to the underlying hardware until it returned something different than <code>EBUSY</code> and could be correctly handled by wpasupplicant, <em>et voilà</em>, time reduced to 10 seconds.</p>
	<p>But hey, now that I looked at their source, it turns out that there&#8217;s a newer version available in broadcom&#8217;s website: 5.100.82.112. This version now supports the new linux cfg80211 wireless configuration API in addition to the older Wireless Extensions (WEXT), you can choose between CFG80211 or WEXT at compile time, the ubuntu package <tt>broadcom-sta-dkms</tt> in the development release for 12.10 &#8216;Quantal Quetzal&#8217; has been updated to this version but still uses the old WEXT which is still broken (always returns 0, remember above?). But, guess what they have done it correctly this time in the new CFG80211 code, see the end of the function <code>__wl_cfg80211_scan()</code>:</p>
	<pre>
        err = wl_dev_ioctl(ndev, WLC_SCAN, &#038;sr->ssid, sizeof(sr->ssid));
        if (err) {
                if (err == -EBUSY) {
                        WL_INF((\"system busy : scan for \\"%s\\" \"
                                \"canceled\n\", sr->ssid.SSID));
                } else {
                        WL_ERR((\"WLC_SCAN error (%d)\n\", err));
                }
                goto scan_out;
        }
	
        return 0;
	
scan_out:
        clear_bit(WL_STATUS_SCANNING, &#038;wl->status);
        wl->scan_request = NULL;
        return err;
</pre>
	<p>As you can see, they now return <code>EBUSY</code> when the driver cannot perform the scan, and wpa_supplicant can manage this situation correctly, so I quickly backported the <tt>broadcom-sta-dkms</tt> package from ubuntu 12.10 to ubuntu 12.04 and added a patch to compile it with CFG80211 enabled, and finally <strong>I CAN HAS ONLY 8 SECONDS DELAY!!!!1</strong> to associate to the wifi network after my laptop resumes from suspend using the wl driver, and I&#8217;m a happy camper! <img src='http://pof.eslack.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
</p>
]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2012/05/23/why-broadcom-80211-linux-sta-driver-sucks-and-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to have your patch included in Ubuntu</title>
		<link>http://pof.eslack.org/2012/05/21/have-a-patch-included-in-ubuntu/</link>
		<comments>http://pof.eslack.org/2012/05/21/have-a-patch-included-in-ubuntu/#comments</comments>
		<pubDate>Mon, 21 May 2012 22:56:05 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[minipost]]></category>
		<category><![CDATA[deb]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[packaging]]></category>
		<category><![CDATA[patch]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[wpasupplicant]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1666</guid>
		<description><![CDATA[Today I submitted a patch to wpa-supplicant package in Ubuntu (LP: #994739) and I learnt the process of pushing your changes to Launchpad and ask for them to be reviewed and merged. Ubuntu has a great documentation on how to &#8230; <a href="http://pof.eslack.org/2012/05/21/have-a-patch-included-in-ubuntu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[Today I submitted a patch to wpa-supplicant package in Ubuntu (<a href="https://bugs.launchpad.net/bugs/994739">LP: #994739</a>) and I learnt the process of pushing your changes to Launchpad and ask for them to be reviewed and merged. Ubuntu has a great documentation on how to fix bugs <a href="https://wiki.ubuntu.com/Bugs/HowToFix">in this Wiki</a> and <a href="http://developer.ubuntu.com/packaging/html/fixing-a-bug.html">packaging guide</a>, just for future reference here are the steps I followed.

If you don&#8217;t have them, get the ubuntu-dev-tools, and bazar VCS:
<pre>
$ sudo apt-get install bzr ubuntu-dev-tools
$ bzr whoami "Your Name &lt;you@example.org&gt;"
$ bzr launchpad-login poliva
</pre>

Then get the source of the package you want to fix, and apply your patch:
<pre>
$ bzr branch lp:ubuntu/precise/wpasupplicant
$ cd wpasupplicant
$ patch -p1 < /path/to/your.patch
</pre>

Prepare to build the ubuntu package:
<pre>
$ dpkg-source --commit
$ dpkg-buildpackage -us -uc
</pre>

In case <tt>dpkg-buildpackage</tt> complains about no upstream tarball found, you can obtain the .orig.tar.gz file with <tt>apt-get source</tt> and copy it to the base folder of your work.
<pre>
$ apt-get source wpasupplicant 
</pre>

Finally, update the debian changelog and commit the change locally:
<pre>
$ dch -i
$ bzr commit
</pre>

If all looks good, you can push the fix to launchpad and propose merging it into the official package:
<pre>
bzr push lp:~&lt;your-launchpad-id&gt;/ubuntu/&lt;release&gt;/&lt;package&gt;/&lt;branchname&gt;
bzr lp-open
</pre>

The last command will open the Launchpad page of the remote branch in your browser. There click on the "(+) Propose for merging" link, to get the change reviewed by somebody and included in Ubuntu.]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2012/05/21/have-a-patch-included-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started on Android Development from Command Line</title>
		<link>http://pof.eslack.org/2012/01/25/android-development-from-command-line/</link>
		<comments>http://pof.eslack.org/2012/01/25/android-development-from-command-line/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 12:01:14 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[apk]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[hello]]></category>
		<category><![CDATA[hello world]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[line]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[world]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1648</guid>
		<description><![CDATA[As a quick reference, here&#8217;s a list of useful and most commonly used commands if you want to do Android development from command line (for example, without using eclipse or any other bloated IDE). You must have installed the Android &#8230; <a href="http://pof.eslack.org/2012/01/25/android-development-from-command-line/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[	<p>As a quick reference, here&#8217;s a list of useful and most commonly used commands if you want to do Android development from command line (for example, without using eclipse or any other bloated IDE). You must have installed the <a href="http://developer.android.com/sdk/index.html">Android SDK</a> on your system, and make sure the <tt>tools</tt> and <tt>platform-tools</tt> folders from the android SDK are available in your <tt>PATH</tt> environment variable:</p>
	<pre>
ANDROID_SDK=&quot;/home/user/android-sdk-linux_x86&quot;
export PATH=&quot;${PATH}:${ANDROID_SDK}/tools:${ANDROID_SDK}/platform-tools&quot;
</pre>
	<p><span id="more-1648"></span>If your SDK installation is not up to date, you can update it using the <code>android update sdk</code> command. To generate a list of system image targets use <code>android list targets</code>, this will produce output similar to this (stripped down for better readability):</p>
	<pre>
id: 1 or &quot;android-3&quot;
     Name: Android 1.5
     API level: 3
id: 3 or &quot;android-4&quot;
     Name: Android 1.6
     API level: 4
id: 5 or &quot;android-7&quot;
     Name: Android 2.1-update1
     API level: 7
id: 7 or &quot;android-8&quot;
     Name: Android 2.2
     API level: 8
id: 10 or &quot;android-9&quot;
     Name: Android 2.3.1
     API level: 9
id: 12 or &quot;android-10&quot;
     Name: Android 2.3.3
     API level: 10
id: 14 or &quot;android-11&quot;
     Name: Android 3.0
     API level: 11
</pre>
	<p>First thing you want to do is create an AVD (Android Virtual Device), this will create an emulator image where you can test your apps without using a real device, the android version used is specified with the <code>-t</code> command switch, and must be one of the targets available in the command we used avobe.</p>
	<pre>
android create avd -n &lt;name&gt; -t &lt;targetID&gt; [-&lt;option&gt; &lt;value&gt;] ...
</pre>
	<p>For example, to create an AVD running android 2.3.3, you would use the command <code>android create avd -n Android233 -t 12</code>.</p>
	<p>To list all existing AVDs, you can use the command <code>android list avd</code>, this will produce output similar to this:</p>
	<pre>
Available Android Virtual Devices:
    Name: Android233
  Target: Android 2.3.3 (API level 10)
    Skin: WVGA800
  Sdcard: 15M
---------
    Name: Android16
  Target: Android 1.6 (API level 4)
    Skin: WVGA800
</pre>
	<p>To delete an AVD we no longer need, we can use the command <code>android delete avd -n &lt;name&gt;</code>.<br />
To launch the AVD, just use the command <code>emulator -avd &lt;name&gt;</code>:</p>
	<p><img src="/archives/images/emulator16.png" alt="android emulator - AVD" title="Android Virtual Device" /></p>
	<p>Now it&#8217;s time to create our first project, we will use the command <code>android create project</code> with the following command line parameters:</p>
	<pre>
android create project --target 1 --name MyApp --path ./MyProject --activity MyActivity --package com.example.myapp
</pre>
	<p><code>Target</code> specifies the minimum android version our project will be able to run, <code>name</code> is just the name of the application, <code>path</code> specifies the path in your hard drive where the project will be stored, <code>activity</code> specifies the name of the first <tt>Activity</tt> that will be run when we launch the program (an <a href="http://developer.android.com/guide/topics/fundamentals/activities.html">Activity</a> is an application component that provides a screen with which users can interact in order to do something), and finally <code>package</code> specifies the namespace that will be used (it must be a unique package name across all packages installed on the Android system, following the same rules as for packages in Java).</p>
	<p>Now it&#8217;s time to fire up your favorite text editor (vim FTW!!), and start coding&#8230; if you don&#8217;t know where to start, a good starting point is reading the <a href="http://developer.android.com/guide/topics/fundamentals.html">Android Application Fundamentals</a> from the Android Developers guide.</p>
	<p>If you&#8217;re upgrading a project from an older version of the Android SDK or want to create a new project from existing code, we will use the command <code>android update project</code> as folows:</p>
	<pre>
android update project --name MyApp --target 2 --path ./MyProject
</pre>
	<p>The following commands are useful when you have finished coding your application and want to compile, run or debug it:</p>
	<p>Building in debug mode:</p>
	<pre>
cd ./MyProject &#038;&#038; ant debug
</pre>
	<p>Building in debug mode and install on already running emulator:</p>
	<pre>
cd ./MyProject &#038;&#038; ant install
</pre>
	<p>Automatically launch app on the running emulator after building it:</p>
	<pre>
adb shell 'am start -n com.example.myapp/.MyActivity'
</pre>
	<p>And now, all together: build in debug mode, install and run on emulator:</p>
	<pre>
cd ./MyProject &#038;&#038; ant install &#038;&#038; adb shell 'am start -n com.example.myapp/.MyActivity'
</pre>
	<p>When you are happy with the results, you might want to build your app in release mode, for example to publish it on the android market:</p>
	<pre>
cd ./MyProject &#038;&#038; ant release
</pre>
	<p>Note that output needs to be signed and zipaligned before it can be uploaded on the <a href="https://market.android.com/">Android Market</a>, you might want to read the <a href="http://developer.android.com/guide/publishing/app-signing.html">Signing Your Applications</a> chapter in the Development guide for instructions on how to generate your private key for signing your applications.</p>
	<p>If you want to build in release mode, with the output signed and aligned, you can do it by modifying the <tt>ant.properties</tt> file in your project as follows:</p>
	<pre>
echo &quot;key.store=path/to/my.keystore&quot; >> ./MyProject/ant.properties
echo &quot;key.alias=mykeystore&quot; >> ./MyProject/ant.properties
cd ./MyProject &#038;&#038; ant release
</pre>
	<p>Finally, to wrap up everything we will create a hello world app from command line:</p>
	<pre>
	
android create project --package com.example.helloandroid --activity HelloAndroid --target 2 --path ./HelloAndroid
	
tee ./HelloAndroid/src/com/example/helloandroid/HelloAndroid.java <<-EOF
package com.example.helloandroid;
	
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
	
public class HelloAndroid extends Activity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        TextView tv = new TextView(this);
        tv.setText(&quot;Hello, Android&quot;);
        setContentView(tv);
    }
}
EOF
android list avd
emulator -avd XXXXX &#038;
cd ./MyProject
adb devices
ant install
adb shell 'am start -n com.example.helloandroid/.HelloAndroid'
</pre>
	<p>Happy coding! <img src='http://pof.eslack.org/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />
</p>
]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2012/01/25/android-development-from-command-line/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Mount Android 4 Ice Cream Sandwitch on Linux</title>
		<link>http://pof.eslack.org/2011/12/20/mount-android-4-ice-cream-sandwitch-on-linux/</link>
		<comments>http://pof.eslack.org/2011/12/20/mount-android-4-ice-cream-sandwitch-on-linux/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 02:23:11 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[minipost]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[fuse]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[mtp]]></category>
		<category><![CDATA[ptp]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1614</guid>
		<description><![CDATA[I recently got a Galaxy Nexus running Android 4.0 Ice Cream Sandwitch, which by default does not support USB Mass Storage. When connected to the computer via USB cable, we can choose to connect it as a Media device (MTP), &#8230; <a href="http://pof.eslack.org/2011/12/20/mount-android-4-ice-cream-sandwitch-on-linux/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[I recently got a Galaxy Nexus running Android 4.0 Ice Cream Sandwitch, which by default does not support USB Mass Storage. When connected to the computer via USB cable, we can choose to connect it as a Media device (<a href="http://en.wikipedia.org/wiki/Media_Transfer_Protocol">MTP</a>), or as a Camera (<a href="http://en.wikipedia.org/wiki/Picture_Transfer_Protocol">PTP</a>), as you can see in the picture below:

<a href="http://pof.eslack.org/files/2011/12/Screenshot_2011-12-20-02-45-59.png"><img src="http://pof.eslack.org/files/2011/12/android-usb-computer.png" alt="Android USB computer connection" title="Screenshot_2011-12-20-02-45-59" width="240" class="aligncenter" /></a>

<h3>Option 1: PTP</h3>
If we choose to mount it as a camera, PTP is integrated nicely into nautilus and you can browse the folders, however only pictures and video filetypes are supported.

<h3>Option 2: MTP</h3>
If we want to use MTP on Linux, we need to install the package &#8216;mtpfs&#8217; first, and then mount the device on the desired mountpoint, on Ubuntu you can just type:
<pre>
$ sudo aptitude install mtpfs
$ mkdir ~/android/
$ mount.mtpfs ~/android/
</pre>

<h3>Option 3: adbfs</h3>
The third option is <a href="http://collectskin.com/adbfs/">adbfs</a>, a fuse filesystem for adb. You can get the source on <a href="https://github.com/isieo/adbFS">github</a>. Once compiled, make sure &#8220;USB debugging&#8221; is enabled in android settings, and you can mount the device as follows:
<pre>
$ adbfs /media/android/ -o modules=subdir -o subdir=/mnt/sdcard/
</pre>
This option is slower than MTP, however all contents are accessible as it uses adb pull/push commands in the background to retrieve the file contents.]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2011/12/20/mount-android-4-ice-cream-sandwitch-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>mini-howto: add google authenticator to a new device</title>
		<link>http://pof.eslack.org/2011/12/08/mini-howto-add-google-authenticator-to-a-new-device/</link>
		<comments>http://pof.eslack.org/2011/12/08/mini-howto-add-google-authenticator-to-a-new-device/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 18:43:44 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[android]]></category>
		<category><![CDATA[gadgets]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[minipost]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[2-step verification]]></category>
		<category><![CDATA[authenticator]]></category>
		<category><![CDATA[google authenticator]]></category>
		<category><![CDATA[new phone]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1610</guid>
		<description><![CDATA[Note: For this to work you need to have google authenticator working on a rooted device. Google authenticator stores user data in a sqlite database, so we can just get the key from there and move it on a different &#8230; <a href="http://pof.eslack.org/2011/12/08/mini-howto-add-google-authenticator-to-a-new-device/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[Note: For this to work you need to have google authenticator working on a rooted device.

Google authenticator stores user data in a sqlite database, so we can just get the key from there and move it on a different device, the process is as follows:
<pre>
$ adb pull /data/data/com.google.android.apps.authenticator/databases/databases
$ sqlite3 ./databases
sqlite> select * from accounts;
1|whatever@gmail.com|key|0|0
sqlite> .exit
</pre>
The third column contains the key you need to manually copy to the new phone. After that, google authenticator will work on both devices (you can check the time-based generated key is the same on both).]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2011/12/08/mini-howto-add-google-authenticator-to-a-new-device/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>lightum: auto adjust keyboard brightness on Linux MacBook</title>
		<link>http://pof.eslack.org/2011/12/04/lightum-auto-adjust-keyboard-brightness-on-macbook/</link>
		<comments>http://pof.eslack.org/2011/12/04/lightum-auto-adjust-keyboard-brightness-on-macbook/#comments</comments>
		<pubDate>Sun, 04 Dec 2011 11:52:44 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[lightum]]></category>
		<category><![CDATA[macbook]]></category>
		<category><![CDATA[ppa]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1596</guid>
		<description><![CDATA[If you are running Linux on your MacBookAir and want the keyboard light brightness changed automatically depending on the ambient light (just as OS X does), continue reading. I&#8217;ve written a small daemon named lightum, source is on github and &#8230; <a href="http://pof.eslack.org/2011/12/04/lightum-auto-adjust-keyboard-brightness-on-macbook/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[	<p>If you are running Linux on your MacBookAir and want the keyboard light brightness changed automatically depending on the ambient light (just as OS X does), continue reading.</p>
	<p>I&#8217;ve written a small daemon named <a href="https://github.com/poliva/lightum">lightum</a>, source is on github and licensed under GPL-2+.</p>
	<pre>
Usage:  lightum [-m value] [-p value] [-f]
        -m 0..255 : maximum brightness value between 1 and 255 (default=255)
        -p num    : number of seconds between light sensor polls (default=8)
        -f        : run in foreground (do not daemonize)
        -v        : verbose mode, useful for debugging with -f
</pre>
	<p>For it to work you need dbus installed, and your MacBook should have the light sensor located in <tt>/sys/devices/platform/applesmc.768/light</tt> (should be available on all MacBookAir and MacBookPro versions which have a backlight on keyboard, as far as I know).</p>
	<p>If you are running Ubuntu, you can install it by adding <a href="https://launchpad.net/~poliva/+archive/lightum-mba">lightum-mba ppa</a> to your system:<br />
<code><br />
sudo add-apt-repository ppa:poliva/lightum-mba<br />
sudo apt-get update<br />
sudo apt-get install lightum<br />
</code></p>
	<p>Otherwise, you can build it from <a href="https://github.com/poliva/lightum/tarball/master">source</a>.
</p>
]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2011/12/04/lightum-auto-adjust-keyboard-brightness-on-macbook/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		</item>
		<item>
		<title>Change workspace configuration on Ubuntu 11.10</title>
		<link>http://pof.eslack.org/2011/10/03/change-workspace-configuration-on-ubuntu-11-10/</link>
		<comments>http://pof.eslack.org/2011/10/03/change-workspace-configuration-on-ubuntu-11-10/#comments</comments>
		<pubDate>Mon, 03 Oct 2011 20:54:10 +0000</pubDate>
		<dc:creator>pof</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[minipost]]></category>
		<category><![CDATA[desktop]]></category>
		<category><![CDATA[gconf]]></category>
		<category><![CDATA[gnome3]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[unity]]></category>
		<category><![CDATA[workspace]]></category>

		<guid isPermaLink="false">http://pof.eslack.org/?p=1589</guid>
		<description><![CDATA[By default Ubuntu 11.10 with unity interface has a 2&#215;2 workspace, however I am used to have a single row horizontal 4&#215;1 workspace with 4 desktops. I haven&#8217;t found any option under settings to change this, but here&#8217;s a workaround: &#8230; <a href="http://pof.eslack.org/2011/10/03/change-workspace-configuration-on-ubuntu-11-10/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>By default Ubuntu 11.10 with unity interface has a 2&#215;2 workspace, however I am used to have a single row horizontal 4&#215;1 workspace with 4 desktops. I haven&#8217;t found any option under settings to change this, but here&#8217;s a workaround:</p>

<p>Edit the file <code>~/.gconf/apps/compiz-1/general/screen0/options/%gconf.xml</code> and add two new gconf entries as follows:</p>

<pre>
&lt;?xml version="1.0"?&gt;
&lt;gconf&gt;
        &lt;entry name="hsize" mtime="1317329603" type="int" value="4"/&gt;
        &lt;entry name="vsize" mtime="1317329604" type="int" value="1"/&gt;
&lt;/gconf&gt;
</pre>

Edit the hsize and vsize values to fit your needs <img src='http://pof.eslack.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ]]></content:encoded>
			<wfw:commentRss>http://pof.eslack.org/2011/10/03/change-workspace-configuration-on-ubuntu-11-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
