<?xml version="1.0"?>
<!-- generator="FooPlanet(www.senko.net)" -->
<rss version="2.0">
  <channel>
    <title>Planet Linux.hr</title>
    <link>http://planet.linux.hr/</link>
    <description>
      Planet Linux.hr is an aggregation of Linux and Open Source themed blogs written by Croatian people from the whole wide world.
    </description>
    <pubDate>Tue, 04 Feb 2020 13:30:53 +0200</pubDate>
    <generator>FooPlanet (www.senko.net)</generator>
      <item>
        <title>BalCCon 2k19 - So, is Android a Linux?</title>
	<link>http://blog.rot13.org/2019/09/balccon-2k19---so-is-android-a-linux.html</link>
	<pubDate>November 04, 2019 15:21</pubDate>
	<description>
	  &lt;p&gt;
Last weekend I had pleasure to attend &lt;a href="https://2k19.balccon.org/"&gt;BalCCon 2k19&lt;/a&gt; and present my talk &lt;em&gt;So, is Android a Linux?&lt;/em&gt; which is embedded below. It was great conference and I hope that my talk gave some food for though and hints how to run Linux on Android devices.
&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2019/09/balccon-2k19---so-is-android-a-linux.html
	</guid>
      </item>
      <item>
        <title>Emulate IR remote for TV or HVAC from command-line using Tasmota</title>
	<link>http://blog.rot13.org/2019/08/emulate-ir-remote-for-tv-or-hvac-from-command-line-using-tasmota.html</link>
	<pubDate>August 17, 2019 17:04</pubDate>
	<description>
	  &lt;p&gt;
I don't have TV remote. I did get one, but as soon as I installed TV I realized that it's quite annoying to find remote to turn TV on when I sit with my wireless keyboard (computer is the only device connected to TV). So, I added keyboard shortcut using xbindkeys, addad IR led to Raspberry Pi, configured lirc and was happy about it. And then, buster with kernel 4.19 came and everything changed.
&lt;/p&gt;

&lt;h3&gt;Send IR to TV&lt;/h3&gt;
&lt;p&gt;
Upgrade to 4.19 kernel should be easy, only thing you have to do (if your IR sending diode is on pin 18) is to enable new overlay:

&lt;pre&gt;
# pwm works only on 18
dtoverlay=pwm-ir-tx,gpio_pin=18
&lt;/pre&gt;

This does not work reliably for me on Raspberry Pi 1. My TV detect roughly every third key press and this makes command-line TV remote solution useless because you can use TV menus to setup picture any more.
&lt;/p&gt;
&lt;p&gt;
So, I had to do something. Getting up and pressing button on TV is not something that I can live with after having this automation working for year (and TV remote was missing by now). But, I had all required components.
&lt;/p&gt;
&lt;p&gt;
Few weeks ago, I removed IR send/receive board from RMmini 3 and documented it's pinout:
&lt;/p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2019/08/RMmini3-ir-pinout-273.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2019/08/RMmini3-ir-pinout-thumb-320xauto-273.jpg" width="320" height="240" alt="RMmini3-ir-pinout.jpg" class="mt-image-center" /&gt;&lt;/a&gt;
&lt;p&gt;
I was also in the middle of flashing Sonoff-Tasmota to bunch of Tackin plugs so it seemed like logical step to flash Tasmota to NodeMCU board, connect RMmini 3 IR board to it and give it a try. And I'm glad I did.
&lt;/p&gt;
&lt;p&gt;
I used to have http server (simple perl script) running on Raspberry Pi which used irsend to send IR codes. From xbindkey perspective, my configuration used curl and all I had to do to get IR working again was changing my script to use mosquitto instead of irsend:
&lt;pre&gt;
mosquitto_pub -h rpi2 -q 2 -t cmnd/ir/IRSend -m '{"protocol": "NEC","bits": 32, "data": 0x20DF10EF}'
&lt;/pre&gt;
At this point I realized that I can put this into &lt;tt&gt;.xbindkeyrc&lt;/tt&gt; and contact esp8266 directly. This didn't work... You can't have double quotes in commands which are executed and I had to put it into shell script and call that. 
&lt;/p&gt;
&lt;p&gt;
And to my amazement, &lt;b&gt;there was noticeable difference in response time of TV&lt;/b&gt;. In retrospect, this seemed obvious because my TV nuc is much faster than Raspberry Pi, but this was probably the most unexpected benefit of this upgrade.
&lt;/p&gt;
&lt;p&gt;
When I said that you have to connect IR receiver and sender on NodeMCU pins, you have to take care not to hit pins that have special purpose on power-up. For example, if you connect something that will pull to ground on powerup (IR led for example) to gpio0 esp8266 will stay in boot loader mode.
gpio2 and gpio16 are led pins on nodemcu board, so don't use them (and define them as Led1i and Led2i in configuration).
&lt;/p&gt;
&lt;p&gt;
Having LEDs configured in tasmota allows me to extend my shell script and blink led after IR code has been sent:
&lt;pre&gt;
dpavlin@nuc:~$ cat tv-on.sh 
#!/bin/sh
mosquitto_pub -h rpi2 -q 2 -t cmnd/ir/IRSend -m '{"protocol": "NEC","bits": 32, "data": 0x20DF10EF}'
mosquitto_pub -h rpi2 -q 2 -t cmnd/ir/LedPower -m 1
mosquitto_pub -h rpi2 -q 2 -t cmnd/ir/LedPower -m 0
&lt;/pre&gt;
&lt;/p&gt;

&lt;h3&gt;Send IR to HVAC&lt;/h3&gt;
&lt;p&gt;
By pure luck, just a few days latter, my friend wanted to control his ACs from computer. Again tasmota came to the rescue. Since HVAC support in tasmota will increase firmware size over 512Kb  (which breaks OTA upgrade on 1Mb modules) it's not compiled in by default. However, you can edit &lt;tt&gt;sonoff/my_user_config.h&lt;/tt&gt; and uncomment it:
&lt;pre&gt;
    #define USE_IR_HVAC                          // Support for HVAC systems using IR (+3k5 code)
    #define USE_IR_HVAC_TOSHIBA                  // Support IRhvac Toshiba protocol
    #define USE_IR_HVAC_MITSUBISHI               // Support IRhvac Mitsubischi protocol
    #define USE_IR_HVAC_LG                       // Support IRhvac LG protocol
    #define USE_IR_HVAC_FUJITSU                  // Support IRhvac Fujitsu protocol
    #define USE_IR_HVAC_MIDEA                    // Support IRhvac Midea/Komeco protocol
&lt;/pre&gt;
However, if you want to keep OTA update working, you will also have to turn off some other configuration options (I don't use Domoticz or Home Assistant) to keep firmware size below 512Kb.
&lt;/p&gt;
&lt;p&gt;
To create IR sender, I decided to add IR LED, transistor and resistor to existing ESP-01 module with DHT11 board (which has 3.3v regulator on it) according to the following DaveCAD(tm) drawing:
&lt;/p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2019/08/ir-send-schematics-276.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2019/08/ir-send-schematics-thumb-autox331-276.jpg" width="320" height="331" alt="ir-send-schematics.jpg" class="mt-image-center" /&gt;&lt;/a&gt;
&lt;p&gt;
If you are wondering why I'm connecting IR led to RX pin (gpio3), it's because gpio0 is special, gpio2 is already used for dht11 and TX (which is gpio1) is also special. Since we don't need serial, using single pin left RX saves the day. And this is the picture of the first prototype (on which I tried all pins until I settled on RX):
&lt;/p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2019/08/esp-01-dht11-ir-279.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2019/08/esp-01-dht11-ir-thumb-320xauto-279.jpg" width="320" height="240" alt="esp-01-dht11-ir.jpg" class="mt-image-center" /&gt;&lt;/a&gt;
&lt;p&gt;
With all this in place and quick re-flash, we where than able to issue commands like this to control AC:
&lt;pre&gt;
mosquitto_pub -h rpi2 -t 'cmnd/ir/irhvac' -m '{ "Vendor": "Mitsubishi", "Power": 1, "Mode":"Cold", "Temp": 25}'

mosquitto_pub -h rpi2 -t 'cmnd/ir/irhvac' -m '{ "Vendor": "Mitsubishi", "Power": 0}'
&lt;/pre&gt;
So, with all this, I hope that you don't have any excuse not to control your IR devices from a command-line.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Update:&lt;/b&gt; Just to make sure that you don't think this is my best soldering ever here is also picture of 4 more modules which will be distributed to my friends.
&lt;/p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2019/08/IMG_20190802_134752%20%281%29-282.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2019/08/IMG_20190802_134752%20%281%29-thumb-320xauto-282.jpg" width="320" height="179" alt="IMG_20190802_134752 (1).jpg" class="mt-image-center" /&gt;&lt;/a&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2019/08/emulate-ir-remote-for-tv-or-hvac-from-command-line-using-tasmota.html
	</guid>
      </item>
      <item>
        <title>Samsung Galaxy S2 (ARM Phone) vs Ubuntu PC performance</title>
	<link>http://vrodic.blogspot.com/2012/05/samsung-galaxy-s2-vs-ubuntu-pc.html</link>
	<pubDate>July 30, 2019 12:32</pubDate>
	<description>
	  &lt;h2&gt;       Introduction&amp;nbsp;&lt;/h2&gt;(this post has been updated in 2016)&lt;br /&gt;&lt;br /&gt;It seems that many people assume that 1.2 GHz dual core mobile ARM CPU should be almost as fast as a PC CPU running on a similar frequency. They're wrong.&lt;br /&gt;&lt;br /&gt;ARM cores are indeed more power efficient per square mm of surface on a same production process than Intel x86 and AMD64 architecture processors. Most of the efficiency comes from a simpler and more space efficient instruction set, but that advantage typically benefits only front-end of the CPU, which is not the biggest spender of those precious miliwatts. &lt;br /&gt;&lt;br /&gt;The other reasons why modern dual or quad core mobile phones can run on a fraction of power that notebook or desktop (PC) CPUs need:  &lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;less computation units on CPU die (less SIMD, ALU, etc units)&lt;/li&gt;&lt;li&gt;smaller cache than PC CPUs&lt;/li&gt;&lt;li&gt;power gating parts of CPU (but laptop and desktop CPUs also do this for a number of years)&lt;/li&gt;&lt;li&gt;&lt;b&gt;significantly slower DRAM interface &amp;nbsp;than PC CPUs, using slower DDR RAM (LPDDR2)&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;RAM speed significantly impacts many parts of phone performance. Executing complex JavaScript, image or video processing, Web page rendering are just some of the tasks that significantly benefit from having more RAM bandwidth.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Your ARM device having significantly less of RAM bandwidth is also a big reason why you will probably avoid developing software on your new shiny ASUS Transformer Prime tablet/laptop (though I would certainly try:) )&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h2&gt;       So how much slower is your Android cell phone RAM than your PC RAM?&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unfortunately, I couldn't find any RAM&amp;nbsp;bench-marking&amp;nbsp;software that would run both on a Linux PC and on a un-rooted android device. There is a nice port of NBench, but NBench is a bigger benchmark and it needs some time before it prints out the one thing we need, the memory index. Also, it doesn't output MB/sec number, which is kind of unfortunate, since it's a really clear metric.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So I found the really simplistic &lt;a href="https://github.com/raas/mbw"&gt;mbw&lt;/a&gt;&amp;nbsp;(apt-get install mbw), made it even more simple (removed memcpy tests and left only the dumb array assignment part), and made Android NDK version of it.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;RAMbandwidth&lt;/b&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="separator"&gt;&lt;a href="https://github.com/vrodic/RAMbandwidth/blob/master/app-debug.apk?raw=true"&gt;https://github.com/vrodic/RAMbandwidth/blob/master/app-debug.apk?raw=true&lt;/a&gt;&lt;/div&gt;&lt;div class="separator"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Source &lt;a href="https://github.com/vrodic/RAMbandwidth"&gt;here&lt;/a&gt;. Be sure to close any apps before running it on a PC or your phone. Default array size being copied is 20 MB (the app needs 40 MB to perform the test) to better support low memory devices.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here are some results (20MB array size, 20 repetitions avg, run "mbw -t1 20 -n 20", default settings on RAMbandwidth, on some larger boxes 200MB size was used ):&lt;br /&gt;&lt;b&gt;~12500 MB/sec&lt;/b&gt;&amp;nbsp;Intel Core i7-6700, (DDR4 x2 2133 MHz), dedicated GPU&lt;br /&gt;&lt;b&gt;~12300 MB/sec &lt;/b&gt;-Intel Core i7-9700 (DDR4 x2 2133 MHz), driving&amp;nbsp;2560x1440@60Hz display, Ubuntu 19.04, Asrock H310M-STX DeskMini 310&lt;br /&gt;&lt;b&gt;~9000 MB/sec&lt;/b&gt; - Intel Core i7-8550U (DDR3 x2 2133 Mhz, Asus UX430UNR)&lt;br /&gt;&lt;b&gt;~9000 MB/sec &lt;/b&gt;- Intel Core i7-5600U (DDR3 x2 1600 MHz)&lt;br /&gt;&lt;b&gt;~8200 MB/sec&amp;nbsp;&lt;/b&gt;- Asus N56JR (Intel&amp;nbsp;&amp;nbsp;i7-4700HQ, 2x DDR3 1600 Mhz memory)&lt;br /&gt;&lt;b&gt;~6800 MB/sec &lt;/b&gt;- Intel Xeon&amp;nbsp;E5-1650 v2 4x DDR3 1600 MHz)&lt;br /&gt;&lt;b&gt;~5400 MB/sec&lt;/b&gt;&amp;nbsp;- Intel Xeon X3430, DDR3 memory, under moderate MySQL load( 2009)&lt;br /&gt;&lt;b&gt;~6000 MB/sec &lt;/b&gt;- Thinkpad X230 Core i5 3320M (2x &amp;nbsp;DDR3 1600Mhz)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;~3800 MB/sec&lt;/b&gt; - Core i3-2310M 2x DDR3 1333Mhz&lt;/div&gt;&lt;div&gt;&lt;b&gt;~2200 MB/sec&lt;/b&gt; - Intel Core 2 E8200, PC 6400 DDR2 RAM, Desktop PC (2008).&lt;/div&gt;&lt;div&gt;&lt;b&gt;~1100 MB/sec&lt;/b&gt;&amp;nbsp;- Intel Core duo L2400, PC 5300 DDR2 RAM on a &amp;nbsp;Thinkpad X60S laptop (2006).&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;and our mobile contenders&lt;br /&gt;&lt;br /&gt;&lt;b&gt;~6000 MB/sec&lt;/b&gt;&amp;nbsp;- Xiaomi Pocophone F1 (Snapdragon 845 varies between 5700-7000)&lt;br /&gt;&lt;b&gt;~6000 MB/sec&amp;nbsp;&lt;/b&gt;-&lt;b&gt;&amp;nbsp;&lt;/b&gt;LG G5 (Snapdragon 820 4 GB LPDDR4 2016, varies between 5800-6500)&lt;br /&gt;&lt;b&gt;~1500 MB/sec &lt;/b&gt;- LG G3 (3GB D855 - It varies from 800-1700)&lt;br /&gt;&lt;b&gt;~1200 MB/sec &lt;/b&gt;-&amp;nbsp;Raspberry Pi 3&lt;br /&gt;&lt;b&gt;~690 MB/sec&lt;/b&gt; - Doogee Valencia2 Y100 Pro&lt;br /&gt;&lt;b&gt;~530 MB/sec&lt;/b&gt;- Raspberry Pi 2&lt;/div&gt;&lt;div&gt;&lt;b&gt;~500 MB/sec &lt;/b&gt;- Samsung &amp;nbsp;Galaxy S2 (2011)&lt;/div&gt;&lt;div&gt;&lt;b&gt;~250 MB/sec&lt;/b&gt;&amp;nbsp;- HTC Desire (2010)&lt;br /&gt;&lt;b&gt;~120 MB/sec - Raspberry PI (2012, under X, fbdev 720p it falls to ~90 MB/sec)&lt;/b&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;b&gt;~55 MB/sec&lt;/b&gt; - HTC Magic (2009, had to use smaller 10MB array size because of limited RAM available)&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Samsung Galaxy S2 sometimes reports&amp;nbsp;around&amp;nbsp;440 MB/sec, and sometimes 550 MB/sec. I guess it depends where kernel allocates the memory, maybe one of the memory banks shares the bus with the GPU, GSM CPU or some other greedy device.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;It should be easy to post some test results of your own hardware, so please share.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;EDIT: Check comments for some more results&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2012/05/samsung-galaxy-s2-vs-ubuntu-pc.html
	</guid>
      </item>
      <item>
        <title>DORS/CLUC 2019: Mainline kernel on ARM Tegra20 devices that are left behind on 2.6 kernels</title>
	<link>http://blog.rot13.org/2019/05/dorscluc-2019-mainline-kernel-on-arm-tegra20-devices-that-are-left-behind-on-26-kernels.html</link>
	<pubDate>May 28, 2019 09:58</pubDate>
	<description>
	  &lt;p&gt;
Is it possible to take obsolete Android device and port it to mainline kernel with Debian? (make RaspberryPi-like device)
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
        &lt;p&gt;Here is transcript of presentation:&lt;/p&gt;

&lt;p&gt;0:00:00.000,0:00:04.529&lt;br /&gt;
I hope that you have enjoyed the first day of DORS&lt;/p&gt;

&lt;p&gt;0:00:01.949,0:00:08.030&lt;br /&gt;
CLUC. My name is Dobrica PavlinuÃÂÃÂ¡iÃÂÃÂ&lt;/p&gt;

&lt;p&gt;0:00:04.529,0:00:11.010&lt;br /&gt;
and today I will talk about to you about&lt;/p&gt;

&lt;p&gt;0:00:08.030,0:00:15.480&lt;br /&gt;
how you can take the old Android device&lt;/p&gt;

&lt;p&gt;0:00:11.010,0:00:18.840&lt;br /&gt;
and port the latest software on it. Over&lt;/p&gt;

&lt;p&gt;0:00:15.480,0:00:23.580&lt;br /&gt;
there is my prop for this presentation&lt;/p&gt;

&lt;p&gt;0:00:18.840,0:00:26.789&lt;br /&gt;
which tries to prove that it's really&lt;/p&gt;

&lt;p&gt;0:00:23.580,0:00:29.609&lt;br /&gt;
possiblei.  So the question is: is it&lt;/p&gt;

&lt;p&gt;0:00:26.789,0:00:32.430&lt;br /&gt;
possible to take the old Android device,&lt;/p&gt;

&lt;p&gt;0:00:29.609,0:00:37.020&lt;br /&gt;
in this case very old Android device, and&lt;/p&gt;

&lt;p&gt;0:00:32.430,0:00:39.420&lt;br /&gt;
run latest Linux on it? In my case I&lt;/p&gt;

&lt;p&gt;0:00:37.020,0:00:42.600&lt;br /&gt;
wanted to make something which would be&lt;/p&gt;

&lt;p&gt;0:00:39.420,0:00:45.420&lt;br /&gt;
comparable to Respberry Pi which basically&lt;/p&gt;

&lt;p&gt;0:00:42.600,0:00:49.980&lt;br /&gt;
for me means that I could run Debian on&lt;/p&gt;

&lt;p&gt;0:00:45.420,0:00:56.100&lt;br /&gt;
it. So what is our device? Our device is&lt;/p&gt;

&lt;p&gt;0:00:49.980,0:00:59.280&lt;br /&gt;
Tegra tablet from 2011 which is actually&lt;/p&gt;

&lt;p&gt;0:00:56.100,0:01:02.280&lt;br /&gt;
quite a high-end tablet for that age, it&lt;/p&gt;

&lt;p&gt;0:00:59.280,0:01:06.869&lt;br /&gt;
has two cores with 1 Gb RAM, it has&lt;/p&gt;

&lt;p&gt;0:01:02.280,0:01:10.439&lt;br /&gt;
64 Gb of emmc storage, if you&lt;/p&gt;

&lt;p&gt;0:01:06.869,0:01:15.140&lt;br /&gt;
remember in 2011 that's a huge amount of&lt;/p&gt;

&lt;p&gt;0:01:10.439,0:01:20.189&lt;br /&gt;
storage, it has quite nice display and&lt;/p&gt;

&lt;p&gt;0:01:15.140,0:01:22.740&lt;br /&gt;
Wi-Fi, GPS and stuff like that. The things&lt;/p&gt;

&lt;p&gt;0:01:20.189,0:01:27.200&lt;br /&gt;
which were available from the&lt;/p&gt;

&lt;p&gt;0:01:22.740,0:01:29.700&lt;br /&gt;
manufacturer is really old 2.6.36 kernel&lt;/p&gt;

&lt;p&gt;0:01:27.200,0:01:33.180&lt;br /&gt;
fortunately available in source code&lt;/p&gt;

&lt;p&gt;0:01:29.700,0:01:38.579&lt;br /&gt;
which is very helpful with quite a lot&lt;/p&gt;

&lt;p&gt;0:01:33.180,0:01:41.490&lt;br /&gt;
of changes, there was also schematic&lt;/p&gt;

&lt;p&gt;0:01:38.579,0:01:44.579&lt;br /&gt;
available from the OEM manufacturer&lt;/p&gt;

&lt;p&gt;0:01:41.490,0:01:49.020&lt;br /&gt;
which actually produced that laptop for&lt;/p&gt;

&lt;p&gt;0:01:44.579,0:01:51.299&lt;br /&gt;
Lenovo which was quite fortunate but not&lt;/p&gt;

&lt;p&gt;0:01:49.020,0:01:54.149&lt;br /&gt;
as useful as you might think&lt;/p&gt;

&lt;p&gt;0:01:51.299,0:01:56.520&lt;br /&gt;
so if you can't find the same schematic&lt;/p&gt;

&lt;p&gt;0:01:54.149,0:02:01.950&lt;br /&gt;
for your Android tablet or device don't&lt;/p&gt;

&lt;p&gt;0:01:56.520,0:02:05.729&lt;br /&gt;
don't despair it's not obligatory there&lt;/p&gt;

&lt;p&gt;0:02:01.950,0:02:08.520&lt;br /&gt;
is quite good Tegra support in the&lt;/p&gt;

&lt;p&gt;0:02:05.729,0:02:11.250&lt;br /&gt;
mainline kernel and as you'll see there&lt;/p&gt;

&lt;p&gt;0:02:08.520,0:02:12.950&lt;br /&gt;
is also separately developed driver&lt;/p&gt;

&lt;p&gt;0:02:11.250,0:02:16.310&lt;br /&gt;
which supports&lt;/p&gt;

&lt;p&gt;0:02:12.950,0:02:19.819&lt;br /&gt;
both 2d and 3d acceleration as you can&lt;/p&gt;

&lt;p&gt;0:02:16.310,0:02:22.580&lt;br /&gt;
see it's my prop over there, and they&lt;/p&gt;

&lt;p&gt;0:02:19.819,0:02:24.830&lt;br /&gt;
were available really cheaply locally&lt;/p&gt;

&lt;p&gt;0:02:22.580,0:02:28.849&lt;br /&gt;
basically I bought it at NjuÃÂÃÂ¡kalo&lt;/p&gt;

&lt;p&gt;0:02:24.830,0:02:34.340&lt;br /&gt;
which is our local secondhand resale&lt;/p&gt;

&lt;p&gt;0:02:28.849,0:02:37.250&lt;br /&gt;
kind of site. So what is the first step&lt;/p&gt;

&lt;p&gt;0:02:34.340,0:02:39.620&lt;br /&gt;
if you want to do something like that? My&lt;/p&gt;

&lt;p&gt;0:02:37.250,0:02:41.660&lt;br /&gt;
suggestion is to try to find the serial&lt;/p&gt;

&lt;p&gt;0:02:39.620,0:02:44.750&lt;br /&gt;
port on your device. It would be really&lt;/p&gt;

&lt;p&gt;0:02:41.660,0:02:48.500&lt;br /&gt;
really helpful when you try to do that&lt;/p&gt;

&lt;p&gt;0:02:44.750,0:02:51.290&lt;br /&gt;
because first thing you want to do is&lt;/p&gt;

&lt;p&gt;0:02:48.500,0:02:57.019&lt;br /&gt;
get some kind of feedback from your&lt;/p&gt;

&lt;p&gt;0:02:51.290,0:03:00.049&lt;br /&gt;
tablet.  In my case see the screen didn't&lt;/p&gt;

&lt;p&gt;0:02:57.019,0:03:02.000&lt;br /&gt;
work so the serial port was really&lt;/p&gt;

&lt;p&gt;0:03:00.049,0:03:06.440&lt;br /&gt;
invaluable to see whether I am actually&lt;/p&gt;

&lt;p&gt;0:03:02.000,0:03:09.140&lt;br /&gt;
doing something or not. In this case I&lt;/p&gt;

&lt;p&gt;0:03:06.440,0:03:12.950&lt;br /&gt;
had a schematic so I knew that there is&lt;/p&gt;

&lt;p&gt;0:03:09.140,0:03:16.340&lt;br /&gt;
a four pin port somewhere on the tablet&lt;/p&gt;

&lt;p&gt;0:03:12.950,0:03:18.680&lt;br /&gt;
on which is serial port, I also from the&lt;/p&gt;

&lt;p&gt;0:03:16.340,0:03:20.420&lt;br /&gt;
schematic knew that this serial port is&lt;/p&gt;

&lt;p&gt;0:03:18.680,0:03:23.329&lt;br /&gt;
connected directly to the Tegra&lt;/p&gt;

&lt;p&gt;0:03:20.420,0:03:26.750&lt;br /&gt;
processor which in my case meant that&lt;/p&gt;

&lt;p&gt;0:03:23.329,0:03:28.640&lt;br /&gt;
this serial port is 1.8 volts which&lt;/p&gt;

&lt;p&gt;0:03:26.750,0:03:32.269&lt;br /&gt;
means that you don't want to connect it&lt;/p&gt;

&lt;p&gt;0:03:28.640,0:03:36.320&lt;br /&gt;
to 3.3 volt device although Tegra CPUs&lt;/p&gt;

&lt;p&gt;0:03:32.269,0:03:39.140&lt;br /&gt;
might be 3.3 volt tolerable but, I don't&lt;/p&gt;

&lt;p&gt;0:03:36.320,0:03:44.150&lt;br /&gt;
know, you don't want to try that on your&lt;/p&gt;

&lt;p&gt;0:03:39.140,0:03:47.239&lt;br /&gt;
device. But there is 1.8 volts serial&lt;/p&gt;

&lt;p&gt;0:03:44.150,0:03:50.660&lt;br /&gt;
cable available from China which are&lt;/p&gt;

&lt;p&gt;0:03:47.239,0:03:52.880&lt;br /&gt;
basically often often dubbed iPhone&lt;/p&gt;

&lt;p&gt;0:03:50.660,0:03:57.430&lt;br /&gt;
cables because it uses the same voltage&lt;/p&gt;

&lt;p&gt;0:03:52.880,0:03:57.430&lt;br /&gt;
but it's just the serial at 1.8 volts.&lt;/p&gt;

&lt;p&gt;0:03:58.420,0:04:05.150&lt;br /&gt;
Why do I have the picture of the serial&lt;/p&gt;

&lt;p&gt;0:04:01.310,0:04:08.090&lt;br /&gt;
port? Because in this case this was not&lt;/p&gt;

&lt;p&gt;0:04:05.150,0:04:11.630&lt;br /&gt;
the only unpopulated connector of the on&lt;/p&gt;

&lt;p&gt;0:04:08.090,0:04:14.780&lt;br /&gt;
the board with 4 pins, so learn from my&lt;/p&gt;

&lt;p&gt;0:04:11.630,0:04:16.579&lt;br /&gt;
mistakes and don't try every possible&lt;/p&gt;

&lt;p&gt;0:04:14.780,0:04:19.700&lt;br /&gt;
connector and until you find the right&lt;/p&gt;

&lt;p&gt;0:04:16.579,0:04:21.950&lt;br /&gt;
one. It took me quite quite some time to&lt;/p&gt;

&lt;p&gt;0:04:19.700,0:04:26.479&lt;br /&gt;
figure out that maybe it's under the&lt;/p&gt;

&lt;p&gt;0:04:21.950,0:04:30.560&lt;br /&gt;
shield and it really was! The other thing&lt;/p&gt;

&lt;p&gt;0:04:26.479,0:04:35.570&lt;br /&gt;
which you want to have some ability to&lt;/p&gt;

&lt;p&gt;0:04:30.560,0:04:38.390&lt;br /&gt;
do and you almost always have: basically&lt;/p&gt;

&lt;p&gt;0:04:35.570,0:04:42.229&lt;br /&gt;
you always have it -- is to be able to run&lt;/p&gt;

&lt;p&gt;0:04:38.390,0:04:44.270&lt;br /&gt;
your own code on the device. Why do you&lt;/p&gt;

&lt;p&gt;0:04:42.229,0:04:47.659&lt;br /&gt;
always have that on the Android devices?&lt;/p&gt;

&lt;p&gt;0:04:44.270,0:04:50.479&lt;br /&gt;
Because when manufacturers create the&lt;/p&gt;

&lt;p&gt;0:04:47.659,0:04:53.330&lt;br /&gt;
device you should be able&lt;/p&gt;

&lt;p&gt;0:04:50.479,0:04:56.539&lt;br /&gt;
somehow to load the initial firmware on&lt;/p&gt;

&lt;p&gt;0:04:53.330,0:05:00.050&lt;br /&gt;
it. So if we have any ARM device either&lt;/p&gt;

&lt;p&gt;0:04:56.539,0:05:03.470&lt;br /&gt;
Allwinner, Rockchip, Tegra or anything,&lt;/p&gt;

&lt;p&gt;0:05:00.050,0:05:07.190&lt;br /&gt;
there is a way to actually load your own&lt;/p&gt;

&lt;p&gt;0:05:03.470,0:05:09.890&lt;br /&gt;
code on it, so that's not the showstopper.&lt;/p&gt;

&lt;p&gt;0:05:07.190,0:05:12.860&lt;br /&gt;
Tegra is somewhat specific because there&lt;/p&gt;

&lt;p&gt;0:05:09.890,0:05:17.320&lt;br /&gt;
is ability to lock Tegra bootloader&lt;/p&gt;

&lt;p&gt;0:05:12.860,0:05:20.090&lt;br /&gt;
so you can't load the non-authorized&lt;/p&gt;

&lt;p&gt;0:05:17.320,0:05:22.940&lt;br /&gt;
software on it, but this was not the case&lt;/p&gt;

&lt;p&gt;0:05:20.090,0:05:25.640&lt;br /&gt;
in this case. In Tegra it's called APX&lt;/p&gt;

&lt;p&gt;0:05:22.940,0:05:32.870&lt;br /&gt;
mode, you can enter it using two keyboard&lt;/p&gt;

&lt;p&gt;0:05:25.640,0:05:35.599&lt;br /&gt;
presses and with tegrarcm from github&lt;/p&gt;

&lt;p&gt;0:05:32.870,0:05:37.760&lt;br /&gt;
you can actually create the binary file&lt;/p&gt;

&lt;p&gt;0:05:35.599,0:05:40.150&lt;br /&gt;
which you can send to your tablet and&lt;/p&gt;

&lt;p&gt;0:05:37.760,0:05:43.909&lt;br /&gt;
make it do something.&lt;/p&gt;

&lt;p&gt;0:05:40.150,0:05:46.219&lt;br /&gt;
This ability to to load&lt;/p&gt;

&lt;p&gt;0:05:43.909,0:05:46.700&lt;br /&gt;
something on the device which is at that&lt;/p&gt;

&lt;p&gt;0:05:46.219,0:05:49.430&lt;br /&gt;
point&lt;/p&gt;

&lt;p&gt;0:05:46.700,0:05:51.530&lt;br /&gt;
unmodified enables you to actually&lt;/p&gt;

&lt;p&gt;0:05:49.430,0:05:54.169&lt;br /&gt;
experiment safely because you can always&lt;/p&gt;

&lt;p&gt;0:05:51.530,0:05:56.150&lt;br /&gt;
put something, try if it works, and you&lt;/p&gt;

&lt;p&gt;0:05:54.169,0:05:59.450&lt;br /&gt;
didn't actually change the device itself.&lt;/p&gt;

&lt;p&gt;0:05:56.150,0:06:01.520&lt;br /&gt;
Although this tablet was so unusable&lt;/p&gt;

&lt;p&gt;0:05:59.450,0:06:02.960&lt;br /&gt;
because it had so old Anrdoid that&lt;/p&gt;

&lt;p&gt;0:06:01.520,0:06:06.919&lt;br /&gt;
market didn't support&lt;/p&gt;

&lt;p&gt;0:06:02.960,0:06:10.130&lt;br /&gt;
it so it wasn't so essential.&lt;/p&gt;

&lt;p&gt;0:06:06.919,0:06:11.930&lt;br /&gt;
But you know, if this is your only device,&lt;/p&gt;

&lt;p&gt;0:06:10.130,0:06:15.500&lt;br /&gt;
you probably don't want to break it in&lt;/p&gt;

&lt;p&gt;0:06:11.930,0:06:19.070&lt;br /&gt;
your first experiment. But just have&lt;/p&gt;

&lt;p&gt;0:06:15.500,0:06:20.990&lt;br /&gt;
in mind that you won't break your device,&lt;/p&gt;

&lt;p&gt;0:06:19.070,0:06:24.530&lt;br /&gt;
it's always possible to recover it&lt;/p&gt;

&lt;p&gt;0:06:20.990,0:06:27.409&lt;br /&gt;
whatever the device is. So far what we&lt;/p&gt;

&lt;p&gt;0:06:24.530,0:06:29.479&lt;br /&gt;
have? We have working 2.6 kernel with all&lt;/p&gt;

&lt;p&gt;0:06:27.409,0:06:32.240&lt;br /&gt;
the changes needed to actually make this&lt;/p&gt;

&lt;p&gt;0:06:29.479,0:06:35.330&lt;br /&gt;
tablet work which isn't really very&lt;/p&gt;

&lt;p&gt;0:06:32.240,0:06:36.230&lt;br /&gt;
useful but it's nice because we can see&lt;/p&gt;

&lt;p&gt;0:06:35.330,0:06:39.380&lt;br /&gt;
what&lt;/p&gt;

&lt;p&gt;0:06:36.230,0:06:42.440&lt;br /&gt;
did they change to make this tablet&lt;/p&gt;

&lt;p&gt;0:06:39.380,0:06:45.590&lt;br /&gt;
work. I had a serial port and I had the&lt;/p&gt;

&lt;p&gt;0:06:42.440,0:06:47.390&lt;br /&gt;
ability to run my own code. So what is&lt;/p&gt;

&lt;p&gt;0:06:45.590,0:06:49.670&lt;br /&gt;
the first step? The first step is to have&lt;/p&gt;

&lt;p&gt;0:06:47.390,0:06:52.940&lt;br /&gt;
some kind of bootloader which will load&lt;/p&gt;

&lt;p&gt;0:06:49.670,0:06:57.230&lt;br /&gt;
our Linux kernel. On ARM devices this&lt;/p&gt;

&lt;p&gt;0:06:52.940,0:07:00.410&lt;br /&gt;
is u-boot and since this tablet is&lt;/p&gt;

&lt;p&gt;0:06:57.230,0:07:04.670&lt;br /&gt;
actually based on Ventana reference&lt;/p&gt;

&lt;p&gt;0:07:00.410,0:07:06.830&lt;br /&gt;
design from Nvidia, which you can&lt;/p&gt;

&lt;p&gt;0:07:04.670,0:07:11.450&lt;br /&gt;
actually figure out by looking at 2.6&lt;/p&gt;

&lt;p&gt;0:07:06.830,0:07:14.090&lt;br /&gt;
kernel, it was really simple to try to&lt;/p&gt;

&lt;p&gt;0:07:11.450,0:07:15.700&lt;br /&gt;
compile u-boot, try it out with APX&lt;/p&gt;

&lt;p&gt;0:07:14.090,0:07:20.900&lt;br /&gt;
and it worked!&lt;/p&gt;

&lt;p&gt;0:07:15.700,0:07:22.910&lt;br /&gt;
Few steps later I also ... got the&lt;/p&gt;

&lt;p&gt;0:07:20.900,0:07:24.890&lt;br /&gt;
serial output out of the bootloader&lt;/p&gt;

&lt;p&gt;0:07:22.910,0:07:26.840&lt;br /&gt;
which was the good first step, but&lt;/p&gt;

&lt;p&gt;0:07:24.890,0:07:27.050&lt;br /&gt;
display was completely blank. So what did I&lt;/p&gt;

&lt;p&gt;0:07:26.840,0:07:29.480&lt;br /&gt;
do?&lt;/p&gt;

&lt;p&gt;0:07:27.050,0:07:31.910&lt;br /&gt;
I took the diff from the 2.6&lt;/p&gt;

&lt;p&gt;0:07:29.480,0:07:34.880&lt;br /&gt;
kernel and looked what did they modify&lt;/p&gt;

&lt;p&gt;0:07:31.910,0:07:38.330&lt;br /&gt;
to make the display work? I ported that&lt;/p&gt;

&lt;p&gt;0:07:34.880,0:07:44.930&lt;br /&gt;
and I got even display in u-boot! mmm&lt;/p&gt;

&lt;p&gt;0:07:38.330,0:07:49.940&lt;br /&gt;
Victory! I said "port changes" -- it might&lt;/p&gt;

&lt;p&gt;0:07:44.930,0:07:52.460&lt;br /&gt;
seem extremely complicated or hard. but&lt;/p&gt;

&lt;p&gt;0:07:49.940,0:07:54.260&lt;br /&gt;
basically that's it! On the left side you&lt;/p&gt;

&lt;p&gt;0:07:52.460,0:07:57.200&lt;br /&gt;
see the changes which original&lt;/p&gt;

&lt;p&gt;0:07:54.260,0:07:59.060&lt;br /&gt;
developers made for 2.6 kernel and on&lt;/p&gt;

&lt;p&gt;0:07:57.200,0:08:00.950&lt;br /&gt;
the right side you can see the changes&lt;/p&gt;

&lt;p&gt;0:07:59.060,0:08:03.770&lt;br /&gt;
which I made in u-boot to make it work&lt;/p&gt;

&lt;p&gt;0:08:00.950,0:08:05.930&lt;br /&gt;
basically you compare the names of&lt;/p&gt;

&lt;p&gt;0:08:03.770,0:08:12.410&lt;br /&gt;
the variables, you change the few ones&lt;/p&gt;

&lt;p&gt;0:08:05.930,0:08:14.330&lt;br /&gt;
and it works. Once I had u-boot the&lt;/p&gt;

&lt;p&gt;0:08:12.410,0:08:16.820&lt;br /&gt;
next step was actually to compile the&lt;/p&gt;

&lt;p&gt;0:08:14.330,0:08:19.070&lt;br /&gt;
kernel and make it work. As I mentioned&lt;/p&gt;

&lt;p&gt;0:08:16.820,0:08:21.710&lt;br /&gt;
earlier there is the grate driver&lt;/p&gt;

&lt;p&gt;0:08:19.070,0:08:26.120&lt;br /&gt;
project which basically supports 2d and&lt;/p&gt;

&lt;p&gt;0:08:21.710,0:08:28.460&lt;br /&gt;
3d acceleration on Tegra devices so I&lt;/p&gt;

&lt;p&gt;0:08:26.120,0:08:33.530&lt;br /&gt;
actually started with it because I&lt;/p&gt;

&lt;p&gt;0:08:28.460,0:08:36.700&lt;br /&gt;
wanted 2d and 3d and video decoding I&lt;/p&gt;

&lt;p&gt;0:08:33.530,0:08:43.010&lt;br /&gt;
started in the same way I looked at 2.6&lt;/p&gt;

&lt;p&gt;0:08:36.700,0:08:46.340&lt;br /&gt;
kernel tried to port the display, it&lt;/p&gt;

&lt;p&gt;0:08:43.010,0:08:49.520&lt;br /&gt;
should be possible to define display&lt;/p&gt;

&lt;p&gt;0:08:46.340,0:08:53.120&lt;br /&gt;
in device tree itself, for some reason&lt;/p&gt;

&lt;p&gt;0:08:49.520,0:08:56.990&lt;br /&gt;
it did not work for me so this was few lines&lt;/p&gt;

&lt;p&gt;0:08:53.120,0:09:00.410&lt;br /&gt;
of diff in kernel itself, but other&lt;/p&gt;

&lt;p&gt;0:08:56.990,0:09:02.900&lt;br /&gt;
than that, all the other things were&lt;/p&gt;

&lt;p&gt;0:09:00.410,0:09:06.260&lt;br /&gt;
basically device tree configuration.&lt;/p&gt;

&lt;p&gt;0:09:02.900,0:09:09.770&lt;br /&gt;
I had to configure the buttons&lt;/p&gt;

&lt;p&gt;0:09:06.260,0:09:14.510&lt;br /&gt;
on the laptop to generate keyboard&lt;/p&gt;

&lt;p&gt;0:09:09.770,0:09:16.700&lt;br /&gt;
events and from 2.6 kernel it wasn't&lt;/p&gt;

&lt;p&gt;0:09:14.510,0:09:19.160&lt;br /&gt;
clear whether the button is both pull-up&lt;/p&gt;

&lt;p&gt;0:09:16.700,0:09:22.010&lt;br /&gt;
or pulldown but you try one, you try the&lt;/p&gt;

&lt;p&gt;0:09:19.160,0:09:24.320&lt;br /&gt;
other, and if you make a mistake, if you&lt;/p&gt;

&lt;p&gt;0:09:22.010,0:09:26.660&lt;br /&gt;
said that button is pulled down and it's&lt;/p&gt;

&lt;p&gt;0:09:24.320,0:09:28.190&lt;br /&gt;
pull up the thing which will happen is&lt;/p&gt;

&lt;p&gt;0:09:26.660,0:09:31.580&lt;br /&gt;
that when you press the button it&lt;/p&gt;

&lt;p&gt;0:09:28.190,0:09:34.100&lt;br /&gt;
it won't release, so you will figure it&lt;/p&gt;

&lt;p&gt;0:09:31.580,0:09:35.750&lt;br /&gt;
out. Basically some buttons are pull up&lt;/p&gt;

&lt;p&gt;0:09:34.100,0:09:39.130&lt;br /&gt;
some buttons are pull down, you just&lt;/p&gt;

&lt;p&gt;0:09:35.750,0:09:42.650&lt;br /&gt;
experiment a little and it will work out.&lt;/p&gt;

&lt;p&gt;0:09:39.130,0:09:44.720&lt;br /&gt;
Then I added a few additional&lt;/p&gt;

&lt;p&gt;0:09:42.650,0:09:47.630&lt;br /&gt;
modules which were supported in upstream&lt;/p&gt;

&lt;p&gt;0:09:44.720,0:09:50.930&lt;br /&gt;
kernel already, like a temperature sensor&lt;/p&gt;

&lt;p&gt;0:09:47.630,0:09:54.800&lt;br /&gt;
compass and there is also in tablet&lt;/p&gt;

&lt;p&gt;0:09:50.930,0:09:56.690&lt;br /&gt;
accelerometer which should be&lt;/p&gt;

&lt;p&gt;0:09:54.800,0:09:59.300&lt;br /&gt;
supported by the kernel module, but&lt;/p&gt;

&lt;p&gt;0:09:56.690,0:10:03.470&lt;br /&gt;
currently doesn't work -- work in&lt;/p&gt;

&lt;p&gt;0:09:59.300,0:10:06.050&lt;br /&gt;
progress -- but all in all this diff --stat&lt;/p&gt;

&lt;p&gt;0:10:03.470,0:10:09.830&lt;br /&gt;
at the bottom of the slide are all the&lt;/p&gt;

&lt;p&gt;0:10:06.050,0:10:13.040&lt;br /&gt;
changes which were required to make this&lt;/p&gt;

&lt;p&gt;0:10:09.830,0:10:19.270&lt;br /&gt;
tablet, over there, which actually started&lt;/p&gt;

&lt;p&gt;0:10:13.040,0:10:24.800&lt;br /&gt;
screensaver, working on the latest kernel&lt;/p&gt;

&lt;p&gt;0:10:19.270,0:10:27.170&lt;br /&gt;
not really so hard at all, right? As the&lt;/p&gt;

&lt;p&gt;0:10:24.800,0:10:29.540&lt;br /&gt;
next step and probably the most&lt;/p&gt;

&lt;p&gt;0:10:27.170,0:10:32.030&lt;br /&gt;
important thing which I learned during&lt;/p&gt;

&lt;p&gt;0:10:29.540,0:10:35.300&lt;br /&gt;
this process, is actually that you want&lt;/p&gt;

&lt;p&gt;0:10:32.030,0:10:37.190&lt;br /&gt;
to develop using NFS root. You don't&lt;/p&gt;

&lt;p&gt;0:10:35.300,0:10:40.040&lt;br /&gt;
actually want to experiment on the&lt;/p&gt;

&lt;p&gt;0:10:37.190,0:10:45.020&lt;br /&gt;
device itself because it's so convenient&lt;/p&gt;

&lt;p&gt;0:10:40.040,0:10:47.030&lt;br /&gt;
to actually edit files in VI on your NFS&lt;/p&gt;

&lt;p&gt;0:10:45.020,0:10:50.720&lt;br /&gt;
server which in my case is just a&lt;/p&gt;

&lt;p&gt;0:10:47.030,0:10:52.550&lt;br /&gt;
ordinary laptop instead of editing it on&lt;/p&gt;

&lt;p&gt;0:10:50.720,0:10:54.230&lt;br /&gt;
the device itself especially if the&lt;/p&gt;

&lt;p&gt;0:10:52.550,0:10:57.520&lt;br /&gt;
device itself doesn't have the keyboard.&lt;/p&gt;

&lt;p&gt;0:10:54.230,0:11:00.500&lt;br /&gt;
Right now I do have the keyboard but&lt;/p&gt;

&lt;p&gt;0:10:57.520,0:11:03.620&lt;br /&gt;
when I started I didn't have any device&lt;/p&gt;

&lt;p&gt;0:11:00.500,0:11:06.650&lt;br /&gt;
and it's you know it's really much more&lt;/p&gt;

&lt;p&gt;0:11:03.620,0:11:10.940&lt;br /&gt;
variable to do that on on your normal&lt;/p&gt;

&lt;p&gt;0:11:06.650,0:11:15.950&lt;br /&gt;
development machine. NFS will also enable&lt;/p&gt;

&lt;p&gt;0:11:10.940,0:11:18.140&lt;br /&gt;
you to to try different devices but the&lt;/p&gt;

&lt;p&gt;0:11:15.950,0:11:21.620&lt;br /&gt;
prerequisite for that is actually to&lt;/p&gt;

&lt;p&gt;0:11:18.140,0:11:23.290&lt;br /&gt;
have the USB Ethernet device which is&lt;/p&gt;

&lt;p&gt;0:11:21.620,0:11:26.320&lt;br /&gt;
supported by u-boot&lt;/p&gt;

&lt;p&gt;0:11:23.290,0:11:29.360&lt;br /&gt;
unfortunately u-boot support very few&lt;/p&gt;

&lt;p&gt;0:11:26.320,0:11:33.250&lt;br /&gt;
USB Ethernet dongle so you will have to&lt;/p&gt;

&lt;p&gt;0:11:29.360,0:11:36.529&lt;br /&gt;
find the one which is supported or port&lt;/p&gt;

&lt;p&gt;0:11:33.250,0:11:39.350&lt;br /&gt;
changes from some other USB dongle which&lt;/p&gt;

&lt;p&gt;0:11:36.529,0:11:42.650&lt;br /&gt;
is also not that hard but it wasn't&lt;/p&gt;

&lt;p&gt;0:11:39.350,0:11:47.210&lt;br /&gt;
needed because I actually had a dongle&lt;/p&gt;

&lt;p&gt;0:11:42.650,0:11:49.100&lt;br /&gt;
which is supported. The second&lt;/p&gt;

&lt;p&gt;0:11:47.210,0:11:53.330&lt;br /&gt;
interesting thing I learned here is the&lt;/p&gt;

&lt;p&gt;0:11:49.100,0:11:57.160&lt;br /&gt;
one marked here in yellow which is that&lt;/p&gt;

&lt;p&gt;0:11:53.330,0:12:00.950&lt;br /&gt;
the kernel configuration&lt;/p&gt;

&lt;p&gt;0:11:57.160,0:12:04.460&lt;br /&gt;
because you say to u-boot ok please&lt;/p&gt;

&lt;p&gt;0:12:00.950,0:12:06.860&lt;br /&gt;
use the DHCP acquire MAC address and&lt;/p&gt;

&lt;p&gt;0:12:04.460,0:12:09.830&lt;br /&gt;
then load the kernel and initramfs&lt;/p&gt;

&lt;p&gt;0:12:06.860,0:12:13.160&lt;br /&gt;
from the from the server and once&lt;/p&gt;

&lt;p&gt;0:12:09.830,0:12:16.880&lt;br /&gt;
you start the kernel the kernel also has&lt;/p&gt;

&lt;p&gt;0:12:13.160,0:12:20.900&lt;br /&gt;
the option to acquire address over DHCP but&lt;/p&gt;

&lt;p&gt;0:12:16.880,0:12:24.920&lt;br /&gt;
unfortunately that didn't work I suspect&lt;/p&gt;

&lt;p&gt;0:12:20.900,0:12:28.520&lt;br /&gt;
that it's problem with initialization of&lt;/p&gt;

&lt;p&gt;0:12:24.920,0:12:31.150&lt;br /&gt;
the USB interface in kernel so the&lt;/p&gt;

&lt;p&gt;0:12:28.520,0:12:34.430&lt;br /&gt;
interface is not initialized correctly&lt;/p&gt;

&lt;p&gt;0:12:31.150,0:12:37.490&lt;br /&gt;
or something, but you can always hard&lt;/p&gt;

&lt;p&gt;0:12:34.430,0:12:40.880&lt;br /&gt;
code the IP address and that worked. If&lt;/p&gt;

&lt;p&gt;0:12:37.490,0:12:42.709&lt;br /&gt;
you want more info about making u-boot&lt;/p&gt;

&lt;p&gt;0:12:40.880,0:12:45.770&lt;br /&gt;
work with the NFS root and&lt;/p&gt;

&lt;p&gt;0:12:42.709,0:12:49.010&lt;br /&gt;
configuration of dnsmasq the last link&lt;/p&gt;

&lt;p&gt;0:12:45.770,0:12:52.910&lt;br /&gt;
here is actually the wiki page in which&lt;/p&gt;

&lt;p&gt;0:12:49.010,0:12:55.220&lt;br /&gt;
you can find more information. And then I&lt;/p&gt;

&lt;p&gt;0:12:52.910,0:12:57.200&lt;br /&gt;
had the tablet which was somewhat&lt;/p&gt;

&lt;p&gt;0:12:55.220,0:13:00.860&lt;br /&gt;
working but the problem was that I&lt;/p&gt;

&lt;p&gt;0:12:57.200,0:13:03.560&lt;br /&gt;
couldn't charge it. Since this tablet is&lt;/p&gt;

&lt;p&gt;0:13:00.860,0:13:06.830&lt;br /&gt;
from 2011 you would expect that the&lt;/p&gt;

&lt;p&gt;0:13:03.560,0:13:09.950&lt;br /&gt;
battery is quite dead and it really is&lt;/p&gt;

&lt;p&gt;0:13:06.830,0:13:12.260&lt;br /&gt;
quite dead but it's really annoying that&lt;/p&gt;

&lt;p&gt;0:13:09.950,0:13:13.850&lt;br /&gt;
you can actually work several hours on&lt;/p&gt;

&lt;p&gt;0:13:12.260,0:13:16.130&lt;br /&gt;
your tablet and then you have to take&lt;/p&gt;

&lt;p&gt;0:13:13.850,0:13:16.400&lt;br /&gt;
another device which was charging during&lt;/p&gt;

&lt;p&gt;0:13:16.130,0:13:20.600&lt;br /&gt;
that&lt;/p&gt;

&lt;p&gt;0:13:16.400,0:13:25.430&lt;br /&gt;
time so I wanted to somehow make it work&lt;/p&gt;

&lt;p&gt;0:13:20.600,0:13:27.590&lt;br /&gt;
to make it work always, to have it&lt;/p&gt;

&lt;p&gt;0:13:25.430,0:13:32.560&lt;br /&gt;
always powered on and to be able to charge&lt;/p&gt;

&lt;p&gt;0:13:27.590,0:13:35.510&lt;br /&gt;
it from the USB. The problem is that this&lt;/p&gt;

&lt;p&gt;0:13:32.560,0:13:38.540&lt;br /&gt;
particular tablet is very sensitive to&lt;/p&gt;

&lt;p&gt;0:13:35.510,0:13:42.580&lt;br /&gt;
the 5 volt rail and if you don't have&lt;/p&gt;

&lt;p&gt;0:13:38.540,0:13:45.920&lt;br /&gt;
stable 5 volt rail it will try to&lt;/p&gt;

&lt;p&gt;0:13:42.580,0:13:48.530&lt;br /&gt;
to pull as much as 2 amps if the battery&lt;/p&gt;

&lt;p&gt;0:13:45.920,0:13:50.870&lt;br /&gt;
is totally flat and if the voltage drops&lt;/p&gt;

&lt;p&gt;0:13:48.530,0:13:52.910&lt;br /&gt;
a little bit below 5 volts it will&lt;/p&gt;

&lt;p&gt;0:13:50.870,0:13:55.580&lt;br /&gt;
just give up and say okay I won't charge&lt;/p&gt;

&lt;p&gt;0:13:52.910,0:13:58.010&lt;br /&gt;
so the tablet was charging quite nice&lt;/p&gt;

&lt;p&gt;0:13:55.580,0:14:00.800&lt;br /&gt;
when powered off but didn't charge with&lt;/p&gt;

&lt;p&gt;0:13:58.010,0:14:03.590&lt;br /&gt;
power on, so what could I do?&lt;/p&gt;

&lt;p&gt;0:14:00.800,0:14:08.660&lt;br /&gt;
Other than draw nice graphs which show&lt;/p&gt;

&lt;p&gt;0:14:03.590,0:14:11.930&lt;br /&gt;
my problems? Well I can look at 2.6&lt;/p&gt;

&lt;p&gt;0:14:08.660,0:14:14.630&lt;br /&gt;
kernel and see what did they do to actually&lt;/p&gt;

&lt;p&gt;0:14:11.930,0:14:19.130&lt;br /&gt;
make it work? This tablet is also&lt;/p&gt;

&lt;p&gt;0:14:14.630,0:14:21.650&lt;br /&gt;
somewhat specific in regards to other&lt;/p&gt;

&lt;p&gt;0:14:19.130,0:14:25.970&lt;br /&gt;
Android tablets because it has another&lt;/p&gt;

&lt;p&gt;0:14:21.650,0:14:28.250&lt;br /&gt;
processor which is 8051 core which&lt;/p&gt;

&lt;p&gt;0:14:25.970,0:14:31.100&lt;br /&gt;
basically talks with battery so I don't&lt;/p&gt;

&lt;p&gt;0:14:28.250,0:14:33.950&lt;br /&gt;
have direct connection with the &lt;/p&gt;

&lt;p&gt;0:14:31.100,0:14:36.860&lt;br /&gt;
battery controller but I have it through&lt;/p&gt;

&lt;p&gt;0:14:33.950,0:14:39.620&lt;br /&gt;
the firmware in that microcontroller&lt;/p&gt;

&lt;p&gt;0:14:36.860,0:14:43.610&lt;br /&gt;
which is connected to the Tegra device&lt;/p&gt;

&lt;p&gt;0:14:39.620,0:14:46.400&lt;br /&gt;
using i2c. This was in one sense annoying&lt;/p&gt;

&lt;p&gt;0:14:43.610,0:14:47.860&lt;br /&gt;
because if I could directly drive the&lt;/p&gt;

&lt;p&gt;0:14:46.400,0:14:50.480&lt;br /&gt;
battery charger it would be much easier&lt;/p&gt;

&lt;p&gt;0:14:47.860,0:14:53.000&lt;br /&gt;
but on the other hand that meant that&lt;/p&gt;

&lt;p&gt;0:14:50.480,0:14:55.850&lt;br /&gt;
the solution was rather simple I just&lt;/p&gt;

&lt;p&gt;0:14:53.000,0:14:59.060&lt;br /&gt;
had to send one i2c&lt;/p&gt;

&lt;p&gt;0:14:55.850,0:15:02.080&lt;br /&gt;
command copied from the 2.6 kernel and&lt;/p&gt;

&lt;p&gt;0:14:59.060,0:15:07.850&lt;br /&gt;
the tablet would start charging&lt;/p&gt;

&lt;p&gt;0:15:02.080,0:15:12.560&lt;br /&gt;
win/win/win and as you can see on the&lt;/p&gt;

&lt;p&gt;0:15:07.850,0:15:17.240&lt;br /&gt;
demo after recompiling the whole GL&lt;/p&gt;

&lt;p&gt;0:15:12.560,0:15:21.230&lt;br /&gt;
stack including libdrm, mesa and opentegra&lt;/p&gt;

&lt;p&gt;0:15:17.240,0:15:26.900&lt;br /&gt;
video driver I actually have x11 running&lt;/p&gt;

&lt;p&gt;0:15:21.230,0:15:29.680&lt;br /&gt;
on it without any problems whatsoever&lt;/p&gt;

&lt;p&gt;0:15:26.900,0:15:32.200&lt;br /&gt;
So what works and what doesn't?&lt;/p&gt;

&lt;p&gt;0:15:29.680,0:15:34.000&lt;br /&gt;
from the i2c devices on the left which&lt;/p&gt;

&lt;p&gt;0:15:32.200,0:15:36.820&lt;br /&gt;
are basically the list of the devices&lt;/p&gt;

&lt;p&gt;0:15:34.000,0:15:40.240&lt;br /&gt;
from the 2.6 kernel we can see that&lt;/p&gt;

&lt;p&gt;0:15:36.820,0:15:43.510&lt;br /&gt;
audio, charging, compas, power and&lt;/p&gt;

&lt;p&gt;0:15:40.240,0:15:45.910&lt;br /&gt;
temperature are working as is, the things&lt;/p&gt;

&lt;p&gt;0:15:43.510,0:15:47.620&lt;br /&gt;
which are denoted by the small hand are&lt;/p&gt;

&lt;p&gt;0:15:45.910,0:15:49.500&lt;br /&gt;
actually the things which I had to do&lt;/p&gt;

&lt;p&gt;0:15:47.620,0:15:53.140&lt;br /&gt;
something&lt;/p&gt;

&lt;p&gt;0:15:49.500,0:15:57.370&lt;br /&gt;
unfortunately the cameras are not&lt;/p&gt;

&lt;p&gt;0:15:53.140,0:16:00.820&lt;br /&gt;
supported but you know they're lousy&lt;/p&gt;

&lt;p&gt;0:15:57.370,0:16:03.490&lt;br /&gt;
cameras from 2011 and this tablet is&lt;/p&gt;

&lt;p&gt;0:16:00.820,0:16:07.149&lt;br /&gt;
still better than the Raspberry Pi&lt;/p&gt;

&lt;p&gt;0:16:03.490,0:16:11.709&lt;br /&gt;
diplay works, HDMI probably works, I didn't&lt;/p&gt;

&lt;p&gt;0:16:07.149,0:16:14.680&lt;br /&gt;
really test it the main drawback is that&lt;/p&gt;

&lt;p&gt;0:16:11.709,0:16:17.740&lt;br /&gt;
the touchscreen on this device is&lt;/p&gt;

&lt;p&gt;0:16:14.680,0:16:20.970&lt;br /&gt;
the SPI device which currently doesn't&lt;/p&gt;

&lt;p&gt;0:16:17.740,0:16:24.490&lt;br /&gt;
work for me the SPI doesn't work at all&lt;/p&gt;

&lt;p&gt;0:16:20.970,0:16:26.680&lt;br /&gt;
keys were really easy those were the key&lt;/p&gt;

&lt;p&gt;0:16:24.490,0:16:31.450&lt;br /&gt;
is connected to GPIO just a little bit&lt;/p&gt;

&lt;p&gt;0:16:26.680,0:16:35.290&lt;br /&gt;
of device tree, the vibrator there is a&lt;/p&gt;

&lt;p&gt;0:16:31.450,0:16:38.230&lt;br /&gt;
small vibrating motor in the tablet,&lt;/p&gt;

&lt;p&gt;0:16:35.290,0:16:40.209&lt;br /&gt;
actually doesn't work for me I really&lt;/p&gt;

&lt;p&gt;0:16:38.230,0:16:44.860&lt;br /&gt;
don't know why there is nothing special&lt;/p&gt;

&lt;p&gt;0:16:40.209,0:16:47.680&lt;br /&gt;
in 2.6 kernel for it but if I toggle the&lt;/p&gt;

&lt;p&gt;0:16:44.860,0:16:51.520&lt;br /&gt;
pin nothing happens and it does work in&lt;/p&gt;

&lt;p&gt;0:16:47.680,0:16:54.339&lt;br /&gt;
2.6 so more work needs to be done&lt;/p&gt;

&lt;p&gt;0:16:51.520,0:16:58.680&lt;br /&gt;
there is also the proximity sensor which&lt;/p&gt;

&lt;p&gt;0:16:54.339,0:17:02.500&lt;br /&gt;
works also one simple GPIO there is the&lt;/p&gt;

&lt;p&gt;0:16:58.680,0:17:05.920&lt;br /&gt;
Wi-Fi and 3G modem which works because&lt;/p&gt;

&lt;p&gt;0:17:02.500,0:17:08.589&lt;br /&gt;
it's the simple USB device there is the&lt;/p&gt;

&lt;p&gt;0:17:05.920,0:17:11.679&lt;br /&gt;
internal flash connected to MMC which&lt;/p&gt;

&lt;p&gt;0:17:08.589,0:17:14.230&lt;br /&gt;
also works and the SD card I think that&lt;/p&gt;

&lt;p&gt;0:17:11.679,0:17:16.660&lt;br /&gt;
SD card actually works but it's a big SD&lt;/p&gt;

&lt;p&gt;0:17:14.230,0:17:24.250&lt;br /&gt;
card so I just didn't have any handy to&lt;/p&gt;

&lt;p&gt;0:17:16.660,0:17:28.390&lt;br /&gt;
test it. [Adapter?] yeah sure but with 64 Gb&lt;/p&gt;

&lt;p&gt;0:17:24.250,0:17:31.000&lt;br /&gt;
of emmc which has 40 Mb of&lt;/p&gt;

&lt;p&gt;0:17:28.390,0:17:35.890&lt;br /&gt;
transfer rate why would I even try the&lt;/p&gt;

&lt;p&gt;0:17:31.000,0:17:39.100&lt;br /&gt;
SD card right? So was it worth it? For me&lt;/p&gt;

&lt;p&gt;0:17:35.890,0:17:42.320&lt;br /&gt;
it surely is! If the goal was to&lt;/p&gt;

&lt;p&gt;0:17:39.100,0:17:48.440&lt;br /&gt;
be able to type apt-get update&lt;/p&gt;

&lt;p&gt;0:17:42.320,0:17:50.750&lt;br /&gt;
I have achieved that goal. So if you have&lt;/p&gt;

&lt;p&gt;0:17:48.440,0:17:53.960&lt;br /&gt;
more devices you can spend one of&lt;/p&gt;

&lt;p&gt;0:17:50.750,0:17:55.850&lt;br /&gt;
them to actually figure out what is what&lt;/p&gt;

&lt;p&gt;0:17:53.960,0:17:59.389&lt;br /&gt;
is on the board, and this is one of the&lt;/p&gt;

&lt;p&gt;0:17:55.850,0:18:01.850&lt;br /&gt;
tablets disassembled into into separate&lt;/p&gt;

&lt;p&gt;0:17:59.389,0:18:07.899&lt;br /&gt;
pieces still working as you can see it&lt;/p&gt;

&lt;p&gt;0:18:01.850,0:18:11.480&lt;br /&gt;
has the LED it works but there are also&lt;/p&gt;

&lt;p&gt;0:18:07.899,0:18:14.480&lt;br /&gt;
few things left to do. For a start the&lt;/p&gt;

&lt;p&gt;0:18:11.480,0:18:17.120&lt;br /&gt;
SPI controller doesn't work which is&lt;/p&gt;

&lt;p&gt;0:18:14.480,0:18:18.860&lt;br /&gt;
quite strange I think I configured&lt;/p&gt;

&lt;p&gt;0:18:17.120,0:18:21.559&lt;br /&gt;
everything but surely there is the&lt;/p&gt;

&lt;p&gt;0:18:18.860,0:18:29.059&lt;br /&gt;
problem between me and and the code I&lt;/p&gt;

&lt;p&gt;0:18:21.559,0:18:31.940&lt;br /&gt;
wrote. In mainstream kernel there is similar&lt;/p&gt;

&lt;p&gt;0:18:29.059,0:18:36.799&lt;br /&gt;
driver for the touchpad which is used in&lt;/p&gt;

&lt;p&gt;0:18:31.940,0:18:40.730&lt;br /&gt;
surface Microsoft Surface 3 but that&lt;/p&gt;

&lt;p&gt;0:18:36.799,0:18:43.519&lt;br /&gt;
driver actually use ACPI tables to&lt;/p&gt;

&lt;p&gt;0:18:40.730,0:18:45.259&lt;br /&gt;
initialize and on the arm devices we&lt;/p&gt;

&lt;p&gt;0:18:43.519,0:18:47.299&lt;br /&gt;
would need the device tree to do that&lt;/p&gt;

&lt;p&gt;0:18:45.259,0:18:49.659&lt;br /&gt;
and I actually wrote the code which&lt;/p&gt;

&lt;p&gt;0:18:47.299,0:18:51.649&lt;br /&gt;
actually query the device tree&lt;/p&gt;

&lt;p&gt;0:18:49.659,0:18:54.440&lt;br /&gt;
it's really simple you just&lt;/p&gt;

&lt;p&gt;0:18:51.649,0:18:56.330&lt;br /&gt;
you just add a few defines in kernel&lt;/p&gt;

&lt;p&gt;0:18:54.440,0:18:59.269&lt;br /&gt;
module and it will also query the device&lt;/p&gt;

&lt;p&gt;0:18:56.330,0:19:03.769&lt;br /&gt;
tree but since the SPI doesn't work for&lt;/p&gt;

&lt;p&gt;0:18:59.269,0:19:07.100&lt;br /&gt;
me currently unfortunately touch as&lt;/p&gt;

&lt;p&gt;0:19:03.769,0:19:10.039&lt;br /&gt;
of today doesn't still work embedded&lt;/p&gt;

&lt;p&gt;0:19:07.100,0:19:12.769&lt;br /&gt;
controller will need a little bit more&lt;/p&gt;

&lt;p&gt;0:19:10.039,0:19:15.139&lt;br /&gt;
work and it's actually more essential&lt;/p&gt;

&lt;p&gt;0:19:12.769,0:19:18.320&lt;br /&gt;
because I would really like to be able&lt;/p&gt;

&lt;p&gt;0:19:15.139,0:19:21.019&lt;br /&gt;
to plug in the power and for&lt;/p&gt;

&lt;p&gt;0:19:18.320,0:19:22.899&lt;br /&gt;
battery to start charging immediately as&lt;/p&gt;

&lt;p&gt;0:19:21.019,0:19:26.330&lt;br /&gt;
opposed to me starting the shell script&lt;/p&gt;

&lt;p&gt;0:19:22.899,0:19:30.919&lt;br /&gt;
but you know for now it actually works&lt;/p&gt;

&lt;p&gt;0:19:26.330,0:19:33.169&lt;br /&gt;
and cameras are are supported the&lt;/p&gt;

&lt;p&gt;0:19:30.919,0:19:36.470&lt;br /&gt;
problem with cameras it should be really&lt;/p&gt;

&lt;p&gt;0:19:33.169,0:19:39.610&lt;br /&gt;
easy from the perspective of the kernel&lt;/p&gt;

&lt;p&gt;0:19:36.470,0:19:42.889&lt;br /&gt;
driver developer the cameras are&lt;/p&gt;

&lt;p&gt;0:19:39.610,0:19:45.080&lt;br /&gt;
relatively simple i2c devices because&lt;/p&gt;

&lt;p&gt;0:19:42.889,0:19:48.320&lt;br /&gt;
you just have to set up the camera&lt;/p&gt;

&lt;p&gt;0:19:45.080,0:19:51.470&lt;br /&gt;
the cameras are CSI and they will start&lt;/p&gt;

&lt;p&gt;0:19:48.320,0:19:54.400&lt;br /&gt;
streaming frames to memory of Tegra&lt;/p&gt;

&lt;p&gt;0:19:51.470,0:19:56.559&lt;br /&gt;
Tegra hardware support decode of&lt;/p&gt;

&lt;p&gt;0:19:54.400,0:20:03.730&lt;br /&gt;
that in memory and all should be golden&lt;/p&gt;

&lt;p&gt;0:19:56.559,0:20:06.550&lt;br /&gt;
but the video4linux 2 API in kernel&lt;/p&gt;

&lt;p&gt;0:20:03.730,0:20:09.040&lt;br /&gt;
is currently changing so all the&lt;/p&gt;

&lt;p&gt;0:20:06.550,0:20:11.590&lt;br /&gt;
examples for the camera similar to&lt;/p&gt;

&lt;p&gt;0:20:09.040,0:20:14.260&lt;br /&gt;
mine are actually examples for the old&lt;/p&gt;

&lt;p&gt;0:20:11.590,0:20:19.990&lt;br /&gt;
way of doing things as opposed to new&lt;/p&gt;

&lt;p&gt;0:20:14.260,0:20:23.640&lt;br /&gt;
one so this is somewhat something which&lt;/p&gt;

&lt;p&gt;0:20:19.990,0:20:27.340&lt;br /&gt;
I have to do at some later date&lt;/p&gt;

&lt;p&gt;0:20:23.640,0:20:29.410&lt;br /&gt;
still real Linux distribution on&lt;/p&gt;

&lt;p&gt;0:20:27.340,0:20:32.410&lt;br /&gt;
this device is much more useful than&lt;/p&gt;

&lt;p&gt;0:20:29.410,0:20:35.140&lt;br /&gt;
obsolete Android and if you enjoy this&lt;/p&gt;

&lt;p&gt;0:20:32.410,0:20:38.260&lt;br /&gt;
or you have some Tegra 2 device you can&lt;/p&gt;

&lt;p&gt;0:20:35.140,0:20:40.870&lt;br /&gt;
find additional notes here on the other&lt;/p&gt;

&lt;p&gt;0:20:38.260,0:20:43.630&lt;br /&gt;
hand if you don't have Tegra device but&lt;/p&gt;

&lt;p&gt;0:20:40.870,0:20:46.840&lt;br /&gt;
some other Android tablet on which you&lt;/p&gt;

&lt;p&gt;0:20:43.630,0:20:49.660&lt;br /&gt;
want to do something like this you can&lt;/p&gt;

&lt;p&gt;0:20:46.840,0:20:51.400&lt;br /&gt;
try some of the following links if you&lt;/p&gt;

&lt;p&gt;0:20:49.660,0:20:55.300&lt;br /&gt;
have allwinner&lt;/p&gt;

&lt;p&gt;0:20:51.400,0:20:57.280&lt;br /&gt;
or rockchip device I suggest to take a&lt;/p&gt;

&lt;p&gt;0:20:55.300,0:21:00.850&lt;br /&gt;
look at armbian which is probably&lt;/p&gt;

&lt;p&gt;0:20:57.280,0:21:04.540&lt;br /&gt;
the most well-known and best ARM based&lt;/p&gt;

&lt;p&gt;0:21:00.850,0:21:06.760&lt;br /&gt;
Linux distro for the devices if you have&lt;/p&gt;

&lt;p&gt;0:21:04.540,0:21:12.400&lt;br /&gt;
the OMAP based device which is&lt;/p&gt;

&lt;p&gt;0:21:06.760,0:21:16.540&lt;br /&gt;
basically the Nexus 7 or older Nexus&lt;/p&gt;

&lt;p&gt;0:21:12.400,0:21:19.000&lt;br /&gt;
phones there is talk from fosdem which&lt;/p&gt;

&lt;p&gt;0:21:16.540,0:21:21.490&lt;br /&gt;
goes into more details what you can do&lt;/p&gt;

&lt;p&gt;0:21:19.000,0:21:26.380&lt;br /&gt;
they are also quite well supported in -&lt;/p&gt;

&lt;p&gt;0:21:21.490,0:21:29.350&lt;br /&gt;
in mainstream kernel and the last&lt;/p&gt;

&lt;p&gt;0:21:26.380,0:21:33.429&lt;br /&gt;
alternative is postmarketOS which goal&lt;/p&gt;

&lt;p&gt;0:21:29.350,0:21:36.280&lt;br /&gt;
is to bring longer life to all the&lt;/p&gt;

&lt;p&gt;0:21:33.429,0:21:39.160&lt;br /&gt;
devices so in a sense similar goal to&lt;/p&gt;

&lt;p&gt;0:21:36.280,0:21:43.600&lt;br /&gt;
mine it's based on Alpine which is&lt;/p&gt;

&lt;p&gt;0:21:39.160,0:21:46.090&lt;br /&gt;
basically why I didn't use that but it&lt;/p&gt;

&lt;p&gt;0:21:43.600,0:21:48.059&lt;br /&gt;
does have the support for Samsung Galaxy&lt;/p&gt;

&lt;p&gt;0:21:46.090,0:21:53.290&lt;br /&gt;
Tab 10 which is also&lt;/p&gt;

&lt;p&gt;0:21:48.059,0:21:55.840&lt;br /&gt;
tera device and this source&lt;/p&gt;

&lt;p&gt;0:21:53.290,0:21:59.110&lt;br /&gt;
code for this device actually got me&lt;/p&gt;

&lt;p&gt;0:21:55.840,0:22:01.179&lt;br /&gt;
the courage to actually try this because&lt;/p&gt;

&lt;p&gt;0:21:59.110,0:22:03.820&lt;br /&gt;
I could see all the changes between main&lt;/p&gt;

&lt;p&gt;0:22:01.179,0:22:05.980&lt;br /&gt;
line and support needed for one Tegra&lt;/p&gt;

&lt;p&gt;0:22:03.820,0:22:07.540&lt;br /&gt;
device which wasn't supported before and&lt;/p&gt;

&lt;p&gt;0:22:05.980,0:22:10.960&lt;br /&gt;
I said&lt;/p&gt;

&lt;p&gt;0:22:07.540,0:22:13.500&lt;br /&gt;
this doesn't seem so hard it wasn't it&lt;/p&gt;

&lt;p&gt;0:22:10.960,0:22:18.490&lt;br /&gt;
wasn't useful for any practical&lt;/p&gt;

&lt;p&gt;0:22:13.500,0:22:20.500&lt;br /&gt;
practical I didn't copy any code I the&lt;/p&gt;

&lt;p&gt;0:22:18.490,0:22:23.740&lt;br /&gt;
tablets are different enough that it&lt;/p&gt;

&lt;p&gt;0:22:20.500,0:22:26.260&lt;br /&gt;
wasn't directly reusable but it gave me&lt;/p&gt;

&lt;p&gt;0:22:23.740,0:22:29.380&lt;br /&gt;
the courage to actually&lt;/p&gt;

&lt;p&gt;0:22:26.260,0:22:32.830&lt;br /&gt;
try it out so hopefully this will&lt;/p&gt;

&lt;p&gt;0:22:29.380,0:22:35.770&lt;br /&gt;
motivate you to revive some of your old&lt;/p&gt;

&lt;p&gt;0:22:32.830,0:22:44.320&lt;br /&gt;
Android devices. Do you have any&lt;/p&gt;

&lt;p&gt;0:22:35.770,0:22:47.890&lt;br /&gt;
questions? this the same grate driver&lt;/p&gt;

&lt;p&gt;0:22:44.320,0:22:50.890&lt;br /&gt;
supports Tegra 3 the Tegra 2 and newer&lt;/p&gt;

&lt;p&gt;0:22:47.890,0:22:53.320&lt;br /&gt;
so Tegra 3 is also supported&lt;/p&gt;

&lt;p&gt;0:22:50.890,0:22:56.080&lt;br /&gt;
although depending on which Tegra you&lt;/p&gt;

&lt;p&gt;0:22:53.320,0:23:00.030&lt;br /&gt;
have these days they usually have locked&lt;/p&gt;

&lt;p&gt;0:22:56.080,0:23:00.030&lt;br /&gt;
bootloader but...&lt;/p&gt;

&lt;p&gt;0:23:00.630,0:23:10.320&lt;br /&gt;
if you can update Android on your&lt;/p&gt;

&lt;p&gt;0:23:06.690,0:23:15.510&lt;br /&gt;
Tegra device there is a possibility to&lt;/p&gt;

&lt;p&gt;0:23:10.320,0:23:18.900&lt;br /&gt;
actually replace the Android kernel with&lt;/p&gt;

&lt;p&gt;0:23:15.510,0:23:22.470&lt;br /&gt;
the kernel which has kexec as opposed&lt;/p&gt;

&lt;p&gt;0:23:18.900,0:23:25.650&lt;br /&gt;
of using u-boot to boot the kernel you&lt;/p&gt;

&lt;p&gt;0:23:22.470,0:23:27.390&lt;br /&gt;
actually install your own kernel which&lt;/p&gt;

&lt;p&gt;0:23:25.650,0:23:29.910&lt;br /&gt;
is some version which is supported on&lt;/p&gt;

&lt;p&gt;0:23:27.390,0:23:32.400&lt;br /&gt;
your device and you then you can do with&lt;/p&gt;

&lt;p&gt;0:23:29.910,0:23:35.040&lt;br /&gt;
the kexec to the current kernel so&lt;/p&gt;

&lt;p&gt;0:23:32.400,0:23:38.570&lt;br /&gt;
it's also possible I actually do have I&lt;/p&gt;

&lt;p&gt;0:23:35.040,0:23:41.130&lt;br /&gt;
actually got a new friend from Germany&lt;/p&gt;

&lt;p&gt;0:23:38.570,0:23:42.960&lt;br /&gt;
during this project because I started&lt;/p&gt;

&lt;p&gt;0:23:41.130,0:23:45.180&lt;br /&gt;
documenting everything on the wiki as I&lt;/p&gt;

&lt;p&gt;0:23:42.960,0:23:48.330&lt;br /&gt;
was working and he contacted me and said&lt;/p&gt;

&lt;p&gt;0:23:45.180,0:23:51.330&lt;br /&gt;
oh I have the Tegra tablet also for two&lt;/p&gt;

&lt;p&gt;0:23:48.330,0:23:53.130&lt;br /&gt;
years I'm so happy I found you and he&lt;/p&gt;

&lt;p&gt;0:23:51.330,0:23:55.140&lt;br /&gt;
actually sent me the keyboard this is&lt;/p&gt;

&lt;p&gt;0:23:53.130,0:23:58.110&lt;br /&gt;
why I now have the keyboard and didn't&lt;/p&gt;

&lt;p&gt;0:23:55.140,0:24:03.600&lt;br /&gt;
have it and this one is locked so I will&lt;/p&gt;

&lt;p&gt;0:23:58.110,0:24:05.430&lt;br /&gt;
try that that kexec trick in the&lt;/p&gt;

&lt;p&gt;0:24:03.600,0:24:08.190&lt;br /&gt;
future and document it on the wiki so&lt;/p&gt;

&lt;p&gt;0:24:05.430,0:24:20.580&lt;br /&gt;
this might be helpful any other&lt;/p&gt;

&lt;p&gt;0:24:08.190,0:24:24.510&lt;br /&gt;
questions? [How much did it cost?] It was it was between 100&lt;/p&gt;

&lt;p&gt;0:24:20.580,0:24:27.060&lt;br /&gt;
between 80 and 100 kunas depending on&lt;/p&gt;

&lt;p&gt;0:24:24.510,0:24:30.470&lt;br /&gt;
the on the state of disrepair which is&lt;/p&gt;

&lt;p&gt;0:24:27.060,0:24:35.760&lt;br /&gt;
for the international audience between&lt;/p&gt;

&lt;p&gt;0:24:30.470,0:24:39.770&lt;br /&gt;
11-12 euros and like 14 right so they&lt;/p&gt;

&lt;p&gt;0:24:35.760,0:24:39.770&lt;br /&gt;
were really cheap I have a bunch of them&lt;/p&gt;

&lt;p&gt;0:24:43.290,0:24:50.660&lt;br /&gt;
[Applause]&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2019/05/dorscluc-2019-mainline-kernel-on-arm-tegra20-devices-that-are-left-behind-on-26-kernels.html
	</guid>
      </item>
      <item>
        <title>Power cycle network switch using Arduino and relay</title>
	<link>http://blog.rot13.org/2018/12/power-cycle-network-switch-using-arduino-and-relay.html</link>
	<pubDate>January 22, 2019 08:31</pubDate>
	<description>
	  &lt;p&gt;
Our top-of-switch rack decides to die randomly from time to time.
It was somewhat inconvenient since it also killed most of our infrastructure including primary and
secondary DNS so I needed a solution quickly. Since different rack is still on the network, I should
be able to hack something and finally connect my Arduino knowledge and sysadmin realm, right?
Think of it as power cycle watchdog based on network state.
&lt;/p&gt;
&lt;p&gt;
First thing was to figure out what was happening with the switch. It seemed like it was still working
(LEDs did blink), but only thing that helped was power cycle. So as a first strep, I connected serial
console (using RS-232 extension cable) to on-board serial port (since it doesn't seem to work using
cheap CH340 based USB serial dongles) and I didn't expect this:
&lt;pre&gt;
0x37491a0 (bcmCNTR.0): memPartAlloc: block too big 6184 bytes (0x10 aligned) in partition 0x30f6d88
0x3cd6bd0 (bcmCNTR.1): memPartAlloc: block too big 6184 bytes (0x10 aligned) in partition 0x30f6d88
0x6024c00 (simPts_task): memPartAlloc: block too big 1576 bytes (0x10 aligned) in partition 0x30f6d88
0x6024c00 (simPts_task): memPartAlloc: block too big 1576 bytes (0x10 aligned) in partition 0x30f6d88
&lt;/pre&gt;
When I google messages like this I get two types of answers:
&lt;ol&gt;
&lt;li&gt;beginner questions about VxWorks which summ up to: &lt;em&gt;you have memory leak&lt;/em&gt;
&lt;li&gt;errors from switches with boardcomm chipset from various vendors
&lt;/ol&gt;
There is basically no solution. We are running latest firmware, and internet doesn't have any idea what to do.
&lt;br /&gt;
Serial console did emit a lot of messages, but didn't respond to input at all. I would at last expect that
watchdog timer in the switch will reset it once it manages to fragment it's own memory so much that it has stopped
forwarding packets, oh well.... What else can I do?
&lt;/p&gt;

&lt;h3&gt;IEC power cable with relay&lt;/h3&gt;

&lt;p&gt;
I wanted something what I can plug in between the existing switch with IEC power connector with USB on the other 
end that can be plugged into any USB port for control.
&lt;/p&gt;



&lt;p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2018/12/IMG_20181219_172912-258.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2018/12/IMG_20181219_172912-thumb-320x157-258.jpg" width="320" height="157" alt="IMG_20181219_172912.jpg" class="mt-image-none" /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
Since this is 220V project (and my first important one), I  tried to do it as safe as possible.
&lt;ul&gt;

&lt;li&gt;
I started with a power cable, that I cut in half and put ferrules on all wires to be sure that
connectors will grip those wires well.
&lt;li&gt;
Then I replaced the power plug with IEC connector so it's can be inserted in any power cable.
In this case, we soldered wires ends, since ferrules where too big to fit into connector housing.
We did wrap a wire around a screw in a connector correctly, so tightening the screw will not
displace the wire.
&lt;li&gt;
Finally I connected cheap 10A 250VAC relay which should be enough for fully loaded 48 port
gigabit network switch that draws round 80W.
&lt;li&gt;
To make sure that rest of the system can't just power cycle device connected at any time, I connected
live wire through normally closed pins on a relay.
This means that this cable should work as-is (without powering it at all) and when powered,
since board has pull-up resistor on the relay to VCC, the relay will be in the same sate, passing power to device.
&lt;li&gt;
Finally I checked all three power cable wires with multi-meter and got
around 0.2 ohms which mans that whole thing works for now.
&lt;/ul&gt;

At this point we should note that this relay board has only three pins (IN, GND and VCC) and has
no optical isolation to 220V side. Since isolation would require us to provide additional power
supply for 220V side, it was acceptable a risk.
&lt;/p&gt;



&lt;h3&gt;Putting it into a box&lt;/h3&gt;

&lt;p&gt;
I really wanted to somehow fix wires and protect the bottom of the relay board (which has 220V on it)
from shorting to something, so I used an old box from a dairy product and created a housing
for electronics.
&lt;/p&gt;


&lt;!--
&lt;a href="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_095655-261.html" onclick="window.open('https://blog.rot13.org/assets_c/2018/12/IMG_20181220_095655-261.html','popup','width=4032,height=3024,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false"&gt;&lt;img src="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_095655-thumb-320x240-261.jpg" width="320" height="240" alt="IMG_20181220_095655.jpg" class="mt-image-none" style="" /&gt;&lt;/a&gt;
--&gt;
&lt;p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_095707-267.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_095707-thumb-320x365-267.jpg" width="320" height="365" alt="IMG_20181220_095707.jpg" class="mt-image-none" /&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
If you look carefully, you will notice that I had to cut the case all the way through to pass through the power
cable (that has a zip-tie on inside to prevent it from pulling out).
The Case will be fixed using hot glue and a lid, so this won't be a problem.
&lt;br /&gt;
Warning and label on the lid is also nice touch, and shouldn't be skipped when creating a thing
which you won't be only user of.
&lt;/p&gt;

&lt;h3&gt;Arduino software&lt;/h3&gt;
&lt;p&gt;
You will also notice that relay is connected to A7, which didn't work out. Let me explain:
&lt;br /&gt;
The idea is to use Arduino default pin state (INPUT) as a state in which the pin will stay most of the time.
This makes pin floating, and we can inspect pull-up on relay board and report if we see it.
When we want to activate the relay, we'll flip pin to output, pull it down, and activate the relay.
&lt;br /&gt;
Code is available at
&lt;a href="https://github.com/dpavlin/Arduino-projects/blob/nuc/power_cycle/power_cycle.ino"&gt;https://github.com/dpavlin/Arduino-projects/blob/nuc/power_cycle/power_cycle.ino&lt;/a&gt;
and it can't be much simpler:

&lt;pre&gt;
/*
 * power cycle switch
 * 
 * relay is connected across 5V relay through normally closed pins so that failure of arduino doesn't kill power to switch.
 * to activate relay on this board, signal pin has to be pulled to ground.and coil draw is 76 mA when active
 * board has pull up on input pin to it's vcc
*/

#define RELAY_PIN 2

void setup() {
  Serial.begin(115200);

  pinMode(LED_BUILTIN, OUTPUT);

  pinMode(RELAY_PIN, INPUT); // don't modify pin state
  Serial.print("Relay pin on reset: ");
  Serial.println(digitalRead(RELAY_PIN));
}

void loop() {
  if ( Serial.available() ) {
    char c = Serial.read();
    if ( c == '0' ) {
      Serial.print("L");
      pinMode(RELAY_PIN, OUTPUT);
      digitalWrite(RELAY_PIN, LOW); // activate relay

      digitalWrite(LED_BUILTIN, HIGH); // led on
    } else if ( c == '1' ) {
      Serial.print("H");
      pinMode(RELAY_PIN, INPUT);

      digitalWrite(LED_BUILTIN, LOW); // led off
    } else {
      Serial.print(c);
    }
  }
}
&lt;/pre&gt;

Simple is good: I toyed with idea of automatically releasing the relay from Arduino code, and when I
started to implement timeout configuration on Arduino side, I remembered what this will be plugged
into random server USB port, without avrdude and any handy way to update firmware on it,
so I decided to just leave simplest possible commands:
&lt;ul&gt;
&lt;li&gt;1 - ON (outputs H) - power on, default
&lt;li&gt;0 - OFF (outputs L) - power off, relay active
&lt;/ul&gt;
&lt;/p&gt;



&lt;/p&gt;


&lt;h3&gt;Hot glue galore&lt;/h3&gt;
&lt;p&gt;
Then, I applied liberal amount of hot-glue to fix power cables and board in place.
It worked out pretty well. You will also notice that the relay pin has moved to D2.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_111345-264.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_111345-thumb-320x240-264.jpg" width="320" height="240" alt="IMG_20181220_111345.jpg" class="mt-image-none" /&gt;&lt;/a&gt;
&lt;/p&gt;


&lt;h3&gt;Installation&lt;/h3&gt;
&lt;p&gt;
&lt;a href="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_132632-270.html"&gt;&lt;img src="https://blog.rot13.org/assets_c/2018/12/IMG_20181220_132632-thumb-320x240-270.jpg" width="320" height="240" alt="IMG_20181220_132632.jpg" class="mt-image-none" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
And here it is, installed between existing switch power cable and switch, connected to only USB port
still available in rack which is still on network.
&lt;/p&gt;


&lt;h3&gt;cron and serial port&lt;/h3&gt;
&lt;p&gt;
Idea is simple: we'll use cron to ping primary and secondary DNS IP addresses and if any of these fail,
 we'll send 0 to turn power off, wait 3 seconds, and send 1 to turn power back on.
&lt;br /&gt;
Implementation, however, is full of quirks, mostly because we don't want to depend on additional
utilities installed, and we need to wait for Arduino to reset after connecting to serial port
(and to give it time to display value of relay pin) before we start turning power off.

&lt;pre&gt;
#!/bin/sh -e

ping -q -c 5 193.198.212.8 &amp;gt; /dev/shm/ping &amp;amp;&amp;amp; ping -q -c 5 193.198.213.8 &amp;gt;&amp;gt; /dev/shm/ping || (

test -e /dev/shm/reset &amp;amp;&amp;amp; exit 0 # reset just once
cp /dev/shm/ping /dev/shm/reset  # store failed ping

date +%Y-%m-%dT%H:%M:%S
cat /dev/shm/ping

dev=/dev/ttyUSB0

trap &amp;quot;exit&amp;quot; INT TERM
trap &amp;quot;kill 0&amp;quot; EXIT

stty -F $dev speed 115200 raw
cat &amp;lt; $dev &amp;amp;
(
        echo
        sleep 3 # wait for reset and startup message
        echo 0  # off
        sleep 3
        echo 1  # on
        sleep 1
) | cat &amp;gt; $dev

kill $!

) # ping subshell
&lt;/pre&gt;

It's started from crontab with user which has dialout group membership so he can open /dev/ttyUSB0:
&lt;pre&gt;
dpavlin@ceph04:~$ ls -al /dev/ttyUSB0 
crw-rw---- 1 root dialout 188, 0 Dec 28 01:44 /dev/ttyUSB0
dpavlin@ceph04:~$ id
uid=1001(dpavlin) gid=1001(dpavlin) groups=1001(dpavlin),20(dialout),27(sudo)
dpavlin@ceph04:~$ crontab -l | tail -1
*/1 *  *   *   *     /home/dpavlin/sw-lib-srv-power-cycle.sh
&lt;/pre&gt;
This will execute script every minute. This allows us to detect error within minute.
However, switch boot takes 50s, so we can't just run this script every minute, because
it will result in constant switch power cycles. But since we are resetting switch just
once this is not a problem.
&lt;/p&gt;
&lt;p&gt;

With this in place, your network switch will not force you to walk to it so you can power cycle it any more.
&lt;tt&gt;:-)&lt;/tt&gt;
&lt;br /&gt;
And it's interesting combination of sysadmin skills and electronics which might be helpful to someone.

&lt;/p&gt;


&lt;h3&gt;remote access&lt;/h3&gt;
&lt;p&gt;
If we want to access our servers while switch doesn't work, it's always useful to create few
shell scripts on remote nodes which will capture IP addresses and commands which you will need
to execute to recover your network.
&lt;pre&gt;
dpavlin@data:~/ffzg$ cat ceph04-switch-relay.sh 
#!/bin/sh -xe

ssh 193.198.212.46 microcom -p /dev/ttyUSB0 -s 115200

dpavlin@data:~/ffzg$ cat r1u32-sw-rack3.sh 

#!/bin/sh

ssh 193.198.212.43 microcom -p /dev/ttyS1 -s 9600
&lt;/pre&gt;
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2018/12/power-cycle-network-switch-using-arduino-and-relay.html
	</guid>
      </item>
      <item>
        <title>LSI MegaRAID slow compared to md</title>
	<link>http://blog.rot13.org/2018/09/lsi-megaraid-slow-compared-to-md.html</link>
	<pubDate>September 27, 2018 12:48</pubDate>
	<description>
	  &lt;p&gt;
This week I learned valuable lesson: if you are using MIPS from 2008 in your RAID controller, you can't really expect it to be faster than more modern
Intel CPU when doing RAID 10 on disks.
&lt;/p&gt;
&lt;p&gt;
It all started with failure of SSD in our bcache setup which sits on top of MegaRAID RAID10 array. Since this required me take one of ganeti nodes down,
it was also a good opportunity to add one more disk (we where running 6 disks and one SSD) and switch to software md RAID10 so we can use all 7 disks in RAID10.
In this process, I did some benchmarking and was shocked with results.
&lt;/p&gt;
&lt;p&gt;
First, let's see original MegaRAID configuration:
&lt;pre&gt;
# lsblk --scsi -m
NAME HCTL       TYPE VENDOR   MODEL             REV TRAN NAME   SIZE OWNER GROUP MODE
sda  0:0:6:0    disk ATA      WDC WD1002FBYS-1 0C12      sda  931.5G root  disk  brw-rw----
sdb  0:0:7:0    disk ATA      INTEL SSDSC2BW24 DC32      sdb  223.6G root  disk  brw-rw----
sdc  0:2:0:0    disk DELL     PERC H310        2.12      sdc    2.7T root  disk  brw-rw----
# hdparm -tT /dev/sdc

/dev/sdc:
 Timing cached reads:   13920 MB in  1.99 seconds = 6981.76 MB/sec
 Timing buffered disk reads: 1356 MB in  3.00 seconds = 451.81 MB/sec
&lt;/pre&gt;
and let's compare that with JBOD disks on controller and creating md array:
&lt;pre&gt;
# hdparm -Tt /dev/md0
/dev/md0:
 Timing cached reads:   13826 MB in  1.99 seconds = 6935.19 MB/sec
 Timing buffered disk reads: 1888 MB in  3.01 seconds = 628.05 MB/sec
&lt;/pre&gt;
So, &lt;b&gt;TL;DR is that you are throwing away disk performance if you are using hardware RAID&lt;/b&gt;. You didn't expect that? I didn't. In retrospect it's logical that newish Intel CPU
can process data much faster than slowish MIPS on RAID controller, but on the other hand only difference is RAID overhead because same controller is still handling disks with
software raid.
&lt;/p&gt;
&lt;p&gt;
I also wrote document with a lot of console output and commands to type if you want to do the same:
&lt;a href="https://github.com/ffzg/gnt-info/blob/master/doc/megaraid-to-md.txt"&gt;https://github.com/ffzg/gnt-info/blob/master/doc/megaraid-to-md.txt&lt;/a&gt;
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2018/09/lsi-megaraid-slow-compared-to-md.html
	</guid>
      </item>
      <item>
        <title>Edit any textarea in vi with syntax highlight</title>
	<link>http://blog.rot13.org/2018/07/edit-any-textarea-in-vi-with-syntax-highlight.html</link>
	<pubDate>July 11, 2018 18:45</pubDate>
	<description>
	  &lt;p&gt;
Today I was explaining xclip utility and found this useful
snippet which I wrote back in 2011 that allows you to edit
browser textarea in terminal using vi with syntax highlighting.
&lt;/p&gt;
&lt;pre&gt;
#!/bin/sh

# workflow:
# 1. focus textarea in browser you want to edit
# 2. press ctrl+a then ctrl+c
# 3. switch to terminal and start this script with optional extensioni for highlight: xclip-vi html
# 4. edit file in vi, and save it
# 5. switch back to browser, and press ctrl+v in already selected textarea

ext=$1
test -z &amp;quot;$ext&amp;quot; &amp;amp;&amp;amp; ext=txt

xclip -out &amp;gt; /tmp/$$.$ext &amp;amp;&amp;amp; vi /tmp/$$.$ext &amp;amp;&amp;amp; xclip -in -selection clipboard &amp;lt; /tmp/$$.$ext
&lt;/pre&gt;
&lt;p&gt;
&lt;a href="https://gist.github.com/dpavlin/441f4ebdca46f6a197686be16a0f61b8"&gt;xclip-vi.sh&lt;/a&gt; github gist
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2018/07/edit-any-textarea-in-vi-with-syntax-highlight.html
	</guid>
      </item>
      <item>
        <title>Acer Nitro 5 with nVidia 1050 on Linux (Ubuntu 18.04)</title>
	<link>http://vrodic.blogspot.com/2018/06/acer-nitro-5-with-nvidia-1050-on-linux.html</link>
	<pubDate>July 02, 2018 15:38</pubDate>
	<description>
	  Acer Nitro 5 with nVidia 1050 GPU is an interesting beast.&lt;br /&gt;&lt;br /&gt;- HDMI Output is wired to the NVIDIA chip&lt;div&gt;- Internal display wired to Intel GPU.&lt;br /&gt;&lt;br /&gt;This is different than Optimus where both outputs are driven by the integrated GPU, and is actually more efficient since it doesn't spend system RAM bandwidth for display refresh or for copying the GPU&amp;nbsp; discrete GPU frame-buffer to the internal GPU frame-buffer when rendering using the.&lt;br /&gt;&lt;br /&gt;So it's important that switching between using external monitor and internal laptop panel is handled gracefully.&lt;br /&gt;&lt;br /&gt;Windows driver probably handles this automatically (though it's possible it has to be a special Acer build). It maybe even allows both GPUs to be active at the same time (Intel for internal, nVidia for external display)&lt;br /&gt;&lt;br /&gt;But Linux nVidia driver typically works either in Optimus mode where both internal and external device is driven by Intel GPU or in traditional mode where monitor is only connected to the discrete GPU. Bumblebee project supports a more flexible setup, but is maybe a bit more difficult to configure&lt;br /&gt;&lt;br /&gt;This is a short guide to enable switching between the either using external monitor with nVidia or Internal monitor with Intel GPU somewhat easily on Ubuntu 18.04:&lt;br /&gt;&lt;br /&gt;First install nvidia proprietary driver :&lt;br /&gt;&lt;b&gt;&amp;nbsp;- apt install nvidia-driver-390 nvidia-prime&lt;/b&gt;&lt;br /&gt;&lt;b&gt;-&amp;nbsp;&lt;/b&gt;edit /&lt;b&gt;etc/default/grub&lt;/b&gt;&amp;nbsp;so that GRUB_CMDLINE_LINUX_DEFAULT&amp;nbsp;line has&amp;nbsp;&lt;b&gt;nomodeset&lt;/b&gt;&amp;nbsp;option eg, GRUB_CMDLINE_LINUX_DEFAULT="quiet splash&amp;nbsp;&lt;b&gt;nomodeset&lt;/b&gt;" &amp;amp; run&amp;nbsp;&lt;b&gt;sudo&amp;nbsp;update-grub&lt;/b&gt;&lt;br /&gt;- restart machine while external HDMI monitor is connected&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To switch to internal monitor:&lt;br /&gt;-&lt;b&gt;&amp;nbsp;&lt;/b&gt;run &lt;b&gt;sudo prime-select intel&lt;/b&gt; while on external monitor (or if you don't have the external monitor, Ctrl-Alt-F3 to text console and run&amp;nbsp;&lt;b&gt;sudo prime-select intel)&lt;/b&gt;&lt;br /&gt;- reboot&lt;br /&gt;&lt;b&gt;- &lt;/b&gt;to enable acceleration for intel remove&lt;b&gt; nomodeset &lt;/b&gt;from the kernel command line&lt;br /&gt;&lt;br /&gt;To switch back to external monitor:&lt;br /&gt;-&lt;b&gt;&amp;nbsp;&lt;/b&gt;run&amp;nbsp;&lt;b&gt;sudo prime-select nvidia&lt;/b&gt;&lt;br /&gt;- reboot&lt;br /&gt;- make sure there is &lt;b&gt;nomodeset &lt;/b&gt;in the kernel command line&lt;br /&gt;&lt;br /&gt;Making a shell script that does&lt;b&gt; nomodeset &lt;/b&gt;grub switching and prime-select in a single step should be possible, and a situation where there is no &lt;b&gt;nomodeset&lt;/b&gt;&amp;nbsp;but nvidia is configured (GDM is stuck in neverending start loop) can be fixed by manually adding &lt;b&gt;nomodeset &lt;/b&gt;in the grub menu&lt;br /&gt;&lt;br /&gt;If you want to try a more flexible setup with Bumblebee, try these links&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://unix.stackexchange.com/questions/321151/do-not-manage-to-activate-hdmi-on-a-laptop-that-has-optimus-bumblebee"&gt;https://unix.stackexchange.com/questions/321151/do-not-manage-to-activate-hdmi-on-a-laptop-that-has-optimus-bumblebee&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor-setup"&gt;https://github.com/Bumblebee-Project/Bumblebee/wiki/Multi-monitor-setup&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://wiki.archlinux.org/index.php/bumblebee#Output_wired_to_the_NVIDIA_chip"&gt;https://wiki.archlinux.org/index.php/bumblebee#Output_wired_to_the_NVIDIA_chip&lt;/a&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2018/06/acer-nitro-5-with-nvidia-1050-on-linux.html
	</guid>
      </item>
      <item>
        <title>Running legacy binary junk after upgrade in chroot</title>
	<link>http://blog.rot13.org/2018/06/running-legacy-binary-junk-after-upgrade.html</link>
	<pubDate>June 13, 2018 15:47</pubDate>
	<description>
	  &lt;p&gt;
These days, my work seems more like archeology than implementing newest and coolest web technologies,
but someone has to keep an eye on old web servers which are useful to people.
&lt;/p&gt;
&lt;p&gt;
In this case, it's &lt;em&gt;two major Debian releases upgrade&lt;/em&gt; which of course did result in some amount of breakage
 as you would expect. Most of breakage was easy to fix, but we had one site which had only &lt;tt&gt;pyc&lt;/tt&gt;
files, and python2.6 with correct modules wasn't supported on current distribution.
&lt;/p&gt;
&lt;p&gt;
First idea was to use &lt;a href="https://github.com/rocky/python-uncompyle6"&gt;python de-compiler&lt;/a&gt;
to generate source python files, and this only got me to different python errors which
I didn't know how to fix. so, this was dead end.
&lt;/p&gt;
&lt;p&gt;
I did have a backup of machine before upgrade on zfs pool, so next logical idea was to run minimal amount
of old binaries to keep the site up. And I decided to do it in chroot so I can easily share mysql socket
from current installation into pre-upgrade squeeze. Let's see what was involved in making this happen.
&lt;/p&gt;

&lt;h4&gt;1. make writable copy of filesystem&lt;/h4&gt;
&lt;p&gt;
Our backups are on zfs pool, so we cloned all three disks into same layout as they are mounted on filesystem:
&lt;pre&gt;
2018-06-08.10:07:53 zfs clone lib15/backup/pauk.ffzg.hr/0@2018-05-01 lib15/export/pauk.ffzg.hr
2018-06-08.10:08:19 zfs clone lib15/backup/pauk.ffzg.hr/1@2018-05-01 lib15/export/pauk.ffzg.hr/home
2018-06-08.10:08:38 zfs clone lib15/backup/pauk.ffzg.hr/2@2018-05-01 lib15/export/pauk.ffzg.hr/srv
&lt;/pre&gt;
&lt;/p&gt;

&lt;h4&gt;2. nfs export it to upgraded server&lt;/h4&gt;
&lt;p&gt;
Take a note of crossmnt parameter, this will allow us to mount all descending filesystems automatically.
&lt;pre&gt;
root@lib15:~# grep pauk /etc/exports 
/lib15/export/pauk.ffzg.hr 10.21.0.2(rw,fsid=2,no_subtree_check,no_root_squash,crossmnt)
root@lib15:~# exportfs -va
exporting 10.21.0.2:/lib15/export/pauk.ffzg.hr
&lt;/pre&gt;
&lt;/p&gt;

&lt;h4&gt;3. mount nfs export&lt;/h4&gt;

&lt;pre&gt;
root@pauk:~# grep squeeze /etc/fstab
10.21.0.215:/lib15/export/pauk.ffzg.hr  /mnt/squeeze    nfs     defaults,rw     0 0
&lt;/pre&gt;


&lt;h4&gt;4. start chroot with old version of service&lt;/h4&gt;

&lt;p&gt;To make this work, I first edited apache configuration in chroot to start it on different port,
and configured front-end server to redirect site to new port.

&lt;pre&gt;
root@pauk:/home/dpavlin# cat chroot-squeeze.sh 

to=/mnt/squeeze

mount --bind /dev $to/dev
mount --bind /sys $to/sys
mount --bind /proc $to/proc

mount --bind /var/run/mysqld/ /mnt/squeeze/var/run/mysqld/

/usr/sbin/chroot $to /etc/init.d/apache2 start
&lt;/pre&gt;
&lt;/p&gt;


&lt;h4&gt;5. redirect apache traffic to server in chroot&lt;/h4&gt;
&lt;p&gt;
You will have to insert something like this in current apache configuration for vhost:
&lt;pre&gt;
&amp;lt;Proxy http://127.0.0.1:18080/*&amp;gt;
    Order allow,deny
    Allow from all
&amp;lt;/Proxy&amp;gt;
&amp;lt;Location /german2/&amp;gt;
    RequestHeader set Host "www.ffzg.unizg.hr"
    ProxyPreserveHost On
    ProxyPass        http://127.0.0.1:18080/german/
    ProxyPassReverse http://127.0.0.1:18080/german/
&amp;lt;/Location&amp;gt;
&lt;/pre&gt;
&lt;/p&gt;


&lt;p&gt;You might scream at me that in days of containers, systemd and other better solutions
chroot is obsolete. In my opinion, it's just a right tool for a job from time to time, 
if you have backup &lt;tt&gt;:-)&lt;/tt&gt;
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2018/06/running-legacy-binary-junk-after-upgrade.html
	</guid>
      </item>
      <item>
        <title>DORS/CLUC 2017: bro - what's in your network?</title>
	<link>http://blog.rot13.org/2017/06/dorscluc-2017-bro---whats-in-your-network.html</link>
	<pubDate>June 10, 2018 10:35</pubDate>
	<description>
	  &lt;p&gt;This year on &lt;a href="https://2017.dorscluc.org/talk/30/"&gt;DORS/CLUC 2017&lt;/a&gt;, I talked about bro which is great network analysys tools everybody should
know, but dispite it's long history is not as well known as you would suspect.
&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2017/06/dorscluc-2017-bro---whats-in-your-network.html
	</guid>
      </item>
      <item>
        <title>DORS/CLUC 2018: linux+sensor+device-tree+shell=IoT ?</title>
	<link>http://blog.rot13.org/2018/04/dorscluc-2018-linux-sensor-device-tree-shell-iot.html</link>
	<pubDate>June 10, 2018 10:18</pubDate>
	<description>
	  &lt;p&gt;
This year on &lt;a href="https://2018.dorscluc.org/"&gt;DORS/CLUC 2018&lt;/a&gt; I decided to talk about device tree in Linux kernel,
so here are blurb, presentation and video of that lecture.

&lt;blockquote&gt;
You have one of those fruity *Pi arm boards and cheep sensor from China? Some buttons and LEDs?
Do I really need to learn whole new scripting language and few web technologies to read my temperature,
blink a led or toggle a relay?
&lt;br /&gt;No, because your Linux kernel already has drivers for them and all you need is device tree and cat.
&lt;/blockquote&gt;
&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;

        Below is transcript of talk:

&lt;pre&gt;
0:00:00.000,0:00:09.540
Hello. How are you?
This is the participation part, come on

0:00:09.540,0:00:19.619
you're not the first I time here!
OK, my name is Dobrica PavlinuÃÂ¡iÃÂ and I will try to

0:00:19.619,0:00:25.019
persuade you today that you can do with
your Linux something which you might not

0:00:25.019,0:00:32.969
have thought of by yourself I hope in a
sense in last year and a half I noticed

0:00:32.969,0:00:38.610
that I am using microcontrollers for
less and less and that I'm using my

0:00:38.610,0:00:44.760
Linux more and more for more or less the
same tasks and in that progress process

0:00:44.760,0:00:51.239
I actually learned something which I
want to share with you today in a sense

0:00:51.239,0:00:57.059
my idea is to tell you how to do
something with your arm single board

0:00:57.059,0:01:05.729
computer in this lecture we will talk
mostly about Allwinner boards but if

0:01:05.729,0:01:12.119
you want a hint if you want to buy
some arm computer please buy the board

0:01:12.119,0:01:17.070
which is supported by armbian. armbian  is the project which actually

0:01:17.070,0:01:21.360
maintains the distribution for our
boards and is currently the best

0:01:21.360,0:01:27.689
distribution for arms aside from me
raspbian for Raspberry Pi but raspbian

0:01:27.689,0:01:32.909
supports only Raspberry Pi but if you have
any other board please take a look if

0:01:32.909,0:01:37.860
there is an armbian port. if there isn't
try to contribute one and if you are

0:01:37.860,0:01:41.850
just deciding which board to buy my
suggestion is buy the one which is

0:01:41.850,0:01:47.070
already supported on the other hand if
you already did something similar you

0:01:47.070,0:01:52.079
might have found some references on the
internet about device three and it

0:01:52.079,0:01:55.619
looked like magic
so we'll try to dispel some of that

0:01:55.619,0:02:03.180
magic today unfortunately when you start
playing with it one of the first things

0:02:03.180,0:02:10.459
you will want to do is recompile the
kernel on your board so be prepared to

0:02:10.459,0:02:15.810
compile additional drivers if they are
not already included. armbian again

0:02:15.810,0:02:21.890
wins because it comes with a lot of
a lot of drivers already included and

0:02:21.890,0:02:28.950
this year I will not say anything which
requires soldering which might be good

0:02:28.950,0:02:35.190
for you if you are afraid of the heat
but it will be a little bit more than

0:02:35.190,0:02:41.519
just connecting few wires not much more
for a start let's start with the warning

0:02:41.519,0:02:46.980
for example you have a arms in arms
small arm board and you want to have a

0:02:46.980,0:02:52.019
real clock in it you know the one which
keeps the time when the board is powered

0:02:52.019,0:02:57.239
off has the battery and so on if you buy
the cheapest one from China which is

0:02:57.239,0:03:02.879
basically for Arduino you will buy the
device which is 5 volt device which your

0:03:02.879,0:03:10.170
arm single board computer isn't. you can
modify the board removing two resistors

0:03:10.170,0:03:16.409
if you want to but don't tell anyone I2C, and will mostly talk about i2c

0:03:16.409,0:03:23.819
sensors here, should be 5 volt tolerant
so if you by mistake just connected and

0:03:23.819,0:03:30.569
your data signals are really 5 volt you
won't burn your board but if you are

0:03:30.569,0:03:35.129
supplying your sensor with 5 volts
please double-check that your that is

0:03:35.129,0:03:39.060
sure to connect it to your board and
nothing bad will happen this is the only

0:03:39.060,0:03:44.970
warning I have for the whole lecture in
this example I showed you a really

0:03:44.970,0:03:49.829
simple way in which you can take the
sensors run i2cdetect, detect its

0:03:49.829,0:03:59.370
address in this case it's 68 - and then
- load 1 kernel module and all of the

0:03:59.370,0:04:03.889
sudden your Raspberry Pi will have battery backed clock, just like your laptop does

0:04:03.889,0:04:12.569
but how did this journey all started for
me? about two years ago I was very

0:04:12.569,0:04:18.060
unsatisfied with the choice of pinouts
which you can download from the internet

0:04:18.060,0:04:23.820
I was thinking something along the lines
wouldn't be it wouldn't it be nice if I

0:04:23.820,0:04:27.060
could
print the pinout for any board I have

0:04:27.060,0:04:36.360
with perfect 2.54 millimeters pin
spacing which I can put beside my pins

0:04:36.360,0:04:43.440
and never make a mistake of plugging the
wire in the wrong pin and we all know

0:04:43.440,0:04:48.000
that plugging the wire in the wrong pin
is always the first problem you have on

0:04:48.000,0:04:54.120
the other hand you say oh this is the
great idea and you are looking at your

0:04:54.120,0:04:58.320
pin out which is from the top of the
board and you are plugging the wires

0:04:58.320,0:05:02.160
from the bottom of the board and all of
the sudden your pin out has to be

0:05:02.160,0:05:06.660
flipped but once you write a script
which actually displays the pin out it's

0:05:06.660,0:05:12.950
trivially easy to get to add options to
flip it horizontally or vertically and

0:05:12.950,0:05:18.870
create either black and white pin out if
you are printing it a laser or color pin

0:05:18.870,0:05:26.639
out if you are printing it on some kind
of inkjet so once you have that SVG

0:05:26.639,0:05:31.680
which you can print and cut with the
scissors and so on it's just a script on

0:05:31.680,0:05:38.370
your machine so you could also have the
common line output and then it went all

0:05:38.370,0:05:44.070
south I started adding additional data
which you can see on this slide in

0:05:44.070,0:05:50.250
square brackets with the intention of
having additional data for each pin for

0:05:50.250,0:05:56.250
example if I started SPI I want to see
that this pin is already used so I will

0:05:56.250,0:06:01.830
not by mistake plug something into the
SPI pins if I already have the SPI pin

0:06:01.830,0:06:08.150
started if I have the serial port on
different boards your serial might be

0:06:08.150,0:06:14.880
UART4 on this particular CPU but it's
the only serial in your Linux system so

0:06:14.880,0:06:21.270
it will be /dev/ttyS0 for
example so I wanted to see all the data

0:06:21.270,0:06:27.180
and in the process I actually saw a lot
of things which kernel know and I didn't

0:06:27.180,0:06:33.690
so today talking to you about it of
course in comment line because you might

0:06:33.690,0:06:36.990
rotate your board well plug in the wires
you can also do

0:06:36.990,0:06:45.540
all the flips and things you you already
saw in the in the graphic part so let's

0:06:45.540,0:06:50.190
start with the sensor okay I said cheap
sensor for eBay we'll get the cheap

0:06:50.190,0:06:54.840
sensors from eBay but this sensor is from
some old PowerPC Macintosh. It was

0:06:54.840,0:06:59.580
attached to the disk drive and the
Macintosh used it to measure the

0:06:59.580,0:07:04.890
temperature of the disk drive. you know
that was in the times before the smart

0:07:04.890,0:07:12.060
had a temperature and I said hmm this
is the old sensor, kernel surely

0:07:12.060,0:07:16.800
doesn't have support for it, but, oh look,
just grep through the kernel

0:07:16.800,0:07:21.900
source and indeed there is a driver and
this was a start I said hmm

0:07:21.900,0:07:29.580
driver in kernel, I don't have to use
Arduino for it - now that I know that

0:07:29.580,0:07:35.070
driver is there and I have kernel module compiled, we said that prerequisite

0:07:35.070,0:07:40.950
is that we can compile the kernel, what
do we actually have to program or do to

0:07:40.950,0:07:46.260
make this sensor alive? not more than
this a echo in the middle of the slide

0:07:46.260,0:07:52.200
you just echo the name of the module and
the i2c address the i2c addresses we saw

0:07:52.200,0:07:56.070
it before we can get it with i2cdetect by just connecting the sensor and

0:07:56.070,0:08:02.280
the new device will magically appear it
will be shown in the sensors if you have

0:08:02.280,0:08:06.840
lm-sensors package installed but if
you don't you can always find the same

0:08:06.840,0:08:14.160
data in /sys/ file system which is full
of wonders and as we'll see in non

0:08:14.160,0:08:19.350
formatted way so the first two digits
actually the last three digits digits

0:08:19.350,0:08:26.640
are the decimal numbers and the all the
other are the the integer celsius in

0:08:26.640,0:08:34.470
this case. but you might say - I
don't want to put that echo in my startup

0:08:34.470,0:08:40.380
script! or I would like to have that as
soon as possible I don't want to depend

0:08:40.380,0:08:43.980
on the userland
to actually start my sensor and believe

0:08:43.980,0:08:48.710
it or not because your smart phones have
various sensors in

0:08:48.710,0:08:52.790
them, there is a solution in the Linux kernel
for that and it's called the device tree

0:08:52.790,0:08:58.700
so this is probably the simplest form of
the device tree which still doesn't look

0:08:58.700,0:09:06.020
scary, but it i will, stay with me, and it
again defines our module the address

0:09:06.020,0:09:12.020
which is 49 in this case and i2c 1
interface just like we did in that echo

0:09:12.020,0:09:16.700
but in this case this module will be
activated as soon as kernel starts up

0:09:16.700,0:09:24.590
as opposed to the end of your boot up
process. one additional thing that kernel

0:09:24.590,0:09:31.000
has and many people do not use is
ability to load those device trees

0:09:31.000,0:09:35.750
dynamically the reason why those most
people don't use it is because they are

0:09:35.750,0:09:41.270
on to old kernels I think you have to
have something along the lines of 4.8

0:09:41.270,0:09:47.510
4.8 or newer to actually have the
ability to load the device trees live

0:09:47.510,0:09:54.470
basically you are you are using /sys/kernel/config directory and this script

0:09:54.470,0:10:00.620
just finds where you have it mounted and
loads your device tree live word of

0:10:00.620,0:10:09.200
warning currently although it seems like
you can do that on Raspberry Pi the API

0:10:09.200,0:10:14.270
is there the model is compiled,
everything is nice and Diddley, kernel

0:10:14.270,0:10:18.350
even says that device tree overlay is
applied, it doesn't work on the raspberry

0:10:18.350,0:10:24.950
pi because raspberry pi is different but
if you gave a any other platform live

0:10:24.950,0:10:31.670
loading is actually quite nice and
diddley. so now we have some sensor and it

0:10:31.670,0:10:37.310
works or it doesn't
and we somewhat suspect that kernel

0:10:37.310,0:10:43.040
developers didn't write a good driver
which is never ever the case if you

0:10:43.040,0:10:48.260
really want to implement some driver
please look first at the kernel source

0:10:48.260,0:10:52.220
tree there probably is the
implementation better than the one you

0:10:52.220,0:10:56.930
will write and you can use because the
kernel is GPL you can use that

0:10:56.930,0:11:00.970
implementation as a reference because in
my

0:11:00.970,0:11:05.890
small experience with those drivers in
kernel they are really really nice but

0:11:05.890,0:11:10.960
what do you do well to debug it?
I said no soldering and I didn't say but

0:11:10.960,0:11:15.010
it would be nice if I could do that
without additional hardware. Oh, look

0:11:15.010,0:11:20.890
kernel has ability to debug my i2c
devices and it's actually using tracing.

0:11:20.890,0:11:26.140
the same thing I'm using on my servers
to get performance counters. isn't that

0:11:26.140,0:11:30.340
nice. I don't have to have a logic
analyzer. I can just start tracing and

0:11:30.340,0:11:40.120
have do all the dumps in kernel. nice,
unexpected, but nice! so let's get to the

0:11:40.120,0:11:45.790
first cheap board from China so you
bought your arm single base computer

0:11:45.790,0:11:52.030
single board computer and you want to
add few analog digital converters to it

0:11:52.030,0:11:57.070
because you are used to Arduino and you
have some analog sensor or something and

0:11:57.070,0:12:05.620
you found the cheapest one on eBay and
bought few four five six because they

0:12:05.620,0:12:10.990
are just the $ each, so what do you do
the same thing we saw earlier you just

0:12:10.990,0:12:17.800
compile the models say the address of
the interface and it will appear and

0:12:17.800,0:12:23.770
just like it did in the last example so
everything is nice but but but you read

0:12:23.770,0:12:30.790
the datasheet of that sensor and the
sensor other than 4 analog inputs also

0:12:30.790,0:12:38.860
has 1 analog output which is the top
pin on the left denoted by AOUT, so you

0:12:38.860,0:12:42.850
want to use it
oh this kernel model doesn't is not very

0:12:42.850,0:12:46.900
good it doesn't have ability to control
that of course it does but how do you

0:12:46.900,0:12:50.680
find it?
my suggestion is actually to search

0:12:50.680,0:12:57.190
through the /sys/ for either address of
your i2c sensor, which is this

0:12:57.190,0:13:05.790
case is 48, or for the word output or
input and you will actually get all

0:13:05.790,0:13:12.400
files, because in linux everything is a
file, which are defined in driver of this

0:13:12.400,0:13:16.620
module, and if you
look at it, there is actually out0_output

0:13:16.620,0:13:24.630
out0_output file in which you can
turn output on or off so we are all

0:13:24.630,0:13:29.910
golden. kernel developers didn't forget
to implement part of the driver for this

0:13:29.910,0:13:38.910
sensor all golden my original idea was
to measure current consumptions of arm

0:13:38.910,0:13:44.490
boards because I'm annoyed by the random
problems you can have just because your

0:13:44.490,0:13:49.470
power supply is not powerful enough so
it's nice actually to monitor your power

0:13:49.470,0:13:55.740
usage so you will see what changes, for
example, you surely... we'll get that, remind

0:13:55.740,0:14:01.250
me to tell you how much power does the
 the additional button take

0:14:01.250,0:14:05.130
that's actually interesting thing which
you wouldn't know if you don't measure

0:14:05.130,0:14:10.950
current so you buy the cheapest possible
eBay sensor for current, the right one

0:14:10.950,0:14:16.560
is the ina219 which is
bi-directional current sensing so you

0:14:16.560,0:14:21.690
can put it between your battery and solar panel and you will see

0:14:21.690,0:14:26.160
whether the battery is charging or
discharging, or if you need more channels

0:14:26.160,0:14:34.020
I like an ina3221 which has 3 channels,
the same voltage

0:14:34.020,0:14:40.500
but 3 different channels, so you can
power 3 arm single computers from one

0:14:40.500,0:14:47.670
sensor if you want to. and of course once
you have that again the current is in

0:14:47.670,0:14:53.260
some file and it will be someting...

0:14:53.260,0:14:56.490
But, I promised you IOT? right? nothing

0:14:56.490,0:14:59.070
I said so far is IOT! where is the
Internet?

0:14:59.070,0:15:05.100
where are the things? buzzwords are missing! OK, challenge

0:15:05.100,0:15:08.550
accepted! Let's make a button! you know it's like a

0:15:08.550,0:15:15.029
blink LED. So buttons, because I was
not allowed to use soldering iron in

0:15:15.029,0:15:21.990
this talk, I'm using old buttons from old
scanner. nothing special 3 buttons, in

0:15:21.990,0:15:25.350
this case with hardware debounce, but we
don't care.

0:15:25.350,0:15:29.270
4 wires 3 buttons.
how hard can it be?

0:15:29.270,0:15:36.240
well basically it can be really really
simple  this is the smallest

0:15:36.240,0:15:42.638
font so if you see how to read this I
congratulate you! in this case I am

0:15:44.580,0:15:51.360
specifying that I want software pull up, in this first fragment on the top.

0:15:51.360,0:15:57.840
I could have put some
resistors, but you said no soldering

0:15:57.840,0:16:03.540
so here I am telling to my
processor. please do pull up on

0:16:03.540,0:16:09.540
those pins. and then I'm defining three
keys. as you can see email. connect and

0:16:09.540,0:16:15.660
print. which generate real Linux
keyboard events. so if you are in X and

0:16:15.660,0:16:20.730
press that key, it will generate that key,
I thought it would it would be better to

0:16:20.730,0:16:26.400
generate you know the magic multimedia
key bindings as opposed to A, B and C

0:16:26.400,0:16:31.940
because if I generated a ABC and was its
console I would actually generate

0:16:31.940,0:16:39.140
letters on a login prompt which I didn't
want so actually did it and it's quite

0:16:39.140,0:16:47.310
quite easy. In this case I'm using gpio-keys-polled which means that my CPU

0:16:47.310,0:16:52.500
is actually pulling every 100
milliseconds those keys to see whether

0:16:52.500,0:16:57.150
they their status changed and since the
board is actually connected through the

0:16:57.150,0:17:01.890
current sensing - sensor I mentioned earlier I'm

0:17:01.890,0:17:11.209
getting additional: how many mA?
every 100 milliseconds, pulling 3 keys?

0:17:13.010,0:17:19.350
60! I wouldn't expect my power
consumption to rise by 60 milliamps

0:17:19.350,0:17:24.480
because I am pulling 3 keys every 100
milliseconds! but it did and because I

0:17:24.480,0:17:32.430
could add sensors to the linux without
programming drivers, I know that! why am I

0:17:32.430,0:17:40.450
using polling because on allwinner
all pins are not interrupt capable so in

0:17:40.450,0:17:44.520
the sense all pins cannot generate
interrupts on allwinner

0:17:44.520,0:17:48.940
raspberry pi in this case is different
on raspberry pi every pin can be

0:17:48.940,0:17:54.279
interrupt pin on Allwinner that is not
the case. so the next logical question is

0:17:54.279,0:17:58.510
how do I know when I'm sitting in front
of my board whether the pin can get the

0:17:58.510,0:18:05.440
interrupt or not? my suggestion is ask
the kernel. just grap through the debug

0:18:05.440,0:18:10.720
interface of the kernel through pinctrl
which is basically the the thing

0:18:10.720,0:18:19.570
which configures the pins on your arm
CPU and try to find the irq

0:18:19.570,0:18:25.840
will surely get the list of the pins
which are which are irq capable take in

0:18:25.840,0:18:30.370
mind that this will be different on
different arm architectures so

0:18:30.370,0:18:34.419
unfortunately on allwinner
it will always look the same because it

0:18:34.419,0:18:41.020
is allwinner architecture. actually
sunxi ! but on the Raspberry Pi for

0:18:41.020,0:18:45.880
example this will be somewhat different
but the kernel knows, and the grep is

0:18:45.880,0:18:51.490
your friend. so you wrote the device
three you load it either live or some

0:18:51.490,0:18:57.279
something on some other way you connect
your buttons and now let's try does it really

0:18:57.279,0:19:03.580
work? of course it does! we will start
evtest which will show us all the

0:19:03.580,0:19:08.350
input devices we have the new one is the
gpio-3-buttons, which is the same name

0:19:08.350,0:19:14.559
as our device three overlay and we can see
 the same things we saw in

0:19:14.559,0:19:20.230
device three we defined three keys with
this event but we free-of-charge

0:19:20.230,0:19:25.990
got for example keyboard repeat because
this is actually meant to be used for

0:19:25.990,0:19:31.630
keyboards our kernel is automatically
implementing repeat key we can turn it

0:19:31.630,0:19:35.919
off but this is example of one of the
features which you probably wouldn't

0:19:35.919,0:19:43.330
implement yourself if you are connecting
those three keys to your Arduino but but

0:19:43.330,0:19:46.120
but this is still not the
internet-of-things

0:19:46.120,0:19:49.789
if this is the Internet it should have
some kind of

0:19:49.789,0:19:56.299
Internet in it some buzzwords for
example mqtt and it really can just

0:19:56.299,0:20:01.759
install trigger-happy demon which is
nice deamon which listens to

0:20:01.759,0:20:06.830
input events and write a free file
configuration which will send the each

0:20:06.830,0:20:15.139
key pressed order MQTT and job done i
did the internet button without a line

0:20:15.139,0:20:23.419
of code the configuration one side note
here if you are designing some some

0:20:23.419,0:20:30.919
Internet of Things thingy which even if
you are only one who will use it it's a

0:20:30.919,0:20:33.889
good idea but if you are doing it for
somebody else

0:20:33.889,0:20:41.119
please don't depend on the cloud because
I wouldn't like for my door to be locked

0:20:41.119,0:20:45.590
permanently with me outside just because
my internet connection isn't working

0:20:45.590,0:20:52.999
think about it of course you can use any
buttons in this case this was the first

0:20:52.999,0:20:57.070
try actually like the three buttons
better than this one that's why this

0:20:57.070,0:21:02.419
these buttons are coming second and this
board with the buttons has one

0:21:02.419,0:21:08.840
additional nice thing and that is the
LED we said that will cover buttons and

0:21:08.840,0:21:15.379
LEDs right unfortunately this LED is 5
volts so it won't light up on 3.3 volts

0:21:15.379,0:21:24.139
but when you mentioned LEDs something
came to mind how can I use those LEDs

0:21:24.139,0:21:29.029
for something more useful than just
blinking them on or off we'll see you

0:21:29.029,0:21:34.039
later then turning them on or off it is
also useful you probably didn't know

0:21:34.039,0:21:40.580
that you can use Linux triggers to
actually display status of your MMC card

0:21:40.580,0:21:47.720
CPU load network traffic or something
else on the LEDs itself either the LEDs

0:21:47.720,0:21:51.859
which you already have on the board but
if your manufacturer didn't provide

0:21:51.859,0:21:56.679
enough of them you can always just add
random LEDs, write device tree and

0:21:56.679,0:22:01.559
define the trigger for them, and this is
an example of that

0:22:01.559,0:22:08.219
and this example is actually for this
board which is from the ThinkPad

0:22:08.219,0:22:14.019
ThinkPad dock to be exact, which
unfortunately isn't at all visible

0:22:14.019,0:22:20.169
on this picture, but you will believe me,
has actually 2 LEDs and these 3

0:22:20.169,0:22:27.489
keys and 2 LEDs actually made the arm
board which doesn't have any buttons on

0:22:27.489,0:22:36.609
it or status LEDs somewhat flashy with
buttons. that's always useful on the

0:22:36.609,0:22:41.889
other hand here I would just want to
share a few hints with you for a start

0:22:41.889,0:22:47.320
first numerate your pins because if you
compared the the picture down there

0:22:47.320,0:22:54.579
which has seven wires and are numerated
which is the second try be the first

0:22:54.579,0:23:00.579
nodes on the up you will see that in
this case i thought that there was eight

0:23:00.579,0:23:06.999
wires so the deducing what is connected
where when you have the wrong number of

0:23:06.999,0:23:14.229
wires is maybe not the good first step
on the other hand we saw the keys what

0:23:14.229,0:23:21.639
about rotary encoders? for years I was
trying to somehow persuade Raspberry Pi

0:23:21.639,0:23:28.149
1 as the lowest common denominator of
all arm boards you know cheap slow and

0:23:28.149,0:23:33.789
so on to actually work with this exact
rotary encoder the cheapest one from the

0:23:33.789,0:23:41.589
Aliexpress of course see the pattern
I tried Python I try the attaching

0:23:41.589,0:23:48.579
interrupt into Python I tried C code and
nothing worked at least didn't work

0:23:48.579,0:23:56.859
worked reliably and if you just write
the small device tree say the correct

0:23:56.859,0:24:01.809
number of steps you have at your rotary
encoder because by default it's 24 but

0:24:01.809,0:24:08.589
this particular one is 20 you will get
perfect input device for your Linux with

0:24:08.589,0:24:11.579
just a few wires

0:24:12.390,0:24:20.260
amazing so we saw the buttons we saw the
LEDs we have everything for IOT except

0:24:20.260,0:24:25.840
the relay so you saw on one of the
previous pictures this relay box it's

0:24:25.840,0:24:31.980
basically four relays separated by
optocouplers which is nice and my

0:24:31.980,0:24:39.670
suggestion since you can't in device
three you can't say this pin will be

0:24:39.670,0:24:45.790
output but I want to initially drive it
high or I want to initially drive it low

0:24:45.790,0:24:52.330
it seems like you can say that it's
documented in documentation it's just

0:24:52.330,0:24:56.440
not implemented there on every arm
architecture so you can write it in

0:24:56.440,0:25:02.440
device three but your device tree will
ignore it. you but you can and this might be

0:25:02.440,0:25:07.240
somewhat important because for example
this relay is actually powering all your

0:25:07.240,0:25:11.220
other boards and you don't want to
reboot them just because you reboot the

0:25:11.220,0:25:16.270
machine which is actually driving the
relay so you want to control that pin as

0:25:16.270,0:25:24.310
soon as possible so my suggestion is
actually to explain to Linux kernel that

0:25:24.310,0:25:30.310
this relays is actually 4 LEDs which is
somewhat true because the relay has the

0:25:30.310,0:25:36.460
LEDs on it and then use LEDs which do
have the default state which works to

0:25:36.460,0:25:41.410
actually drive it as soon as possible as
the kernel boot because kernel will boot

0:25:41.410,0:25:45.640
it will change the state of those pins
from input to output and set them

0:25:45.640,0:25:52.000
immediately to correct value so you
hopefully want want power cycle your

0:25:52.000,0:25:56.410
other boards, and then you can use the
LEDs as you would normally use them in

0:25:56.410,0:26:01.420
any other way
if LEDs are interesting to you have in

0:26:01.420,0:26:06.340
mind that on your on each of your
computers you have at least two LEDs but

0:26:06.340,0:26:10.810
this caps lock and one is non lock on
your keyboard and you can use those same

0:26:10.810,0:26:15.190
triggers I mentioned earlier on your
existing Linux machine using those

0:26:15.190,0:26:20.980
triggers so for example your caps lock
LED can blink as your network traffic

0:26:20.980,0:26:29.380
does something on your network really
it's fun on the other hand if you have a

0:26:29.380,0:26:36.370
Raspberry Pi and you defined everything
correctly you might hit into some kind

0:26:36.370,0:26:42.370
of problems that particular chip has
default pull ups which you can't turn on

0:26:42.370,0:26:49.059
for some pins which are actually
designed to be clocks of this kind or

0:26:49.059,0:26:54.220
another so even if you are not using
that pin as the SPI clock whatever you

0:26:54.220,0:26:59.110
do in your device tree you won't be able to
turn off, actually you will turn

0:26:59.110,0:27:04.240
off the the setting in the chip to for
the pull up but the pull up will be

0:27:04.240,0:27:08.140
still there actually thought that there
is a hardware resistor on board but

0:27:08.140,0:27:14.980
there isn't it's inside the chip just
word of warning so if anything I would

0:27:14.980,0:27:21.309
like to push you towards using Linux
kernel for the sensors which you might

0:27:21.309,0:27:25.570
not think of as the first choice if you
just want to add some kind of simple

0:27:25.570,0:27:32.080
sensor to to your Linux instead of
Arduino over serial port which I did and

0:27:32.080,0:27:38.049
this is the solution which might with
much less moving parts or wiring pie and

0:27:38.049,0:27:43.090
in the end once you make your own shield
for us but if I you will have to write

0:27:43.090,0:27:49.480
that device tree into the EEPROM anyway so
it's good to start learning now so I

0:27:49.480,0:27:53.890
hope that this was at least useful very
interesting and if you have any

0:27:53.890,0:28:02.140
additional questions I will be glad to
to answer them and if you want to see

0:28:02.140,0:28:07.780
one of those all winner board which can
be used with my software to show the pin

0:28:07.780,0:28:12.460
out here is one board which kost
actually borrowed me yesterday and in which

0:28:12.460,0:28:18.549
yesterday evening I actually ported the
my software which is basically just

0:28:18.549,0:28:22.330
writing the definition of those pins
over here and the pins on the header

0:28:22.330,0:28:26.950
which I basically copy pasted from the
excel sheet just to show that you can

0:28:26.950,0:28:32.830
actually do that for any board you have
with just really pin out in textual file

0:28:32.830,0:28:36.370
it's really that simple
here are some additional

0:28:36.370,0:28:38.300
links and do you have any questions?

0:28:39.420,0:28:41.420
[one?]
&lt;pre&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2018/04/dorscluc-2018-linux-sensor-device-tree-shell-iot.html
	</guid>
      </item>
      <item>
        <title>How to have a higher chance of success when restoring a big MySQL database</title>
	<link>http://vrodic.blogspot.com/2017/08/how-to-have-higher-chance-of-success.html</link>
	<pubDate>August 13, 2017 07:20</pubDate>
	<description>
	  Restoring a MySQL database is fast and easy when you just copy files in datadir when the server is shutdown, or if you use Percona xtrabackup.&lt;br /&gt;&lt;br /&gt;But if you for some reason (AWS RDS) only have MySQL protocol available for backup, you usually can have a compressed mysqldump, that is quite slow to restore, not because of the compression or because the decompressed version is a text file that needs to be parsed, but because MySQL is slow to push it through it's disk pipeline, and because it needs to build data indexes while doing a restore.&lt;br /&gt;&lt;br /&gt;I've spent multiple days babysitting the process of restoring a&amp;nbsp;&lt;b&gt;7GB gzip compressed MySQL dump&lt;/b&gt;&amp;nbsp;file, and these are results and tips that could help you save some time.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, make sure that:&lt;br /&gt;- you have enough IO available: For restoring a&amp;nbsp;&lt;b&gt;66 GB&lt;/b&gt;&amp;nbsp;datadir&amp;nbsp;&lt;b&gt;315.6 GB&lt;/b&gt;&amp;nbsp;was written to the drive (as measured with iostat), with a tuned MySQL configuration. For a DB of this size a mechanical drive doesn't cut it, and restore will take multiple days. Use a good SDD.&lt;br /&gt;&lt;br /&gt;- your database TRIGGERS &lt;b&gt;all have BEGIN/END statements&lt;/b&gt; (even though you can create them without and even thought the bug was supposed to be fixed https://bugs.mysql.com/bug.php?id=16878), &amp;nbsp;it fails on restore, with all versions of MySQL 5.7/5.6 i tried&lt;br /&gt;&lt;br /&gt;- you start with a &lt;b&gt;really empty&lt;/b&gt; database in your datadir - DB I worked with had inconsistent data types on a foreign key, when the dependent table with an inconsistent key already exists MySQL will report a foreign key error (MariaDB will be more informative), but if it doesn't it will happily restore the database&lt;br /&gt;&lt;br /&gt;- your&amp;nbsp;&lt;b&gt;max_allowed_packet&lt;/b&gt;&amp;nbsp;conf value is big enough, or you'll get a MySQL server has gone away message from your client while restoring.&lt;br /&gt;&lt;br /&gt;- your&amp;nbsp;&lt;b&gt;innodb_log_file_size &lt;/b&gt;is big enough (https://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_log_file_size) - if you have large BLOB values in your DB, restore will fail if the value is lower than 10% of your blob field. This setting is important for quick restore too&lt;br /&gt;&lt;br /&gt;- you have &lt;b&gt;log-bin&lt;/b&gt;&amp;nbsp;turned off in order to minimize your chance to run out of drive space and save IO (log-bin=Off doesn't mean that it's disabled just that the log bin files start with Off, the documentation can be confusing here :) &amp;nbsp;What worked for me is having all log-bin lines in the &lt;b&gt;mysqld &lt;/b&gt;config section commented out&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Finally, if you want it to finish quickly, use the fastest SSD you have available, and consider tuning MySQL configuration a bit. I'm also considering using a ramdisk, because it would help both with restore speed and when you need to do some DB transformations. MySQL defaults are not reasonable, especially for&amp;nbsp;&lt;b&gt;innodb_log_file_size,&amp;nbsp;&lt;/b&gt;&lt;b&gt;max_allowed_packet&lt;/b&gt;.&lt;br /&gt;&lt;br /&gt;I used excellent &lt;b&gt;pv &lt;/b&gt;for figuring out if the restore process will finish in reasonable time&lt;br /&gt;&lt;br /&gt;pv db_dump.gz |gunzip -c |mysql -uroot database_name&lt;br /&gt;&lt;br /&gt;&lt;div class="separator"&gt;&lt;a href="https://1.bp.blogspot.com/-ZfsPWkh-_9g/WY_Q4BumMJI/AAAAAAAAk5U/IEizIvfKfYklaKvWuFgrcLsdiq7py0A_gCLcBGAs/s1600/pvdbrestore.png"&gt;&lt;img border="0" height="8" src="https://1.bp.blogspot.com/-ZfsPWkh-_9g/WY_Q4BumMJI/AAAAAAAAk5U/IEizIvfKfYklaKvWuFgrcLsdiq7py0A_gCLcBGAs/s400/pvdbrestore.png" width="400" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Here's a full list of my MySQLd configuration variables that worked for me on my dev laptop&lt;br /&gt;&lt;br /&gt;#my dev laptop is low on memory, for prod server you would use a lot more&lt;br /&gt;innodb_buffer_pool_size=512M &lt;br /&gt;innodb_additional_mem_pool_size=256M&lt;br /&gt;innodb_log_buffer_size=256M&lt;br /&gt;innodb_log_file_size=512M&lt;br /&gt;max_allowed_packet=64M&lt;br /&gt;&lt;br /&gt;#for saving disk IO, dont use on prod&lt;br /&gt;innodb_flush_log_at_trx_commit = 2&lt;br /&gt;innodb_flush_method=O_DIRECT_NO_FSYNC&lt;br /&gt;skip-innodb_doublewrite&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2017/08/how-to-have-higher-chance-of-success.html
	</guid>
      </item>
      <item>
        <title>Some thoughts on (Modern) PHP</title>
	<link>http://vrodic.blogspot.com/2017/07/my-thoughts-on-php.html</link>
	<pubDate>July 30, 2017 13:45</pubDate>
	<description>
	  &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I have experience in both Java and PHP. Java mostly for traditional desktop apps, embedded UIs and PHP for websites. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Custom PHP frameworks I've built or helped build took into account the way PHP is executed: you are stateless and need to setup everything on every request (runtime is fast to start with FPM and opcode cache). Namespaces based cheap autoloader worked great. We used singletons for getting the configuration and connections to DBs. There was almost no setup code that needed to be run every time other than loading .ini based configuration and connecting to the DB. My webapps responded under 20ms (DB and other services like sphinx included), and I could get it to respond in 1 ms for things where we needed to be quick and didn't have to output HTML with Forms. It was really small and you could read the whole framework code in 1-2 hours. It worked with SQL in a reasonable way. You didn't have to write your SQL for simple CRUD, but for larger things involving joining multiple tables and more complex expressions we wrote native SQL. Caching was done thoughtfully, using &amp;nbsp;APC user cache (SHM with zero copy). It just felt nice. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I switched jobs recently, and started with Symfony 3. The thing felt like some Java framework, but poorly documented and harder to use than it should be. It had lots and lots of setup code done before handling every request. There's a whole DI framework with it's load of setup code for every component. And you have to do setup even though you don't use the component in that particular request. There are ways of doing setup lazily, but you still waste time to wire that up. Framework overhead can be 30-100ms. Other modern PHP frameworks often have similar overhead. I know that there's PHP-PM, to save some of that work that isn't really $_REQUEST specific, but it doesn't seem to be used much for production. And using Silex (deprecated by Symfony 4?) is really not that different, you still either reuse Symfony components, or rewrite them, but with similar "best practices" that are inspired by Java.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Regarding persistence, Doctrine and it's verbosity feels very ugly to me. I'd much rather use  SQL syntax for defining relationships than bunch of PHP with special syntax comments or xml or yaml. And also use real SQL for complex queries. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Everybody is using type hints wherever they can, and it feels as verbose as Java, but without compile time type safety, and you can't really put type information everywhere (class members for example). &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;So you are almost using a type safe language, but can't get performance or compile time benefits, because inevitably, you'll have to use some dynamic typing or other dynamic language features. &lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Even though PHP runtime has made great progress with 7.x (it's probably the fastest interpreted language, and it's great it has reference counted garbage collection), it feels like language is struggling to find it's identity, with it taking a lot from Java and still coping with ugly legacy ($, having to use $this inside a class function, php.ini, features for supporting templating even though it's rarely used as a templating language in modern frameworks, &lt;a href="https://3v4l.org/mcpi7"&gt;https://3v4l.org/mcpi7&lt;/a&gt;).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Learning Python and Flask (as an example) was much more enjoyable than switching from a nimble custom PHP framework to Symfony. Using NodeJS and minimalistic components to build my own framework was also nice. I'd love to try GoLang, Swift or Rust in the backend too.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;And there's the thing that most of the PHP frameworks try too hard to be full stack, when nowdays it's not rare you only do REST APIs on the backend. So there's a lot of infrastructure and assumptions in place for rendering HTML that you really don't need to use and that gets in the way when learning the framework and is wasteful when the code is executing.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;I'd argue you can write fast, simple and maintainable PHP, by using state PHP runtime has setup for you ($_POST, $_GET, $_SERVER etc), namespaces and a namespace based autoloader, trying to use pure functions when you can (using static classes shouldn't be a sin - use it to split your code in sensible parts), and using general good practices for writing readable and maintainable code (avoid long functions, huge classes, too much block nesting, decoupling, naming things in a good way). With some coding conventions you can write a decent and productive framework quickly, but you could do that with a nicer language too, so what's the point?&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;(Thankfully, I'm not using Symfony on my new job, and Yii2 does suffer from some issues too, it at least feels better for now)&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2017/07/my-thoughts-on-php.html
	</guid>
      </item>
      <item>
        <title>etckeeper, bind jnl files and git-pack memory problems</title>
	<link>http://blog.rot13.org/2016/07/etckeeper-bind-jnl-files-and-git-pack-problems.html</link>
	<pubDate>July 22, 2016 13:57</pubDate>
	<description>
	  &lt;p&gt;
For last few years, one of first tools which we install
on each new server is &lt;a href="http://etckeeper.branchable.com/"&gt;etckeeper&lt;/a&gt;.
It saved us couple of times, and provides nice documentation about
changes on the system.
&lt;/p&gt;&lt;p&gt;
However, git can take a lot of space if you have huge files
which change frequently (at least daily since etckeeper
has daily cron job to commit changes done that day). In our case,
we have bind which stores jnl files in &lt;tt&gt;/etc/bind&lt;/tt&gt; which
results in about 500 Kb change each day for 11 zones we have defined.
&lt;/p&gt;&lt;p&gt;
You might say that it doesn't seem to be so bad, but in four
months, we managed to increase size of repository from 300 Mb to
11 Gb. Yes, this is not mistake, it's 11000 Mb which is increase of 36 times!
Solution for this is to use &lt;tt&gt;git gc&lt;/tt&gt; which will in turn
call &lt;tt&gt;git-pack&lt;/tt&gt; to compress files. But this is where problems
start -- git needs a lot of RAM to do gc. Since this machine
has only 1 Gb of RAM, this is not enough to run &lt;tt&gt;git gc&lt;/tt&gt;
without running out of memory.
&lt;/p&gt;&lt;p&gt;
Last few times, I transferred git repository to other machine,
run &lt;tt&gt;git gc&lt;/tt&gt; there and than transfered it back (resulting in
nice decrease from 11 Gb back to 300 Mb), however, this is 
not ideal solution. So, let's remove bind jnl files from etckeeper...
&lt;/p&gt;&lt;p&gt;

Let's start with our 11 Gb git repo, copy it to another machine
which has 64 Gb or RAM needed for this operation.

&lt;pre&gt;
root@dns01:/etc# du -ks .git
11304708        .git

root@dns01:~# rsync -ravP /etc/.git build.ffzg.hr:/srv/dns01/etc/
&lt;/pre&gt;

Now, we will re-create local files because we need to find
out which jnl files are used so we can remove them from repo.

&lt;pre&gt;
root@build:/srv/dns01/etc# git reset --hard

ls bind/*.jnl | xargs -i git filter-branch -f --index-filter 'git rm --cache --ignore-unmatch {}'

echo 'bind/*.jnl' &gt;&gt; .gitignore
git commit -m 'ignore ind jnl files' .gitignore
&lt;/pre&gt;

Now, finally we can shrink our 11 Gb repo!

&lt;pre&gt;
root@build:/srv/dns01/etc# du -kcs .git
11427196        .git

root@build:/srv/dns01/etc# git gc
Counting objects: 38117, done.
Delta compression using up to 18 threads.
Compressing objects: 100% (27385/27385), done.
Writing objects: 100% (38117/38117), done.
Total 38117 (delta 27643), reused 12846 (delta 10285)
Removing duplicate objects: 100% (256/256), done.

root@build:/srv/dns01/etc# du -ks .git
414224  .git

# and now we can copy it back...

root@dns01:/etc# rsync -ravP build.ffzg.hr:/srv/dns01/etc/.git .
&lt;/pre&gt;

Just as side note, if you want to run &lt;tt&gt;git gc --aggressive&lt;/tt&gt; on same repo, it
won't finish with 60 Gb or RAM and 100 Gb of swap, which means
that it needs more than 150 Gb of RAM.
&lt;/p&gt;&lt;p&gt;
So, if you are storing modestly sized files which change a lot, have in
mind that you might need more RAM to run git gc (and get disk usage
under control) than you might have.
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2016/07/etckeeper-bind-jnl-files-and-git-pack-problems.html
	</guid>
      </item>
      <item>
        <title>Let's hack cheap hardware - 2016 edition</title>
	<link>http://blog.rot13.org/2016/05/lets-hack-cheap-hardware---2016-edition.html</link>
	<pubDate>May 17, 2016 10:11</pubDate>
	<description>
	  &lt;p&gt;
Last week I head pleasure to present at two conferences in two different cities:
&lt;a href="http://2016.dorscluc.org/"&gt;DORS/CLUC 2016&lt;/a&gt;
and
&lt;a href="https://makerfaireosijek.com/"&gt;Osijek Mini Maker Faire&lt;/a&gt;
on topic of cheap hardware from China which can be improved with little bit of software or hardware hacking. It was well received,
and I hope thet you will find tool or two in it which will fill your need.
&lt;/p&gt;
&lt;p&gt;
I hope to see more hacks of STM8 based devices since we have &lt;a href="http://sdcc.sourceforge.net/"&gt;sdcc compiler with support for stm8&lt;/a&gt;,
cheap SWIM programmer in form of ST-Link v2 (Chinese clones, which are also useful as ARM SWD programmers) and STM8 has comparable features
to 8-bit AVR micro-controllers but cheaper.
&lt;/p&gt;

&lt;p&gt;

&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2016/05/lets-hack-cheap-hardware---2016-edition.html
	</guid>
      </item>
      <item>
        <title>Kabelski internet i oversubscription</title>
	<link>http://vrodic.blogspot.com/2016/05/kabelski-internet-i-oversubscription.html</link>
	<pubDate>May 14, 2016 16:50</pubDate>
	<description>
	  &lt;div dir="ltr"&gt;&lt;br /&gt;&lt;span&gt;&lt;b&gt;Ovo je post iz 5.11.2014. U međuvremenu sam promjenio kabelskog operatera&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Ako imate kabelski internet to znači da najvjerovatnije koristite jednu od sljedećih kabelskih tehnologija za prijenos digitalnih podataka:&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;- &lt;/span&gt;&lt;span&gt;DOCSIS&lt;/span&gt;&lt;span&gt; 1.0, 1.1, 2.0, 3.0 ili &lt;/span&gt;&lt;span&gt;EuroDOCSIS&lt;/span&gt;&lt;span&gt; standardi&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;- PacketCable 1.0, 1.5, 2.0 standardi koji na DOCSIS bazi grade razne usluge poput telefonije i digitalne televizije&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b id="docs-internal-guid-375ee794-ea72-b6ea-e18e-dfaa02244d97"&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;Frekvencijski pojas svakog kabela podjeljen je na kanale. Širina kanala ovisi o standardu pa tako EuroDOCSIS koristi europsku širinu kanala od &lt;/span&gt;&lt;span&gt;8 MHz&lt;/span&gt;&lt;span&gt; , a DOCSIS koristi američku od &lt;/span&gt;&lt;span&gt;6 MHz&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img height="121px;" src="https://lh4.googleusercontent.com/g-I1LU2wZTvaWXHvlTVM6a_xZxmUc_XpOkYC1RpwODFg_6oGPrmSPkTTPuIfGMJ1Ssgrf8oBY6qYj_D3Yu2kexacaHEwIwDBwaI39OY6Dg2Ur6E7K4YhqKg8_iVXdARZNA" width="416px;" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption"&gt;&lt;div dir="ltr"&gt;&lt;span&gt;Podjela bandwidtha &lt;/span&gt;&lt;span&gt;koaksijalnog kabela &lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;Maksimalni &lt;/span&gt;&lt;span&gt;downstream&lt;/span&gt;&lt;span&gt; bandwidth koaksijalnog kabela je &lt;/span&gt;&lt;span&gt;4864 megabita &lt;/span&gt;&lt;span&gt;prema&lt;/span&gt;&lt;span&gt; primjeru niže&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;Svi spomenuti DOCSIS transportni standardi imaju slične karakteristike oko toga koliku downstream propusnost podržavaju po jednom megahertzu, pa tako DOCSIS podržava &lt;/span&gt;&lt;span&gt;38 megabita&lt;/span&gt;&lt;span&gt; po kanalu downloada, a EuroDOCSIS &lt;/span&gt;&lt;span&gt;50 megabita&lt;/span&gt;&lt;span&gt; po kanalu downloada.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;DOCSIS 1.1&lt;/span&gt;&lt;span&gt; je donio bolju standardizaciju i mogućnosti kontroliranja kvalitete usluge (QoS)&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;DOCSIS 2.0&lt;/span&gt;&lt;span&gt; je donio bolje upload brzine (&lt;/span&gt;&lt;span&gt;27 megabita &lt;/span&gt;&lt;span&gt;po kanalu u odnosu na DOCSIS 1.0 &lt;/span&gt;&lt;span&gt;9 megabita &lt;/span&gt;&lt;span&gt;po kanalu)&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;DOCSIS 3.0&lt;/span&gt;&lt;span&gt; je donio mogućnost da jedan korisnik istovremeno koristi više kanala tako povećavajući bandwidth.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;DOCSIS 3.1&lt;/span&gt;&lt;span&gt; izdan u Listopadu 2013. je prva veća promjena u standardu jer donosi novu modulaciju 4096 QAM i odustaje od podjele kanala na 6 ili 8 MHz i umjesto toga koristi manje OFDM podkanale i u idealnim uvjetima podržava brzine do &lt;/span&gt;&lt;span&gt;10 gigabita&lt;/span&gt;&lt;span&gt; downstream i &lt;/span&gt;&lt;span&gt;1 gigabit&lt;/span&gt;&lt;span&gt; upstream. Još nije u primjeni.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;E sad, sve je to divno i krano, ali zašto je uz takve ogromne brojke moj internet spor?&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;Koaksijalni kabel je medij koji dijelimo sa drugim korisnicima, za razliku od DSL-a gdje svaki modem ima &lt;/span&gt;&lt;span&gt;vlastitu bakrenu paricu&lt;/span&gt;&lt;span&gt; do centrale, kod kabelskih mreža dijelimo medij sa &lt;/span&gt;&lt;span&gt;neodređenim &lt;/span&gt;&lt;span&gt;i samo vašem ISP-u poznatim brojem korisnika. Obično operater nudi i uslugu kabelske televizije te je prostor za vaš internet &lt;/span&gt;&lt;span&gt;sužen sa brojem kanala koji se koriste za TV uslugu&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;h2&gt;&lt;span&gt;Ajmo vidjeti jedan primjer u praksi na zagrebačkom području, za &lt;/span&gt;&lt;span&gt;downstream&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;/h2&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;&lt;div&gt;&lt;table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://upload.wikimedia.org/wikipedia/commons/e/e4/Motorola_SBV5121E.jpg" height="200" width="149" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption"&gt;Motorola SBV5121E&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;div&gt;&lt;span&gt;Koristi se modem Motorola SBV5121E (DOCSIS 2.0 i niže), što prema specifikaciji [&lt;/span&gt;&lt;a href="http://www.wiretechsa.com.ar/PDF/equipamientointernet/SBV5121.pdf"&gt;&lt;span&gt;2&lt;/span&gt;&lt;/a&gt;&lt;span&gt;] znači da ima bandwidth za downstream od &lt;/span&gt;&lt;span&gt;88 do 860 MHz sa&lt;/span&gt;&lt;span&gt; američkom širinom kanala od &lt;/span&gt;&lt;span&gt;6 MHz&lt;/span&gt;&lt;span&gt;. Znači 772/6 = &lt;/span&gt;&lt;span&gt;128 kanala. Operater koji sam analizirao po mom saznanju &lt;b&gt;40 analognih TV&lt;/b&gt; kanala i&lt;b&gt; 113 digitalnih&lt;/b&gt;&lt;/span&gt;&lt;span&gt;. Recimo da se za ovih&lt;b&gt; &lt;/b&gt;113 digitalnih troši 30 6 MHz kanala u kabelu. Što znači da recimo srijedu uvečer, kad se ljudi vrate sa posla i škole, samo &lt;b&gt;5&lt;/b&gt;&lt;/span&gt;&lt;span&gt;8 različitih kućanstava (kanala) &lt;/span&gt;&lt;span&gt;može istovremeno surfati punom brzinom od &lt;/span&gt;&lt;span&gt;38 megabita&lt;/span&gt;&lt;span&gt;, svaki sljedeći korisnik koji krene surfati smanjuje brzinu ovim ostalima.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;table cellpadding="0" cellspacing="0" class="tr-caption-container"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;img height="164" src="https://lh3.googleusercontent.com/mcSfn0S7bBle2gOnounuDtlWavytD5eXO8nmlXufKMiIIrB44ApGB02wHXZNlaO0c-vKFbEgim1o80f-v-rnfsDMVBHxF4tbWQAxrIr0AF7NkBfU4vb8oz19avevVKvm4w" width="640" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td class="tr-caption"&gt;Graf latencije (do prvog hop-a) na primjeru Zagrebačkog ISP-a dok korisnik osim za mjerenje ne koristi uslugu.&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;Operater kojeg sam analizirao nudi brzine od &lt;/span&gt;&lt;span&gt;8 megabita&lt;/span&gt;&lt;span&gt;, što znači da bi teoretski trebao moći dati traženi bandwidth za (38/8) *58 = 275&lt;/span&gt;&lt;span&gt; korisnika&lt;/span&gt;&lt;span&gt;, no pošto se tu vrijeme provedeno na kanalu po korisniku mora smanjiti kako bi se &lt;/span&gt;&lt;span&gt;jedan kanal podjelio na više kućanstava&lt;/span&gt;&lt;span&gt;, u tim slučajevima, čak i da surfa samo &lt;/span&gt;&lt;span&gt;275 kućanstava&lt;/span&gt;&lt;span&gt;, njihova latencija (&lt;/span&gt;&lt;span&gt;ICMP ping&lt;/span&gt;&lt;span&gt;) sa odličnih &lt;/span&gt;&lt;span&gt;6-7 ms &lt;/span&gt;&lt;span&gt;počinje rasti na (worst case, puna utilizacija na 418 korisnika) 4.75*7= 33 ms (molim ispravak ako je računica netočna, uzimam u obzir najmanju veličinu ICMP paketa tj. najmanju moguću diskretnu jedinicu u kojoj je moguće ostvariti komunikaciju).&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;Dodatni problem je što DOCSIS 2.0 i niži ne omogućavaju brzo prebacivanje među kanalima, što znatno otežava dobru iskoristivost frekventnog spektra kabela (možda na drugim kanalima ima značajno više prostora za prijenos podataka). &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;div&gt;&lt;span&gt;U svakom slučaju, ako je previše korisnika koji dijele isti resurs (isti &lt;/span&gt;&lt;span&gt;6 MHz&lt;/span&gt;&lt;span&gt; kanal, isti kabel) dolazi do drastičnog brzine pristupa pa tako kod ISP-a koji sam analizrao bandwidth pada na &lt;/span&gt;&lt;span&gt;ispod 1 megabita&lt;/span&gt;&lt;span&gt;, a ping ide i &lt;/span&gt;&lt;span&gt;iznad 140 ms&lt;/span&gt;&lt;span&gt;, uz &lt;/span&gt;&lt;span&gt;česti packet loss&lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;span&gt;Rijetko kada svih korisnici žele istovremeno i na period dulji od nekoliko minuta maksimalni bandwidth, pa je moguće (prema brojkama u primjeru) imati &lt;b&gt;10x &lt;/b&gt;više korisnika nego što je ukupnog kapaciteta (npr.  418 korisnika na 8 megabita na 88 kanala nego 4180 korisnika) a da sami korisnici ne primjete probleme u brzini pristupa, ali to uvelike ovisi o načinu korištenja Interneta.&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;Moguće je da će više učenja na daljinu, skidanja igara preko Steam-a i sličnih servisa itd. značajno promjeniti navike korisnika u budućnosti. &lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;Posao dijeljenja bandwidtha kada je više korisnika od broja slobodnih kanala rade zajedno modem kod korisnika i &lt;/span&gt;&lt;span&gt;CMTS&lt;/span&gt;&lt;span&gt; uređaj kod operatera. CMTS radi mnoge slične funkcije koje u DSL sustavima radi DSLAM, ali uzevši u obzir karakteristike dijeljenog koaksijalnog medija. CMTS omogućava da i &lt;/span&gt;&lt;span&gt;do 1000 korisnika dijeli isti 6 MHz kanal&lt;/span&gt;&lt;span&gt;. Koristi tehniku zvanu &lt;a href="http://en.wikipedia.org/wiki/Statistical_multiplexing"&gt;Statistical time division multiplexing&lt;/a&gt;. Nisam našao na podatak može li jedan CMTS uređaj stvarno i napuniti svih &lt;/span&gt;&lt;span&gt;128 downstream kanala&lt;/span&gt;&lt;span&gt; i još &lt;/span&gt;&lt;span&gt;60 Mhz upstream &lt;/span&gt;&lt;span&gt;bandwidtha&lt;/span&gt;&lt;span&gt;. &lt;/span&gt;&lt;span&gt;Svakako mu za to treba barem 10 gbit ethernet sučelje. &lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;ISP može poboljšati infrastrukturu tako da &lt;/span&gt;&lt;span&gt;smanji broj korisnika koji dijele jedan jedini kabel&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;ili poveća broj kanala koji se koriste za DOCSIS &lt;/span&gt;&lt;span&gt;ukoliko medij ima slobodne kanale. &lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt; &lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;div&gt;&lt;span&gt;Također, ISP može početi koristiti digitalnu TV kako bi iskoristio mogućnost digitalne kompresije video i audio zapisa i time smanjio potreban bandwidth po TV kanalu za bar&lt;/span&gt;&lt;span&gt; 4 puta&lt;/span&gt;&lt;span&gt; (moguće i više sa kompresijom naprednijom od MPEG2), no ovo znači da operater &lt;/span&gt;&lt;span&gt;mora svim korisnicima zamjeniti receivere za TV&lt;/span&gt;&lt;span&gt;, što može biti značajna investicija. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Osnovana je i Facebook grupa gdje se korisnici mogu požaliti na svog operatera ili raspravljati o boljim operaterima i tehnlogijama poput recimo FTTH ili VDSL-a. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;Pridružite nam se na:&lt;/span&gt;&lt;/div&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span&gt;&lt;a href="https://www.facebook.com/groups/hocuboljiinternet/"&gt;https://www.facebook.com/groups/hocuboljiinternet/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;Linkovi:&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;[1]&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;&lt;a href="http://en.wikipedia.org/wiki/DOCSIS"&gt;http://en.wikipedia.org/wiki/DOCSIS&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;[2] &lt;a href="http://www.wiretechsa.com.ar/PDF/equipamientointernet/SBV5121.pdf"&gt;http://www.wiretechsa.com.ar/PDF/equipamientointernet/SBV5121.pdf&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;[3] &lt;a href="http://computer.howstuffworks.com/cable-modem.htm"&gt;http://computer.howstuffworks.com/cable-modem.htm&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;span&gt;[4] &lt;a href="http://www.lightreading.com/cable-video/docsis/docsis-31-whats-next/d/d-id/708425"&gt;http://www.lightreading.com/cable-video/docsis/docsis-31-whats-next/d/d-id/708425&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;[5]&amp;nbsp;&lt;a href="http://www.cisco.com/c/dam/en/us/solutions/collateral/service-provider/cable-high-speed-data-hsd-solutions/gateway_to_connected_life_white_paper.pdf"&gt;http://www.cisco.com/c/dam/en/us/solutions/collateral/service-provider/cable-high-speed-data-hsd-solutions/gateway_to_connected_life_white_paper.pdf&lt;/a&gt;&lt;/div&gt;&lt;div dir="ltr"&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2016/05/kabelski-internet-i-oversubscription.html
	</guid>
      </item>
      <item>
        <title>Smart public transport with small automated, semi-automated or manually driven vehicles</title>
	<link>http://vrodic.blogspot.com/2016/05/smart-public-transport-with-small.html</link>
	<pubDate>May 01, 2016 14:08</pubDate>
	<description>
	  Here's just and idea (feel free to use it in any way):&lt;br /&gt;&lt;br /&gt;Imagine having a network of small (4-6 passengers) vehicles servicing a city for daily transportation needs. Users would enter a desired location and arrival time. The arrival time could be flexible (within an hour, if not then the price could be appropriately higher) and the user would announce any regularity (for example detailing a weekly commute) that could be used for future planning.&lt;br /&gt;&lt;br /&gt;The centralized system would optimize the problem of getting all passengers to their respective &amp;nbsp;locations and suggest departure time and location (preferably within a few minutes of walking distance).&lt;br /&gt;&lt;br /&gt;An interesting open source implementation would use OpenStreetMap data and have simulations and visualizations. A commercial entity could deal with deployments on various locations and provide a stable software as a service around the core open implementation. Autonomous vehicles would provide much more efficient operation of such a network and lower the costs significantly.
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2016/05/smart-public-transport-with-small.html
	</guid>
      </item>
      <item>
        <title>Debian OpenLDAP with GnuTLS and OpenSSL certificates</title>
	<link>http://blog.rot13.org/2016/01/debian-openldap-with-gnutls-and-openssl-certificates.html</link>
	<pubDate>January 19, 2016 10:00</pubDate>
	<description>
	  &lt;p&gt;
Every few years we have to renew SSL certificates. And there is always something which can go wrong.
 So I decided to reproduce exact steps here so that Google can find it for next unfortunate soul who has
same problem.
&lt;/p&gt;

&lt;p&gt;
Let's examine old LDAP configuration:
&lt;pre&gt;
deenes:/etc/ldap/slapd.d# grep ssl cn\=config.ldif 
olcTLSCACertificateFile: /etc/ssl/certs/chain-101-mudrac.ffzg.hr.pem
olcTLSCertificateFile: /etc/ssl/certs/cert-chain-101-mudrac.ffzg.hr.pem
olcTLSCertificateKeyFile: /etc/ssl/private/mudrac.ffzg.hr.gnutls.key
&lt;/pre&gt;
We need to convert OpenSSL key into format which GnuTLS understands:
&lt;pre&gt;
deenes:/etc/ssl/private# certtool -k &amp;lt; star_ffzg_hr.key &amp;gt; /tmp/star_ffzg_hr.gnutls.key
&lt;/pre&gt;
Than we need to create certificate which includes our certificate and required chain in same file:
&lt;pre&gt;
deenes:/etc/ldap/slapd.d# cat /etc/ssl/certs/star_ffzg_hr.crt /etc/ssl/certs/DigiCertCA.crt &gt; /etc/ssl/certs/chain-star_ffzg_hr.crt
&lt;/pre&gt;
All is not over yet. OpenLDAP doesn't run under root priviledges, so we have to make sure that it's user is
in ssl-cert group and that our certificates have correct permissions:
&lt;pre&gt;
deenes:/etc/ldap/slapd.d# id openldap
uid=109(openldap) gid=112(openldap) groups=112(openldap),104(ssl-cert)

deenes:/etc/ldap/slapd.d# chgrp ssl-cert \
/etc/ssl/certs/DigiCertCA.crt \
/etc/ssl/certs/star_ffzg_hr.crt \
/etc/ssl/certs/chain-star_ffzg_hr.crt \
/etc/ssl/private/star_ffzg_hr.gnutls.key

deenes:/etc/ldap/slapd.d# chmod 440 \
/etc/ssl/certs/DigiCertCA.crt \
/etc/ssl/certs/star_ffzg_hr.crt \
/etc/ssl/certs/chain-star_ffzg_hr.crt \
/etc/ssl/private/star_ffzg_hr.gnutls.key

deenes:/etc/ldap/slapd.d# ls -al \
/etc/ssl/certs/DigiCertCA.crt \
/etc/ssl/certs/star_ffzg_hr.crt \
/etc/ssl/certs/chain-star_ffzg_hr.crt \
/etc/ssl/private/star_ffzg_hr.gnutls.key
-r--r----- 1 root ssl-cert 3764 Jan 19 09:45 /etc/ssl/certs/chain-star_ffzg_hr.crt
-r--r----- 1 root ssl-cert 1818 Jan 17 16:13 /etc/ssl/certs/DigiCertCA.crt
-r--r----- 1 root ssl-cert 1946 Jan 17 16:13 /etc/ssl/certs/star_ffzg_hr.crt
-r--r----- 1 root ssl-cert 5558 Jan 19 09:23 /etc/ssl/private/star_ffzg_hr.gnutls.key
&lt;/pre&gt;
Finally, we can modify LDAP configuration to use new files:
&lt;pre&gt;
deenes:/etc/ldap/slapd.d# grep ssl cn\=config.ldif 
olcTLSCACertificateFile: /etc/ssl/certs/DigiCertCA.crt
olcTLSCertificateFile: /etc/ssl/certs/chain-star_ffzg_hr.crt
olcTLSCertificateKeyFile: /etc/ssl/private/star_ffzg_hr.gnutls.key
&lt;/pre&gt;
We are done, restart slapd and enjoy your new certificates!
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2016/01/debian-openldap-with-gnutls-and-openssl-certificates.html
	</guid>
      </item>
      <item>
        <title>FSec 2015 - Raspberry PI for all your GPIO needs</title>
	<link>http://blog.rot13.org/2015/09/fsec-2015---raspberry-pi-for-all-your-gpio-needs.html</link>
	<pubDate>September 24, 2015 11:52</pubDate>
	<description>
	  &lt;p&gt;
When I started playing with Raspberry Pi, I was a novice 
in electronics (and I should probably note that I'm still one :-).
&lt;/p&gt;&lt;p&gt;
But since then, I did learn a few things, and along that
journey I also figured out that Raspberry Pi is great little
device which can be used as 3.3V programmer for AVR, JTAG,
SWD or CC111x devices (and probably more).
&lt;/p&gt;&lt;p&gt;
I collected all my experiences in presentation embedded below
which I had pleasure to present at FSec conference this year.
I hope you will find this useful.
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2015/09/fsec-2015---raspberry-pi-for-all-your-gpio-needs.html
	</guid>
      </item>
      <item>
        <title>DORS/CLUC 2015: AVR component tester</title>
	<link>http://blog.rot13.org/2015/06/dorscluc-2015-avr-component-tester.html</link>
	<pubDate>June 20, 2015 12:10</pubDate>
	<description>
	  &lt;p&gt;
Few weeks ago, we had our annual conference DORS/CLUC 2015 on which I had interesting (hopefully)
presentation about AVR component tester. Since then, we got video recording of conference, so
below you can find embedded presentation and video recording (in Croatian).
&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
&lt;p&gt;

&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2015/06/dorscluc-2015-avr-component-tester.html
	</guid>
      </item>
      <item>
        <title>Overview of ganeti cluster from command line: ps, kvm, proc and tap</title>
	<link>http://blog.rot13.org/2015/01/overview-of-ganeti-cluster-from-command-line-ps-kvm-proc-tap.html</link>
	<pubDate>January 30, 2015 12:35</pubDate>
	<description>
	  &lt;p&gt;
We have been running ganeti cluster in our institution for more than a year now.
We did two cycles of machine upgrades during that time, and so far we where very
pleased with ability of this cloud platform. However, last week we had a problem
with our instances -- two of them got owned and started generating DoS service attack
to external resources. From our side it seemed at first like our upstream link is
over saturated, and we needed to way to figure out why it is.
&lt;/p&gt;
&lt;a href="http://blog.rot13.org/assets_c/2015/01/gnt-info-255.html"&gt;&lt;img src="http://blog.rot13.org/assets_c/2015/01/gnt-info-thumb-320x473-255.png" width="320" height="473" alt="gnt-info.png" class="mt-image-right" /&gt;&lt;/a&gt;
&lt;p&gt;
At first, it seemed like this would be easy to do. Using &lt;tt&gt;dstat&lt;/tt&gt;,i
I found that we are generating over 3 Gb/s traffic every few seconds to
outside world. We have 1 Gb/s upstream link, but our bonded interfaces
on ganeti nodes can handle 3 Gb/s of traffic, so for a start we where
saturating our own link.
&lt;/p&gt;
&lt;p&gt;
But which instance did that? I had to run &lt;tt&gt;dstat&lt;/tt&gt; on every node in our
cluster until I found two nodes which had instances which where overloading our link.
Using &lt;tt&gt;iftop&lt;/tt&gt; I was able to get hostname and IP address of instances which
I wanted to shut down. However, this is where problems started.
We didn't have DNS entries for them, and although I had IP and mac address of
instances I didn't had easy way to figure our which instance has that mac.
&lt;/p&gt;
&lt;p&gt;
Than I figured out that I can get mac from kvm itself, using &lt;tt&gt;ps&lt;/tt&gt;.
Once I found instances it was easy to stop then and examine what happened with them.
&lt;/p&gt;
&lt;p&gt;
But, this got me thinking. Every time I have a troubleshooting problem with ganeti,
I basically use more or less same command-line tools to figure out what is going on.
But I didn't have a tool which would display me some basic stats about instance,
but including mac addresses and network traffic (which in our configuration are tap
devices added to bridges).
So I wrote, &lt;a href="https://github.com/ffzg/gnt-info"&gt;gnt-info&lt;/a&gt;
which presents nice overview of your instances in ganeti cluster which you can
grep to drill-down into particular instance or host.
&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://blog.rot13.org/2015/01/overview-of-ganeti-cluster-from-command-line-ps-kvm-proc-tap.html
	</guid>
      </item>
      <item>
        <title>A tale of false alarm by ConfigServer, CPanel and a hosting provider.</title>
	<link>http://vrodic.blogspot.com/2014/03/a-tale-of-false-alarm-by-configserver.html</link>
	<pubDate>March 06, 2014 14:14</pubDate>
	<description>
	  &lt;br /&gt;I'm responsible for a couple of CPanel/WHM managed dedicated servers.&lt;br /&gt;&lt;br /&gt;We &amp;nbsp;keep them updated, and try to do as little customization as possible outside of what cPanel knows about. We enabled mod_proxy_fcgi and PHP-FPM, so we can use Apache 2.4 MPM Event for our fairly high traffic web site. It's a unfortunate that CPanel doesn't have this configuration available out of the box, but that's for another blog post.&lt;br /&gt;&lt;br /&gt;Today early in the morning we got a message from our lfd daemon (a service installed by a free ConfigServer Security &amp;amp; Firewall CPanel plugin installed by our hosting provider):&lt;br /&gt;&lt;br /&gt;&lt;blockquote class="tr_bq"&gt;The following list of files have FAILED the md5sum comparison test. This means that the file has been changed in some way. This could be a result of an OS update or application upgrade. If the change is unexpected it should be investigated:&lt;br /&gt;/usr/bin/ghostscript: FAILED&lt;br /&gt;/usr/bin/gs: FAILED&lt;/blockquote&gt;&lt;br /&gt;The funny thing is, nothing upgraded any RPM files in this time window, our /var/log/yum.log didn't mention any upgrades to ghostscript package that provides the /usr/bin/gs binary (/usr/bin/ghostscript is a symlink to gs), we have disabled automatic updates that can be initiated by the cpanel upcp --cron sciprt, but the system us regulagrly kept up to date manually with yum update.&lt;br /&gt;&lt;br /&gt;I've reinstalled the package with yum reinstall ghostscript (ghostscript-8.70-19.el6.x86_64 was reinstalled)&lt;br /&gt;&lt;br /&gt;and the binary size and md5sum changed like this:&lt;br /&gt;&lt;br /&gt;before:&lt;br /&gt;size: 19152 bytes&lt;br /&gt;md5sum: c64b5016d94450b476148c31cfef61ff&lt;br /&gt;&lt;br /&gt;after reinstall:&lt;br /&gt;size: 6760 bytes&lt;br /&gt;md5sum: 73db43e258c4b191757b7ba75a883321&lt;br /&gt;&lt;br /&gt;This is what actually happened: Our managed hosting provider had apparently changed our setup to upgrade our system packages automatically (probably with best intentions due to recent gnutls issue). And prelinking seems to be enabled on our system, so when upcp (CPanel automatic upgrade cron script that runs periodically) executed&amp;nbsp;/usr/local/cpanel/scripts/rpmup to upgrade system packages, it also did the prelinking step, adding extra prelinking stuff to our /usr/bin/gs binary.&lt;br /&gt;&lt;br /&gt;Similar issue described here:&lt;br /&gt;&lt;br /&gt;http://linsec.ca/blog/2012/01/23/rpm-v-and-prelinked-binaries/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2014/03/a-tale-of-false-alarm-by-configserver.html
	</guid>
      </item>
      <item>
        <title>Dota 2 performance: Linux/native vs Linux/Wine vs Windows 7 on Intel GPU</title>
	<link>http://vrodic.blogspot.com/2013/08/dota-2-performance-linuxnative-vs.html</link>
	<pubDate>September 05, 2013 16:35</pubDate>
	<description>
	  So how well does the mega popular game Dota 2 work on Linux? I've had some time to make detailed tests on my Intel IvyBridge GPU laptop (Lenovo ThinkPad X230). The graphics settings are the same on all versions.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;b&gt;Dota 2 Windows binary under Wine 1.6&lt;/b&gt;&lt;br /&gt;Startup: 35 secs (over ntfs3g userspace fs driver that is not that fast)&lt;br /&gt;Mem: 1.0GB&lt;br /&gt;FPS: 37.5 FPS&lt;br /&gt;Power usage LP mode (patched wine): 34W&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Dota 2 Linux native&lt;/b&gt;&lt;br /&gt;Startup: 1 min 14 secs (native ext4)&lt;br /&gt;Mem: 2.6 GB&lt;br /&gt;FPS: 40 FPS&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Dota 2 Windows native - Windows 7&lt;/b&gt;&lt;br /&gt;Startup: 25 secs&lt;br /&gt;Mem: 1.2GB (measured by Windows Task manager)&lt;br /&gt;FPS: 80 FPS&lt;br /&gt;Power usage LP mode: 24W&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Test setup:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;CPU: Core i5 3320M&lt;br /&gt;&lt;br /&gt;Resolution:&amp;nbsp;1366x768&lt;br /&gt;&lt;br /&gt;GPU settings (same on all Dota 2 versions): shadows MEDIUM, textures HIGH, render quality: HIGHEST, all other: OFF, vsync: disabled&lt;br /&gt;&lt;br /&gt;GPU settings LP mode (for power measurments above): Shadowd low, effects OFF, textures MED, render quality: LOWEST, fpx_max: 30&lt;br /&gt;&lt;br /&gt;Mesa version:&amp;nbsp;git-8b5b5fe (with rendering regression fix from here:&amp;nbsp;&lt;a href="https://bugs.freedesktop.org/show_bug.cgi?id=67887"&gt;https://bugs.freedesktop.org/show_bug.cgi?id=67887&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;Linux distro: Ubuntu 13.10, kernel 3.11 drm-intel-nightly, running LXDE&lt;br /&gt;&lt;br /&gt;FPS Benchmark method:&lt;br /&gt;in "dota 2 beta/dota/cfg/autoexec.cfg"&lt;br /&gt;cl_showfps 2&lt;br /&gt;playdemo&amp;nbsp;&lt;a href="http://mjesec.ffzg.hr/~vrodic/dota/test.dem"&gt;test&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;For FPS measurement number: look at the last 240 frames when the demo is ending&lt;br /&gt;&lt;br /&gt;Memory measuring: RES column with `top`&lt;br /&gt;Startup time measuring: stopwatch until the map is loaded&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Analysis of the apitrace trace file:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;I've made a trace of Dota 2 with apitrace, revealing possible performance issues.&lt;br /&gt;&lt;br /&gt;Before the first frame of the game is drawn 11038 shaders are compiled. That is most likely why the load time is so slow and memory usage is so high. In addition a lot of the shaders being used seem to be recompiled by the Intel driver when rendering frames.&lt;br /&gt;&lt;br /&gt;There are 162 frames in the trace I've analyzed, 193 shader recompiles, and 643 different shader programs (each program has 1 VS and 1 FS) used.&lt;br /&gt;&lt;br /&gt;In contrast, Wine version of Dota 2 compiles only 220 shaders.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Performance feedback from the Intel driver:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;glretrace of apitrace prints driver performance warnings. A sample of some that repeat every frame. These include shader recompile warnings.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;575332: glDebugOutputCallback: Medium severity API performance issue 13, Clear color unsupported by fast color clear.  Falling back to slow clear. &lt;/i&gt;&lt;br /&gt;&lt;i&gt;576094: glDebugOutputCallback: Medium severity API performance issue 14, Failed to fast clear depth due to scissor being enabled.  Possible 5% performance win if avoided. &lt;/i&gt;&lt;br /&gt;&lt;i&gt;577739: glDebugOutputCallback: Medium severity API performance issue 4, Using a blit copy to avoid stalling on 480b glBufferSubData() to a busy buffer object. &lt;/i&gt;&lt;br /&gt;&lt;i&gt;577801: glDebugOutputCallback: Medium severity API performance issue 8, Recompiling vertex shader for program 7901 &lt;/i&gt;&lt;br /&gt;&lt;i&gt;577801: glDebugOutputCallback: Medium severity API performance issue 9,   Didn't find previous compile in the shader cache for debug &lt;/i&gt;&lt;br /&gt;&lt;i&gt;577801: glDebugOutputCallback: Medium severity API performance issue 1, Recompiling fragment shader for program 7901 &lt;/i&gt;&lt;br /&gt;&lt;i&gt;577801: glDebugOutputCallback: Medium severity API performance issue 10,   Didn't find previous compile in the shader cache for debug &lt;/i&gt;&lt;br /&gt;&lt;i&gt;577801: glDebugOutputCallback: Medium severity API performance issue 3, FS compile took 2.266 ms and stalled the GPU  &lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Warnings in sequence in URL below:&lt;br /&gt;&lt;a href="https://gist.github.com/vrodic/6235313"&gt;https://gist.github.com/vrodic/6235313&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It's interesting that most of this warnings were added by request of Valve back in 2012:&lt;br /&gt;&lt;a href="http://lists.freedesktop.org/archives/mesa-dev/2012-August/025288.html"&gt;http://lists.freedesktop.org/archives/mesa-dev/2012-August/025288.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Conclusion:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If you have a memory constrained machine and want to run under Linux, maybe using Wine is a better choice.&lt;br /&gt;&lt;br /&gt;I hope Valve cares enough about Linux to fix what they can on their side and work with folks from Intel to fix their performance problems.&lt;br /&gt;&lt;br /&gt;You will probably be luckier if you run it on nVidia GPU, since people in general are claiming performance very similar to Windows. Though probably still with slower startup times and higher mem usage.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Some info on how to compile Mesa 32 bit on 64bit Ubuntu:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Unfortunately this doesn't work with old Ubuntu versions, just with 13.10. For old version you must also remove 64 bit versions of the compiler, which was a bit too much of a requirement for me.&lt;br /&gt;&lt;br /&gt;&lt;i&gt;apt-get install&amp;nbsp;gcc-multilib&amp;nbsp;g++-multilib&amp;nbsp;binutils-multiarch&amp;nbsp;libx11-dev:i386&amp;nbsp;libdrm-dev:i386&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;and as configure complains install others&lt;br /&gt;&lt;i&gt;&lt;br /&gt;&lt;/i&gt;&lt;i&gt;apt-get build-dep mesa -ai386&amp;nbsp;&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;wants to install too much and remove some 64 bit stuff I need, and we don't actually need llvm i386 dev stuff for &amp;nbsp;compiling just the Intel driver.&lt;br /&gt;&lt;br /&gt;I use this script to compile just the i965 driver for mesa:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;sh autogen.sh&lt;/i&gt;&lt;br /&gt;&lt;i&gt;make clean&lt;/i&gt;&lt;br /&gt;&lt;i&gt;export CFLAGS="-m32 -O3 -mtune=native -march=native -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;export CXXFLAGS="-m32 -O3 -mtune=native -march=native -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"&lt;/i&gt;&lt;br /&gt;&lt;i&gt;export PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig&lt;/i&gt;&lt;br /&gt;&lt;i&gt;./configure --disable-egl --enable-glx-tls --with-gallium-drivers= --with-dri-drivers=i965 --enable-32-bit&lt;/i&gt;&lt;br /&gt;&lt;i&gt;make -j4&lt;/i&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2013/08/dota-2-performance-linuxnative-vs.html
	</guid>
      </item>
      <item>
        <title>Dota 2 Wine optimization for Intel GPUs</title>
	<link>http://vrodic.blogspot.com/2013/08/dota-2-wine-optimization-for-intel-gpus.html</link>
	<pubDate>September 04, 2013 16:59</pubDate>
	<description>
	  Dota 2 for Linux implements it's 3D engine by using a Direct3D to OpenGL translation layer called ToGL. I assume that this layer can be used in different ways, but for Dota 2 it seems to be used in a less than ideal way as documented previously &lt;a href="http://vrodic.blogspot.com/2013/08/dota-2-performance-linuxnative-vs.html"&gt;here&lt;/a&gt;. In short, Dota for Linux compiles 11000 shaders on startup, compared to just 220 the Wine version does. This causes much higher memory usage (1.2 GB vs 2.6 GB) and start-up time&amp;nbsp;(35 seconds vs 1:15 min).&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;With Wine we actually do get the source of their Direct3D to OpenGL layer called wined3d, since Wine is open source. It's funny, the stack used to run Windows version of Dota 2 is actually more open.&lt;br /&gt;&lt;br /&gt;Since Dota 2 for Windows when run on Wine actually outperforms native Linux version in some important aspects, and it's framerate is just slightly less, I decided to take a look on improving its performance.&lt;br /&gt;&lt;br /&gt;I've used a tool called apitrace to record a trace of a Dota 2 session with wine so I can analyze the OpenGL calls and look at driver performance warnings (INTEL_DEBUG=perf) with qapitrace.&lt;br /&gt;&lt;br /&gt;I optimized two things:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Reduce the number of vs and ps constants checked&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;There were many calls to check values of VS (vertex shader) and PS (pixel shader, also called fragment shaders in OpenGL) constants each frame like this:&lt;br /&gt;&lt;br /&gt;532550 glGetUniformLocationARB(programObj = 152, name = "vs_c[4095]") = -1&lt;br /&gt;&lt;br /&gt;This function is called from shader_glsl_init_vs_uniform_locations() in glsl_shader.c in&lt;br /&gt;wined3d.&lt;br /&gt;&lt;br /&gt;It uses GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, defined to be 4096 in #define MAX_UNIFORMS in Mesa source.&lt;br /&gt;&lt;br /&gt;Dota 2 doesn't need so many uniforms, most checks return -1, and wined3d checks all of values for both VS&lt;br /&gt;and PS uniforms.&lt;br /&gt;&lt;br /&gt;I reduced this number to 256, just enough for Dota 2. This saved thousands of calls per frame.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Use fast clear depth more often&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Intel driver complains about not being able to use fast depth clears because of scissor being enabled. Turns out that device_clear_render_targets() in wined3d device.c doesn't really need to do glScissor for Dota 2, it's probably an optimization that maps better to Direct3D driver.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A small patch including both optimizations is here:&lt;br /&gt;&lt;a href="https://gist.github.com/vrodic/6437312"&gt;https://gist.github.com/vrodic/6437312&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This patch is a hack, and glScissor part probably breaks other apps, so this is just for Dota 2. It maybe could be made in a better way so it could be merged in Wine, but I'm not wined3d expert.&lt;br /&gt;&lt;br /&gt;So how faster is it? A solo mid hero on a setup described in the previous blog post used to get &lt;b&gt;41 FPS&lt;/b&gt;. Now it gets &lt;b&gt;46-49 FPS&lt;/b&gt;. Native version is similar to optimized Wine, but in some situations it gets worse than Wine optimized.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Ideas for improvement:&lt;/b&gt;&lt;br /&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;Dota 2 for Linux needs &amp;nbsp;~7500 calls per frame. Wine version, even after my optimizations needs 37000 (EDIT: just as I was writing this post, there were some &lt;a href="http://source.winehq.org/git/wine.git/commit/37d1e8b79cfc2c4ca7b947589574179470a06c42"&gt;improvements&lt;/a&gt;, now its about 22000).&lt;br /&gt;&lt;br /&gt;There is probably a way to optimize this even more, but it's outside of the scope of an afternoon project, &amp;nbsp;like this was. I'd like to keep on digging though.&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2013/08/dota-2-wine-optimization-for-intel-gpus.html
	</guid>
      </item>
      <item>
        <title>Restarting</title>
	<link>http://ipozgaj.blogspot.com/2013/01/restarting.html</link>
	<pubDate>January 07, 2013 08:28</pubDate>
	<description>
	  &lt;p dir="ltr"&gt;This week it came to my mind it's been more than a half of a year since my last post. Be assured, it was for a reason. This was probably the most&amp;#160;exciting half of a year ever in my life, so let's start from the beginning.&lt;/p&gt;&lt;p dir="ltr"&gt;So what changed since then? Long story put short - I got married, I relocated from Croatia to California, and got my first Silicon Valley job. After interviewing and examining my options for a really long time (partly my fault, partly due to a really long interviewing process) with Google and then Facebook, I finally got an offer from Facebook to work in their HQ in Menlo Park, CA as a production/infractructure engineer. The position described was really awesome, basically a great hacking job involving programming, system administration and design, scaling etc. Basically a devops position. I relocated to San Francisco in late September. &lt;/p&gt;&lt;p dir="ltr"&gt;Given the opportunity to work on some of the world's largest linux deployments, writing a lot of Python code and debugging some of the hardest engineering problems, coupled with opportunity to work with the top IT talent around and living in geek paradise is really exciting, and I'm sure I'll have much to write about.&lt;/p&gt;
	</description>
	<guid isPermaLink="false">
	  http://ipozgaj.blogspot.com/2013/01/restarting.html
	</guid>
      </item>
      <item>
        <title>Measuring time, pythonic approach</title>
	<link>http://ipozgaj.blogspot.com/2012/06/measuring-time-pythonic-approach.html</link>
	<pubDate>June 07, 2012 19:59</pubDate>
	<description>
	  Function wrapping with Python decorators, and code wrapping with Python context managers (i.e. context manager __enter__() and __exit__() functions) can easily be used for measuring time used for running a function or code snippet. Here is the simple implementation of both approaches:  &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;span&gt;import&lt;/span&gt; sys&lt;br /&gt;&lt;span&gt;import&lt;/span&gt; time&lt;br /&gt;&lt;br /&gt;&lt;span&gt;if&lt;/span&gt; sys&lt;span&gt;.&lt;/span&gt;platform &lt;span&gt;=&lt;/span&gt;&lt;span&gt;=&lt;/span&gt; &lt;span&gt;'win32'&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;  timer &lt;span&gt;=&lt;/span&gt; time&lt;span&gt;.&lt;/span&gt;clock&lt;br /&gt;&lt;span&gt;else&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;  timer &lt;span&gt;=&lt;/span&gt; time&lt;span&gt;.&lt;/span&gt;time&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# use as decorator&lt;/span&gt;&lt;br /&gt;&lt;span&gt;def&lt;/span&gt; measure_time&lt;span&gt;(&lt;/span&gt;func&lt;span&gt;)&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;  &lt;span&gt;def&lt;/span&gt; _measure_time&lt;span&gt;(&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;args&lt;span&gt;,&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;kwargs&lt;span&gt;)&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;    start_time &lt;span&gt;=&lt;/span&gt; timer&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;    res &lt;span&gt;=&lt;/span&gt; func&lt;span&gt;(&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;args&lt;span&gt;,&lt;/span&gt; &lt;span&gt;*&lt;/span&gt;&lt;span&gt;*&lt;/span&gt;kwargs&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span&gt;print&lt;/span&gt; &lt;span&gt;'Time elapsed for {0}: {1}'&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;format&lt;span&gt;(&lt;/span&gt;func&lt;span&gt;.&lt;/span&gt;&lt;span&gt;__name__&lt;/span&gt;&lt;span&gt;,&lt;/span&gt; timer&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; start_time&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;    &lt;span&gt;return&lt;/span&gt; res&lt;br /&gt;  &lt;span&gt;return&lt;/span&gt; _measure_time&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span&gt;# use as context manager&lt;/span&gt;&lt;br /&gt;&lt;span&gt;class&lt;/span&gt; MeasureTime&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;  &lt;span&gt;def&lt;/span&gt; __enter__&lt;span&gt;(&lt;/span&gt;self&lt;span&gt;)&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;    self&lt;span&gt;.&lt;/span&gt;start_time &lt;span&gt;=&lt;/span&gt; timer&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;  &lt;span&gt;def&lt;/span&gt; __exit__&lt;span&gt;(&lt;/span&gt;self&lt;span&gt;,&lt;/span&gt; exception_type&lt;span&gt;,&lt;/span&gt; exception_val&lt;span&gt;,&lt;/span&gt; exception_traceback&lt;span&gt;)&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;&lt;br /&gt;    &lt;span&gt;print&lt;/span&gt; &lt;span&gt;'Time elapsed: {0}'&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;format&lt;span&gt;(&lt;/span&gt;timer&lt;span&gt;(&lt;/span&gt;&lt;span&gt;)&lt;/span&gt; &lt;span&gt;-&lt;/span&gt; self&lt;span&gt;.&lt;/span&gt;start_time&lt;span&gt;)&lt;/span&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Usage case for both approaches:&lt;br /&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; @measure_time&lt;br /&gt;... def test():&lt;br /&gt;...     time.sleep(2)&lt;br /&gt;...&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; test()&lt;br /&gt;Time elapsed for test: 2.00204205513&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;&lt;pre&gt;&amp;gt;&amp;gt;&amp;gt; with MeasureTime():&lt;br /&gt;...     time.sleep(2)&lt;br /&gt;...&lt;br /&gt;Time elapsed: 2.00203204155&lt;/pre&gt;
	</description>
	<guid isPermaLink="false">
	  http://ipozgaj.blogspot.com/2012/06/measuring-time-pythonic-approach.html
	</guid>
      </item>
      <item>
        <title>Python for Perl programmers #1 - fileinput module</title>
	<link>http://ipozgaj.blogspot.com/2011/05/python-for-perl-programmers-1-fileinput.html</link>
	<pubDate>May 07, 2011 15:59</pubDate>
	<description>
	  &lt;div&gt;Python for Perl programmers is a set of short posts showing how some of the most common Perl idioms can easily be implemented in Python. This time I'll show you how to translate code chunks using Perl's diamond operator to elegant Python code.&lt;br /&gt;&lt;pre&gt;while (&amp;lt;&amp;gt;) {&lt;br /&gt;&amp;nbsp; &amp;nbsp; ...&lt;br /&gt;}&lt;/pre&gt;This loop written in Perl will iterate over all of the lines from standard input, whether it is pipe from another program or the list of the files specified as the program's arguments (argv). The same functionality can be done in Python by using the &lt;code&gt;fileinput&lt;/code&gt; module, so the previous code snippet becomes:&lt;br /&gt;&lt;pre&gt;import fileinput&lt;br /&gt;&lt;br /&gt;for line in fileinput.input():&lt;br /&gt;&amp;nbsp; &amp;nbsp; ...&lt;br /&gt;&lt;/pre&gt;&lt;pre&gt;&lt;/pre&gt;The default order of processing is:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;sys.argv[1:]&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;sys.stdin&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;If file name is specified as "-", the standard input is used instead. You can get more information on &lt;a href="http://docs.python.org/library/fileinput.html"&gt;fileinput module&lt;/a&gt; in official Python documentation.&lt;/div&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://ipozgaj.blogspot.com/2011/05/python-for-perl-programmers-1-fileinput.html
	</guid>
      </item>
      <item>
        <title>Managed attributes in Python</title>
	<link>http://ipozgaj.blogspot.com/2010/10/managed-attributes-in-python.html</link>
	<pubDate>October 20, 2010 22:55</pubDate>
	<description>
	  Attribute interception is a common pattern that occurs in almost every object oriented language. In addition to only changing the value of some attribute in object, in most cases you will need to implement some additional logic that deals with the changed value. Most straightforward solution for this by using &lt;i&gt;setters&lt;/i&gt; and &lt;i&gt;getters&lt;/i&gt;. This way the user of the object won't access the attribute directly - he will call the helper functions that hold all the logic needed for fetching and changing the attribute value.&lt;br /&gt;&lt;br /&gt;To be honest, there is nothing wrong with this kind of approach, but it just isn't &lt;i&gt;pythonic &lt;/i&gt; and elegant. The purpose of this article is to give a brief introduction on more advanced Python topics dealing with this problem. In most cases, you will find them to be just a syntactic sugar around setters and getters, but knowing more about these techniques will help you to read and understand code from more experienced Python programmers, and writing more effective and elegant code of your own.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;setters and getters&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;As we have already mentioned, the most simple approach is to use setter and getter functions. For demonstrative purposes, we will use an example class &lt;code&gt;Person&lt;/code&gt; with attribute &lt;code&gt;name &lt;/code&gt; that verifies the name is always properly capitalized.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;class Person:&lt;br /&gt;    def setName(self, name):&lt;br /&gt;        self._name = " ".join([e.capitalize() for e in name.split()])&lt;br /&gt;    def getName(self):&lt;br /&gt;        return self._name&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p = Person()&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.setName("joe smith")&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; p.getName()&lt;br /&gt;'Joe Smith'&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;As shown, this just works, but we need to call functions instead using the attribute name directly. The rest of the examples will show how to avoid this kind of programming.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;code&gt;__setattr__&lt;/code&gt;/&lt;code&gt;__getattr__&lt;/code&gt;&lt;/b&gt;and &lt;b&gt;&lt;code&gt;__setattribute__&lt;/code&gt;/&lt;code&gt;__getattribute__&lt;/code&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;Next, we will show how to intercept the access to the attribute, so we can add whatever logic we need to process before the actual access has been made. We can do that by using either the &lt;code&gt;__setattr__&lt;/code&gt; or &lt;code&gt;__setattribute__&lt;/code&gt;. Of course, if your goal is to implement something inside getter, and not setter, you would use the &lt;code&gt;__getattr__&lt;/code&gt; and &lt;code&gt;__getattribute__&lt;/code&gt; methods instead. Let's continue with our example - first we will show how to use &lt;code&gt;__setattr__&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;class Person:&lt;br /&gt;    def __setattr__(self, name, value):&lt;br /&gt;        if name == "name":&lt;br /&gt;            value = " ".join([e.capitalize() for e in value.split()])&lt;br /&gt;            self.__dict__[name] = value&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that simply assigning value to the attribute wouldn't work, as it would loop in the &lt;code&gt;__setattr__&lt;/code&gt; call indefinitely, so we must add it to the &lt;code&gt;__dict__&lt;/code&gt; explicitly.&lt;br /&gt;&lt;br /&gt;Approach with &lt;code&gt;__setattribute__&lt;/code&gt; is very similar, but there is one notable difference. While &lt;code&gt;__setattr__&lt;/code&gt; and &lt;code&gt;__getattr__&lt;/code&gt; will be called only for those attributes that are undefined, i.e. not on an instance and not inherited from a class, &lt;code&gt;__setattribute__&lt;/code&gt; and &lt;code&gt;__getattribute__&lt;/code&gt; will be called every time you try to access the attribute. In this matter, &lt;code&gt;__setattribute__&lt;/code&gt; and &lt;code&gt;__getattribute__&lt;/code&gt; are more generic as they will be called every time. Again, you need to be careful to avoid loops. While implementing setter with &lt;code&gt;__setattribute__&lt;/code&gt; will be the same as with &lt;code&gt;__setattr__&lt;/code&gt;, there is a notable difference while implementing the &lt;code&gt;__getattribute__&lt;/code&gt; method. Here we can't use &lt;code&gt;__dict__[name]&lt;/code&gt; as calling it would trigger the &lt;code&gt;__getattribute__&lt;/code&gt; again, causing a loop. To avoid this, you would use the &lt;code&gt;object.__getattribute__&lt;/code&gt; instead of &lt;code&gt;self.__getattribute__&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Properties&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Properties allow us to reroute the attribute's set, get or even delete operations to the functions of our choice. To do this we will use the &lt;code&gt;property&lt;/code&gt; built-in. The basic syntax that can describe the use of properties is (all of the arguments are defaulting to &lt;code&gt;None&lt;/code&gt;, and we will silently ignore the last two arguments for now):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;attribute = property(get, set, del, doc)&lt;/pre&gt;&lt;br /&gt;How to use this? Well, it's pretty straightforward. Our example from previous sections rewritten to use properties looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;class Person(object):&lt;br /&gt;    def setName(self, name):&lt;br /&gt;        self._name = " ".join([e.capitalize() for e in name.split()])&lt;br /&gt;    def getName(self):&lt;br /&gt;        return self._name&lt;br /&gt;    name = property(getName, setName)&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Note that we have derived our &lt;code&gt;Person&lt;/code&gt; object from &lt;code&gt;object&lt;/code&gt;, stating that we want to use is it as the new style class. This is required for properties to function normally (of course, if you're using Python 3.0+ you won't need this as new style classes are implied).&lt;br /&gt;&lt;br /&gt;Properties can also be coded with decorators. In this case, base decorator &lt;code&gt;@property&lt;/code&gt; is used for getter, and &lt;code&gt;name.setter&lt;/code&gt; is used for setter. Again, the following example is merely syntactic sugar for the previous example:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;class Person(object):&lt;br /&gt;    @property&lt;br /&gt;    def name(self):&lt;br /&gt;        return self._name&lt;br /&gt;    @name.setter&lt;br /&gt;    def name(self, name):&lt;br /&gt;        self._name = " ".join([e.capitalize() for e in name.split()])&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;In contrast with the previous methods, properties manage only a single attribute, and therefore are easier to write as you don't need to remember all the gotchas of &lt;code&gt;__getattr__&lt;/code&gt;, &lt;code&gt;__getattribute__&lt;/code&gt; etc.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Descriptors&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;The final method we will examine are descriptors. In their essence, descriptors are superset of properties, and &lt;code&gt;property&lt;/code&gt; built-in we have used before is only a specific case of descriptors. Descriptors allow us to reroute attribute's get and set (or even delete) operations to methods of another class.&lt;br /&gt;&lt;br /&gt;The template code for coding descriptors is:&lt;br /&gt;&lt;pre&gt;class Descriptor:&lt;br /&gt;    def __get__(self, instance, owner):&lt;br /&gt;        ...&lt;br /&gt;    def __set__(self, instance, value):&lt;br /&gt;        ...&lt;br /&gt;    def __delete__(self, instance):&lt;br /&gt;        ...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;We will again ignore attribute deletion for now. A class containing any of these three methods is descriptor. Omitting the &lt;code&gt;__get__&lt;/code&gt; or the &lt;code&gt;__delete__&lt;/code&gt; method will cause that particular type of access as unsupported, however omitting the &lt;code&gt;__set__&lt;/code&gt; method will not render the attribute as read only, it will only allow its name to be redefined (and therefore descriptor will be hidden). If you want to make your attribute read only, you should implement &lt;code&gt;__set__&lt;/code&gt; with &lt;code&gt;pass&lt;/code&gt; statement or raise an exception on assignment.&lt;br /&gt;&lt;br /&gt;Argument names for descriptor methods are somewhat strange. Let's start with &lt;code&gt;__get__&lt;/code&gt; method. The &lt;code&gt;owner&lt;/code&gt; argument is the name of the class to which the descriptor instance is attached, and the &lt;code&gt;instance&lt;/code&gt; argument is the instance of the object through which the attribute was accessed. Meaning of the &lt;code&gt;instance&lt;/code&gt; argument in the &lt;code&gt;__set__&lt;/code&gt; method is the same, and the &lt;code&gt;value&lt;/code&gt; argument holds the value to be assigned to the attribute.&lt;br /&gt;&lt;br /&gt;How do we use a descriptor? We just assign it to the attribute name. Our example, this time with descriptors, looks like this:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;class Descriptor(object):&lt;br /&gt;    def __get__(self, instance, owner):&lt;br /&gt;        return instance._name&lt;br /&gt;    def __set__(self, instance, value):&lt;br /&gt;        instance._name = " ".join([e.capitalize() for e in value.split()])&lt;br /&gt; &lt;br /&gt;class Person(object):&lt;br /&gt;    name = Descriptor()&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Again, we must use new style classes if we're not using Python newer or equal to Python 3.0.&lt;br /&gt;&lt;br /&gt;An interesting thing with descriptors is that they can hold state. OK, technically speaking every of the previously described methods can also hold state, at least in the form of global variables, but by using descriptors you can use them elegantly in their own namespace - the descriptor class and instance.&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;This is by far not a complete tutorial on using any of techniques described here, as there are many more things to be described, but they are simply out of the scope of this article. You should read the official Python documentation or some of the better books on Python programming (I would strongly recommend &lt;i&gt;Learning Python, 4th ed.&lt;/i&gt; from O'Reilly) to get the complete overview of managed attributes possibilities.
	</description>
	<guid isPermaLink="false">
	  http://ipozgaj.blogspot.com/2010/10/managed-attributes-in-python.html
	</guid>
      </item>
      <item>
        <title>Budget Surfer 0.0.1</title>
	<link>http://vrodic.blogspot.com/2010/08/budget-surfer-001.html</link>
	<pubDate>August 29, 2010 15:34</pubDate>
	<description>
	  &lt;span&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span&gt;Jučer sam htio istražiti koliko je našeg zajedničkog novca utrošeno na softverske licence za MS Windowse, Office i ostale proizvode više ili manje lako zamjenjive sa FOSS ekvivalentima. Jedine informacije koje sam zasad uspio dobiti su u dokumentu "Poseban dio Državnog proračuna Repulike Hrvatske za 2010. godinu i projekcije za 2011. i 2012." koji se nalazi ovdje http://mfin.hr/hr/drzavni-proracun-2010 .&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Predpostavljam da je i Vizualizacija proračuna od projekta vjetrenjača napravljena iz istog podatkovnog izvora.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;Kako bih produktivno gubio vrijeme odlučio sam napraviti mali program koji će importirati ovaj Excel u SQL bazu i omogućiti lakše "surfanje", filtriranje itd.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Ako se predpostavi da je softver u stavkama "INFORMATIZACIJA*", u podstavkama "Rashodi za nabavu neproizvedene imovine", onda ukupni iznos iznosi oko 24.5 milijuna kuna.&lt;br /&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://vedran.bljak.org/budgetsurf/index.php?nameq=&amp;code=41&amp;parent=-1&amp;typecode=1"&gt;Informatizacija, Rashodi za nabavu neproizvedene imovine&lt;/a&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;td&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;No zanimljivo, misteriozne podstavke s naslovom "Rashodi za nabavu neproizvedene imovine" (koje nemaju nikad detaljnije podstavke) ne pojavljuju se samo u stavkama "INFORMATIZACIJA*", nego i npr.  "RAČUNALNO KOMUNIKACIJSKA INFRASTRUKTURA U VISOKIM UČILIŠTIMA I JAVNIM INSTITUTIMA" od 14 milijuna kn i mnoge druge kategorije što nas dovodi do ukupnih oko 105 milijuna kuna.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;&lt;a href="http://vedran.bljak.org/budgetsurf/index.php?nameq=&amp;code=41&amp;parent=-1"&gt;Rashodi za nabavu neproizvedene imovine&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;Ono za što je predpostaviti da ima neku vrijednost u nabavkama softvera u Informatizaciji su stavke &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span&gt;&lt;span&gt;"&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;Nematerijalna proizvedena imovina" za koje je predpostaviti da se radi o softveru rađenom po narudžbi, tj koji se proizvodi za potrebe rada države. Ukupni iznos ovoga je oko 74 milijuna kuna.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;a href="http://vedran.bljak.org/budgetsurf/index.php?parent=-1&amp;parentfine=&amp;parentmid=&amp;typecode=1&amp;code=426&amp;nameq=&amp;codeq=&amp;orderf=1&amp;orderv="&gt;Softver po narudžbi&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2010/08/budget-surfer-001.html
	</guid>
      </item>
      <item>
        <title>Moj kupus, ŠBBKBB iliti TODO lista</title>
	<link>http://vrodic.blogspot.com/2010/08/moj-kupus-sbbkbb-iliti-todo-lista.html</link>
	<pubDate>August 24, 2010 23:00</pubDate>
	<description>
	  Ako niste voljni čitati nadobudne i vjerovatno pretenciozne osobne rantove i brain dumpove slobodno preskočite ovaj post. &lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Pošto izgleda da je danas dan kada dajem otkaz još jednoj u nizu closed source (i closed mind dodao bih) firmi, možda je najbolje da se opustim uz nekoliko naivnih i praktičnih ideja za koje znam kako ih izvesti. Vjerovatno ću šarati od ideja za pojednostavljenje državne birokracije preko ideja za Android aplikacije, do bojnog plana za osvajanje javnog sektora od Linux desktopa u Hrvata.&lt;br /&gt;&lt;br /&gt;No prvo o tome što mi je činiti u sljedećem razdoblju: Trebam naći poslodavca koji će shvaćati  i prihvaćati da su mi briga za obitelj, prijatelje, zajednicu i moje sebične interese (fakultet recimo) na prvom mjestu. Vjerujem da takav već postoji, a ako netko ima ideju ili prijedlog slobodno se javite.&lt;br /&gt;&lt;br /&gt;Ajmo polako s idejama:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Down to earth:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Proširiti postojeću Kostovu inicijativu za Android Market account tako da razvijemo i održavamo nekakav HULK-ov sistem donacija za domaće Free Software Android / Whatever aplikacije.&lt;br /&gt;&lt;br /&gt;2. Android aplikacija koja skenira barcodove prehrambenih proizvoda i ima offline bazu sa crnom listom Ebrojeva u proizvodu. Samo uzmete proizvod u dućanu u ruke, skenirate mu barcod i dobijete crveno ili zeleno ovisno o tome ima li proizvod štetnih E dodataka (naravno postoji opcija za pregled detalja E brojeva a ako smo online i drugih detalja vezanih uz proizvode). Dodatno bi se ta radnja mogla iskoristiti da se proizvod zabilježi kao kupljen, te tako možemo imati i neki pregled / povijest potrošnje, a i jednostavniji način izbora namirnice kod brojanje kalorija ili neko drugo sofisticiranije praćenje prehrane. Naravno za organski proizvedene proizvode bez bar koda treba smisliti nešto drugo za jednostavno identificiranje (brzi izbor voće, povrće, boja, oblik, last recently used etc)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Blue sky:&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Ideje u domeni odnosa države i građana:&lt;br /&gt;&lt;br /&gt;I. Zdravstvena knjižica:&lt;br /&gt;&lt;br /&gt;Kako relativno često mijenjam poslove, primjetio sam jednu glupu ostavštinu prošlih vremena: Posebnu zdravstvenu knjižicu koju iz nekog čudnog razloga treba mijenjati svaki put kada se promjeni radni status, a valjda i svaki put kada završite osnovnu, srednju ili fakultet. Ta zdravstvena knjižica ionako sadrži datum isteka koji ne znači baš ništa (jer osiguranje formalno može "isteći" i prije - o tome kako se uopće u socijalnoj državi može dogoditi da nemate osnovno zdravstveno osiguranje malo poslje). Dakle jedino što bi na njoj trebalo biti bitno je broj zdravstvenog osiguranja, odnosno OIB odnosno JMBG odnosno broj osobne izkaznice odnosno broj putovnice. Sve su to u biti ključevi za identifikaciju građana RH, i u teoriji bi bilo dovoljno imati recimo samo osobnu ili putovnicu (sa barcodom ili npr. qr codeom za strojno čitanje tog malog ključa). Status zdravtvenog osiguranja bi se transparentno u pozadini promjenio kada bi dobili prvi posao, dali otkaz, završili fakultet itd itd. Ionako ga uvijek zapravo imamo (neki imaju i bonus dopunsko ako su bez posla ili slično) i jedino što je bitno je da se to na nekog "knjiži" radi poreznih razloga, ali to stvarno ne znači da svaki put moramo mijenjati tu plastiku. Predpostavljam da fino zarađuje na toj plastici, a ako nije u pitanju neka korupcija, opet me fascinira glupost u javnom sektoru (nadam se da je samo glupost, jer tada je valjda lakše popraviti ovo).&lt;br /&gt;&lt;br /&gt;A drugi problem/pizdarija oko zdravstvenog osiguranja je to što se može dogoditi da ostanete neosigurani jer ste recimo mislili da datum isteka koji piše na zdravstvenoj kartici zapravo znači datum isteka zdravstvenog osiguranja. Ne, to znači jedino i samo to koliko vrijedi taj komad plastike. U idealnom slučaju status zdravstvenog osiguranja bi se računalno provjerio prilikom svakog korištenja neke zdravstvene usluge, i gdje bi se korisnik samo upozorio da njegov status nije jasan (recimo zbog završetka studentskih prava gdje je uobičajeno da zdravstveno osiguranje sa roditelja/fakulteta "prelazi" na zavod za zapošljavanje ili budućeg poslodavca).&lt;br /&gt;&lt;br /&gt;II. Još malo o zdravstvu:&lt;br /&gt;&lt;br /&gt;Bilo bi lijepo kada bi laboratoriji za pretrage odnosno specijalisti automatizmom digitalno slali informacije o nalazima liječniku opće prakse, odnosno nadležnom specijalistu. Vjerujte, ovo bi uštedjelo kilometre i kilometre koji ljudi sami prelaze kako bi raznosili nalaze okolo liječnicima. U tom slučaju bi i liječnici mogli nazvati pacijente čim nalazi stignu, a ne da pacijenti moraju raditi upite svako malo. Dakle u računalnom žargonu, "digital event based a ne analog poll bazed event handling". Bilo bi lijepo i da pacijenti  građani) imaju token za pristup centralnoj birokraciji gdje mogu sami pogledati svoj zdravstveni karton, rezultate pretraga, plan liječenja, dijetu, prisjetiti se ocjena u školi ili za one za nekom vrstom alzeihmerove bolesti, vidjeti koliko nekretnina imaju, tko su im roditelji, gdje su rođeni, itd itd :) I tako, ima tu puno etičkih i drugih pitanja koje treba razmotriti prije deploymenta. No predpostavljam da ne želimo da ovako nešto jednom za nas radi neki closed source sistem ili nedaj bože Facebook :)&lt;br /&gt;&lt;br /&gt;U varijanti gdje JMBG ili OIB ili broj osobne ili broj putovnice stvarno postaju ono što jesu, a to su ključevi s kojim se identificira građanin-pojedinac, nije nam više potrebna niti radna knjižica niti pokaz niti Xica, a u idealnom slučaju (kada bi imali taj "token").&lt;br /&gt;&lt;br /&gt;Od domaćih sustava, možda je upravo sustav iza Xice (ili studomata) baza za ovakvo nešto.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;III. Stavimo Linux na desktope javnog i državnog sektora.&lt;br /&gt;&lt;br /&gt;Stvarno, želimo li i danas, uz solidan i uoptrebljiv desktop na linuxu plaćati svake godine milijune za MS licence? Možda možemo otvoriti malu firmu koja bi se bavila supportom i specifičnim potrebama korisnika u državnom sektoru za novce utrošene na MS licence i time bar malo spriječiti odlijev novca odnosno nepovoljan omjer uvoza i izvoza?&lt;br /&gt;&lt;br /&gt;IV. Pomognimo Marku Rakaru da http://proracun.pollitika.com/2010/korisnici.html ima više informacija, real time informacija, podataka o aktivnim natječajima u javnoj nabavi i slično ili nagovorimo državu/vladu/sabor da ovakave projekte kvalitetno odrađuju Narodne novine tj da ih financira sama država.&lt;br /&gt;&lt;br /&gt;V. Pripremimo sve ove projekte tako da lako postanu dio nečeg većeg kada uđemo u EU ili se ujedinimo sa USA (kiberkomunist approved).  Koristimo postojeća (Free software) riješenja gdje god možemo. Nemojmo se bojati ulagati u globalnu zajedničku infrastrukturu.&lt;br /&gt;&lt;br /&gt;VI. Podržimo Zajedničko i zadružno stanovanje http://bit.ly/bEbcwK, Reciklirano imanje - Vukomerić http://bit.ly/arRK0U i slične projekte.&lt;br /&gt;&lt;br /&gt;&lt;div&gt;VII. Nacionalizirajmo ponovo Hrvatske Telekomunikacije ili barem:&lt;br /&gt;&lt;br /&gt;Definirajmo jasnije javno pravo na DTK. Prisilimo HT na članstvo u CIX-u. Dajmo im dozvolu da postavljaju optiku, stavimo cijenu za najam niti na 100 kn po mjesecu po korisniku kako bi se brže vraćala investicija, ali svakako omogućimo da infrastrukturu od prvog dana mogu koristiti i alternativci. Regulirajmo maksimalne i minimalne cijene. Postavimo u zakon da svaka telefonska parica / veza može prenijeti neki normalni broadband a ne trenutnih 128K kako bi prisilili monopolistu da izgradi lokalnu infrastrukturu (ili stvorimo budžet za ovo dodatnim oporezivanjem operatera sa veliki tržišnim udjelom). Borimo se za simetrični broadband (sa korisnim upload brzinama). Borimo se za low latency broadband. Borimo se za 100megabitne, i gigabitne internet veze. Zadnje tri stavke omogućavaju i vrlo dobar peer to peer cloud - što nam treba za nekakav Diaspora-like social networking). Iskoristimo stvarno podatkovne kapacitete javnih poduzeća. Kad planiramo novu infrastrukturu za nova ili postojeća naselja, predvidimo i prostor sve bitno (da i optički internet pristup), kako nebi nepotrebno prekopavali kvart/naselje svako malo.&lt;br /&gt;&lt;br /&gt;VIII. Dolazimo na razmjene vještina.&lt;br /&gt;&lt;br /&gt;IX. Stvorimo računala koja možemo uzgajati kao što uzgajamo biljke i koja si stvaraju energiju sama kao što ih stvaraju biljke i koja imaju mrežu korjenja za povezivanje slično kao što i biljke imaju korijenje (prvi korak, pogledajte &lt;a href="http://bbf.openwetware.org/"&gt;http://bbf.openwetware.org/&lt;/a&gt;).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;X. Razno.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Diskusija o ovom blog postu nalazi se i na &lt;a href="http://ff.im/pAJvz"&gt;Friendfeed-u&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2010/08/moj-kupus-sbbkbb-iliti-todo-lista.html
	</guid>
      </item>
      <item>
        <title>Back on the road</title>
	<link>http://ipozgaj.blogspot.com/2010/07/back-on-road.html</link>
	<pubDate>July 22, 2010 20:20</pubDate>
	<description>
	  After almost a year of pause, I've decided to revive this blog. Much has changed in the meantime, so I'm full of ideas and themes to write about. Some of them are:&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;cloud computing&lt;/b&gt;: I've almost completely abandoned all of the applications I've been using before (mail client, feed reader, office applications, personal information management applications etc), and switched to online and cloud versions (primarily Google's)&lt;/li&gt;&lt;li&gt;&lt;b&gt;Android platform&lt;/b&gt;: more like continuation of the previous point - I can now access all of the cloud services I use from literally anywhere, thanks to this great mobile platform&lt;/li&gt;&lt;li&gt;&lt;b&gt;development: &lt;/b&gt;migration from subversion to git, several themes on Perl, Python and shell scripting&lt;/li&gt;&lt;li&gt;&lt;b&gt;systems administration&lt;/b&gt;: several capacity planing, storage optimizations and general system tweaking themes&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;So, stay tuned! :)&lt;/div&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://ipozgaj.blogspot.com/2010/07/back-on-road.html
	</guid>
      </item>
      <item>
        <title>Making Android development more enjoyable</title>
	<link>http://vrodic.blogspot.com/2010/07/making-android-development-more.html</link>
	<pubDate>July 04, 2010 11:25</pubDate>
	<description>
	  Here's some things Google should look into:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;0. Include android market in the emulator/test environment&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;That should be fast and easy to do. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;1. Try finding some ways to speed up the compile/test cycle:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;a) Avoid moving  too much &lt;/span&gt;&lt;span class="Apple-style-span"&gt;stuff&lt;/span&gt; &lt;span class="Apple-style-span"&gt;arround&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Currently every time an .apk file must be produced (compressed) on the developers machine, containing all the code and application resources. This apk that contains everything is then transferred to the phone or emu. It's then unpacked on the phone and the install procedure is run. It doesn't matter if you just changed one class file, the whole thing is moved around. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;I understand that permissions are managed during the install process, but this could be solved in some other way like trusting the code for that app by default. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;b) &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;Make the test environment run in native code during the development process&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;I know that using an emulator was a nice and fast solution for you, but a lot of time and energy is lost on emulating ARM. Davlik runs on x86, and all other code also. Why don't we just make a jailed/chrooted native environment for testing available? I know that this is not a straightforward thing to implement on Windows, and there might be difficulties making this run on Mac OSX, but it's really worth it.&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;2. Improve the visual layout editor.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;There's so many ways this could be improved, but making it faster/more intuitive is the general idea.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;One quick suggestion: Try making it easier to jump to respective code implementations or have an option to generate event handlers etc. code if no code referencing that UI object is found.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Example of a great code editor/UI designer integration is Borland Delphi. Even really old versions have ease of use that Android developers could only dream of. Android API is more abstract and UIs have relative layouts, but most of the great concepts from Delphi still apply. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Item 1 b) could also create possibilities for the UI designer tool. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2010/07/making-android-development-more.html
	</guid>
      </item>
      <item>
        <title>HTC Desire prvi dojmovi</title>
	<link>http://vrodic.blogspot.com/2010/05/htc-desire-prvi-dojmovi.html</link>
	<pubDate>May 30, 2010 17:19</pubDate>
	<description>
	  &lt;a href="http://4.bp.blogspot.com/_UuK1V0ZktBs/S_m33_RVztI/AAAAAAAAApc/TFqMPZ48f2s/s1600/28621_1418262649416_1018138934_31212023_7415099_n.jpg"&gt;&lt;img src="http://4.bp.blogspot.com/_UuK1V0ZktBs/S_m33_RVztI/AAAAAAAAApc/TFqMPZ48f2s/s320/28621_1418262649416_1018138934_31212023_7415099_n.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5474608994550402770" /&gt;&lt;/a&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;EDIT:&lt;/b&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt; 26.5.2010: par novih detalja, + vesela informacija da je Samsung I9000 Galaxy S koliko vidim HTC Desire killer. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Kupih na pretplatu u VIP-u. Onu najmanju od 30kn, + 10 kn za radijsku frekvenciju + još&lt;/span&gt;&lt;/div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;oko 10 kn za iskorištavanje "besplatnih" minuta + po želji oko 30 kn za 200 MB prometa. Dakle obvezao sam se na trošenje minimalno 50tak kuna mjesečno sljedeće dvije godine.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;+ 2400 kn &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;za sam telefon i nije toliko loš deal.&lt;br /&gt;&lt;br /&gt;Kad sam kupovao &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;HTC Desire&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; znao sam da nije savršen, da ekran nije najbolje čitljiv na suncu, da uskoro dolaze novi uređaji temeljeni na bržem 4&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;5 nm Qualcomm Snapdragonu&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; (moguće da će biti 1.5 GHz dual core!)  i da će vjerovatno HTC kilaviti sa update-om na Android 2.2 za Desire , ali sam znao i da ima trenutno najbrži procesor, najviše memorije i odličnu kvalitetu zvuka, što mi je jako važno.&lt;br /&gt;&lt;br /&gt;Opasno me zainteresirala &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Motorola Milestone (Droid u USA)&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;, koja ima tipkovnicu, nešto sporoji procesor, ali zato dosta brži GPU. No ona je pala na audio testu na gsmarena.com, što provjeram za svaki mobitel koji uzimam u obzir pošto sam se opekao sa &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Nokiom N79&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; gdje mi je glazba bila neslušljiva od distorzija. Ta Nokia je bila blizu savršenstva, tj. Nokia E52 bi bila još bliža, ali sam odlučio zamjeniti sada prilično zrelu Symbian platformu sa Android-om koji je ipak njubi...&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;s&gt;Još nema kvalitetne offline navigacije (Symbian Nokie imaju &lt;/s&gt;&lt;/span&gt;&lt;s&gt;&lt;/s&gt;&lt;/span&gt;&lt;s&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Garmin XT&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; koji je odličan).&lt;/span&gt;&lt;/span&gt;&lt;/s&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt; iGo &lt;/b&gt; ima aplikaciju &lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Motonav&lt;/b&gt;,(ima i potpuniji &lt;b&gt;My way&lt;/b&gt;, ali neznam dali postoji verzija za Androide sa velikom rezolucijom)&lt;/span&gt;&lt;span class="Apple-style-span"&gt;, detalji &lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;a href="http://cafe.mobil.hr/threads/67490-iGO-Motonav-sa-mapama-Hrv-Slo-Srb-Au"&gt;ovdje&lt;/a&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;. Navteq karte su bolje od Teleatlas karti izgleda. Garmin XT je još uvijek bolji, lijepše renderira karte i brži je. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Izgleda da je potrebno koristiti nekakav &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Task manager&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; za ubijanje aplikacija, koje u pravilu nemaju exit ili quit opciju i vole sjediti u backgroundu.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Android issue 3708, &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Akcelerometar &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;ne može dojavljivati podatke kada je ekran ugašen, tj. kad je mobitel u sleep mode-u. Ovime aplikacije koje recimo mjere broj koraka postaju skoro pa beskorisne jer puno brže popiju bateriju. Drugi primjer je navodno odlični  Smart alarm. A i ja planiram napraviti aplikaciju koja inteligentno koristi akcelerometar u pozadini.&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Još nisam naletio na dobar &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;DivX player. &lt;span class="Apple-style-span"&gt;HTC je nešto obećao u kasnije SW updateu. Ali poznato je da se ne može vjerovati ovakvim obećanjima od proizvođača mobitela.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Opera 5 Mini&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; je još uvijek brzinom navigacije (back, forward, history) bolja od Android browsera. Komentar dolje spominje i Dolphin, ali to nisam probao. Android stock browser naravno bolje podržava JavaScript i HTML5 od Opere 5 mini. &lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;root-anje &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Androida (za stavljanje custom ROM-ova) još &lt;a href="http://forum.xda-developers.com/showthread.php?t=684473"&gt;nije stabilno&lt;/a&gt; za HTC Desire, neki ljudi uspiju brickati telefone kod flashanja, neki ne (meni osobno ovo nije toliko bitno, iako me živcira što se neke meni nepotrebne HTC aplikacije, &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Stocks &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;recimo, stalno vraćaju u listu aktivnih procesa, iako ih nisam dozvao)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Još nema &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;custom ROM-a&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; koji je stabilan, tj implementira sve HW mogućnosti uređaja&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Hardver je dovoljno različit od Nexus One-a da se na njega ne može staviti Nexus One ROM, što će vjerovatno značiti da će HTC Desire korisnici dobiti &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Android 2.2&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt; kasnije od Nexus One korisnika (nadajmo se da griješim)&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Aplikacije se po defaultu &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;ne mogu instalirati na SD karticu&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;, što ograničava prostor za instalaciju, HTC Desire ima samo 147 MB za instalaciju aplikacija. Ovo riješava &lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Apps2SD &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;(treba root), ili Android 2.2, ali oboje je trenutno nedostupno za Desire&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;Poneki bug u browseru&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;3D&lt;/b&gt; je definitivno sporiji od &lt;b&gt;iPhone-a&lt;/b&gt; 3GS, Motorole Droid, a vjerovatno i iPhone-a 3G&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;FM radio&lt;/b&gt; softver je dosta neintuitivan, i zna se skršiti tako da je potreban reboot mobitela da bi se radoi ponovo osposobio, dok uredno nastavi trošiti 100% CPU-a, što je smrt za bateriju&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Aplikacije koje se plaćaju&lt;/b&gt; nisu dostupne kod nas? &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Aplikacije koje još tražim:&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="Apple-style-span"&gt;&lt;b&gt;Music player&lt;/b&gt; koji ima file browser i playa po redu iz trenutnog foldera. &lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-tab-span"&gt;&lt;span class="Apple-style-span"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-tab-span"&gt;&lt;span class="Apple-style-span"&gt;B&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"&gt;onus&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Aplikacije koje sam instalirao, redom kojim sam ih instalirao (- neke igre):&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Google Sky Map, Compass (Snaptic), ConnectBot, ASTRO File manager, Accelerometer Values, Android Sensor Data, Sensor List, Input Benchmark, Ultimate Stopwatch, Spare Parts, PowerTutor, fring (Skype, SIP, odlično), GPS Status, GPS Test, GPS Essentials, SID Player, Robo Defense FREE, Task Manager (Rhythm Software), android-vnc-viewer, Android System Info, NetCounter, Neocore (benchmark za grafiku), NenaMark1 (još jedan GPU bench), Tuner - gStrings, Robotic Guitarist Free, Splash Piano (prilično loš klavir, ali nema bolji), Buddy Runner, Endomondo Sports Tracker, SportPal OS1.5, Hi-Hiker Pro, Pedometer, Cardio Trainer (da,  testiram personal GPS enabled aplikacije za trčanje/hodanje/bicikliranje, Cardio Trainer je simpa), Android SPL METER, KeepScreen, Fractoid, 2 Ballz Physics Toz, System Panel App / Task Manager, Free Advanced Task Manger, Spectral Audio Analyzer, FxCamera, PicSay, Ethereal Dialpad (synthezer), Camera Illusion, RTA Audio Analyzer, Barcode Scanner, Shazam, Google Goggles (malo nestabilno), ColorFlashlight Fun Flashlight, Call History (xiaoheng.liu), Mobile Metronome, Paint Joy, Raging Thunder LITE, Open GPS Tracker, WiFi Analyzer, Google Translete, OpenGL Demos, Sipdroid VoIP, Linpack for Android&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"&gt;Photo by Goran Zec&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2010/05/htc-desire-prvi-dojmovi.html
	</guid>
      </item>
      <item>
        <title>TwinLab Calcium 1000 sa Vitaminom D SMRDI</title>
	<link>http://vrodic.blogspot.com/2009/11/twinlab-calcium-1000-sa-vitaminom-d.html</link>
	<pubDate>May 26, 2010 17:11</pubDate>
	<description>
	  Ovo je otvoreno pismo poslano gosp. Ivanu Tudoru iz firme Agram 89 d.o.o, koja je zastupnik tvrtke TwinLab.&lt;br /&gt;&lt;br /&gt;Nedavno sam u jednoj ljekarni u Dugom Selu kupio proizvod firme koju zastupate, TwinLab Calcium 1000 sa Vitaminom D.&lt;br /&gt;&lt;br /&gt;U ljekarni gdje sam kupio proizvod su me uputili na vaš broj 01 3888 555. Vaše kontakt informacije dobio sam jer su me na vas uputili kada sam nazvao 01 6138 000.&lt;br /&gt;&lt;br /&gt;Računao sam na pomoć u ljekarni oko odabira najboljeg dodatka u prehrani koji sadrži kalcij i Vitamin D i bio mi je preporučen ovaj proizvod.&lt;br /&gt;&lt;br /&gt;Moj otac je nedavno operiran zbog rane faze adenokarcinoma (odstranjen mu je dio plućnog krila). Nedavno sam naišao na studiju koja govori da kombinacija Vitamina D i kalcija pomaže kod uobičajenih vrsta karcinoma (http://www.ncbi.nlm.nih.gov/pubmed/17556697).&lt;br /&gt;&lt;br /&gt;Iako ovo istraživanje nije provedeno specifično za adenokarcinom, mislio sam da ne može škoditi ako ocu kupim dodatak u prehrani koji sadrži Vitamin D i kalcij.&lt;br /&gt;&lt;br /&gt;Otvorio sam novo kupljeni proizvod i nakon što sam uzeo jednu tabletu primjetio sam u popisu sastojaka Titanijum dioksid, koji se u ovom proizvodu vjerovatno koristi zato da bi tablete bile bijele boje. Titanijum dioksid, E171 (http://www.ukfoodguide.net/e171.htm). Na priloženoj internetskoj stranici piše da je TiO2 zabranjen u Njemačkoj i da se može detektirati u limfnim čvorovima i plućnim stanicama nakon ulaska u ljudsko tijelo.&lt;br /&gt;&lt;br /&gt;Pošto TiO2 nema biološku ulogu u ljudskom tijelu, a spominje se da je iritant i da je potencijalno kancerogen, pitam se zašto se ovakvi proizvodi uopće prodaju, tj. zašto se u proizvod stavlja potencijalno opasan dodatak koji nema nikakvu funkcionalnu ulogu. Mislim da marketing i igranje sa psihologijom nebi nikad smjeli imati prednost nad funkcijom posebno kada se radi o ljudskom zdravlju i kada dodatak koji se stavlja iz  marketinških potreba može štetiti.&lt;br /&gt;&lt;br /&gt;Stranica wikipedije http://en.wikipedia.org/wiki/Titanium_dioxide sadrži ukupno 6 referenci na studije kojim su okarakterizirani negativni učinci na ljudsko zdravlje.&lt;br /&gt;&lt;br /&gt;Nisam zadovoljan sa ovim proizvodom i neću ga koristiti, a niti moj otac. Proizvod sam platio 173 kn i imam račun iz ljekarne. Nije mi iznimno  važno da dobijem natrag novac i nekakvu "zadovoljštinu", nego da se ljudi informiraju. Povrat novca bio bi lijepa gesta sa vaše strane.&lt;br /&gt;&lt;br /&gt;Možda ću pokrenuti inicijativu o zabrani proizvoda koji sadrže ne funkcionalne, kozmetičke E dodatke a koji imaju uz sebe povezane negativne efekte (E110, E171 itd). Molim zainteresirane da mi se pridruže.&lt;br /&gt;&lt;br /&gt;Pokrenuo sam raspravu o ovoj temi na adresi:&lt;br /&gt;&lt;br /&gt;http://ff.im/c2BgG&lt;br /&gt;&lt;br /&gt;No siguran sam da se o ovome raspravlja i na mnogim drugim mjestima na internetu.
	</description>
	<guid isPermaLink="false">
	  http://vrodic.blogspot.com/2009/11/twinlab-calcium-1000-sa-vitaminom-d.html
	</guid>
      </item>
      <item>
        <title>The end</title>
	<link>http://zwillow.blogspot.com/2010/05/end.html</link>
	<pubDate>May 01, 2010 13:43</pubDate>
	<description>
	  I'm closing this blog until further, since I do not have much time to invest in writing coherent, meaningful posts.  Longer, in-depth texts will from now on appear on my homepage at &lt;a href="http://zvrba.net"&gt;zvrba.net&lt;/a&gt; Commenting is disabled since a lot of spam has lately appeared.
	</description>
	<guid isPermaLink="false">
	  http://zwillow.blogspot.com/2010/05/end.html
	</guid>
      </item>
      <item>
        <title>Finally!</title>
	<link>http://zwillow.blogspot.com/2009/11/finally.html</link>
	<pubDate>November 29, 2009 18:54</pubDate>
	<description>
	  On thursday, 2009-11-26, I have finally defended my PhD! I'll be starting on the new job on tuesday...
	</description>
	<guid isPermaLink="false">
	  http://zwillow.blogspot.com/2009/11/finally.html
	</guid>
      </item>
      <item>
        <title>Unpredictability of execution times</title>
	<link>http://zwillow.blogspot.com/2009/11/unpredictability-of-execution-times.html</link>
	<pubDate>November 12, 2009 12:10</pubDate>
	<description>
	  I have written an article on intrinsic randomness of modern CPUs that you can fetch &lt;a href="http://zvrba.net/writings.html"&gt;here&lt;/a&gt;. Originally, I tried to publish it in &lt;a href="http://lwn.net"&gt;LWN&lt;/a&gt;, but since I haven't heard from their editors in over a week, I'm publishing it this way.
	</description>
	<guid isPermaLink="false">
	  http://zwillow.blogspot.com/2009/11/unpredictability-of-execution-times.html
	</guid>
      </item>
      <item>
        <title>Windows 7 hype</title>
	<link>http://ipozgaj.blogspot.com/2009/10/windows-7-hype.html</link>
	<pubDate>October 24, 2009 14:31</pubDate>
	<description>
	  &lt;div&gt;Sometimes it's really interesting to see what good marketing can do for a mediocre or even good product, even if the product itself doesn't offer anything revolutionary.. These days all you can find on RSS, IT news portals, Twitter etc can be summarized into one term - "Windows 7". First of all, I must admit - although I'm a long time Linux user/admin and that's the main thing I do for living, I got my hands on Windows 7 RTM. So here are my two cents on the new Microsoft's product and hype around it after using it for a little longer than a month.&lt;br /&gt;&lt;br /&gt;Undoubtedly, Windows 7 is the most advanced desktop OS ever released from Microsoft.  I wouldn't say it is the best desktop OS currently available, but it is probably the most consistent one. As I've never used Windows Vista, it was quite a surprise to log into this new OS, and to find dozens of new features. On the first look, it is far more visually appealing than XP. Much of concepts that I've been missing in the previous versions of Windows are now here, for example media and document libraries, better network manager, network profiles (home, domain, work, public etc). Advanced users (like myself :)), will be happy to hear that PowerShell 2.0 is included in the OS by default, and you event get a simple IDE for it (PowerShell ISE). As I can hear, it even runs much faster and uses much less resources than Vista, but I can't confirm this as I've never used Vista.&lt;br /&gt;&lt;br /&gt;Of course, there's no such thing as perfect software product, and some things must be criticized. First of all, 10 GB for basic OS installation is simply silly. With some other operating systems (most notably Linux), you get OS and almost all other software you need in much less, like 3-4 gigs at most. Memory usage is also pretty high for an OS kernel and several core services, and I don't accept "RAM is cheap nowadays" as an argument. OS should use much less memory resources than it is the case with Windows 7. Period. I've also noticed a constant disk activity even when I'm away from my computer, and this is really annoying if your hard disk is not among the most silent ones. Finally, there is a nasty bug I've encountered (and some of my colleagues, and thousands of people as I can see on the Internet) - problem with crashing after locking the screen (either with win+L or after an idle period) while being logged on domain network. I've temporary "fixed" this problem with disabling screen locking in the registry, but there is still no fix from Microsoft. My colleagues have even reported this problem to Premier support, but we are still waiting for the solution.&lt;br /&gt;&lt;br /&gt;But let's return to the main thing that made me start writing this article, marketing and hype about the Windows 7. Microsoft announces features like Aero shake, snap and peek as revolutionary, and that's what makes me laugh. First of all, you could have used such features years before Windows 7 on Linux (Beryl and Compiz). And seconds, silly GUI effects like those previously mentioned can hardly be described as something revolutionary (they could have at least "invent" virtual desktops... but no). In my opinion Mac OS or Linux are far ahead of Windows if you're main goal is to have nice desktop with eye candies. I mean, it's nice to have such things, but you can live without them.&lt;br /&gt;&lt;br /&gt;To summarize, if you're a long time Windows user, you should switch to Windows 7. If you're Linux of MacOS user, you should probably stick to your OS. Windows 7 is polished, OS somewhat faster, and with some new features, but it's not nearly so "unique and revolutionary" as Microsoft announces it.&lt;br /&gt;&lt;/div&gt;
	</description>
	<guid isPermaLink="false">
	  http://ipozgaj.blogspot.com/2009/10/windows-7-hype.html
	</guid>
      </item>
      <item>
        <title>A tricky bug</title>
	<link>http://zwillow.blogspot.com/2009/10/tricky-bug.html</link>
	<pubDate>October 17, 2009 16:10</pubDate>
	<description>
	  Today I debugged a piece of code that looked like this:&lt;pre&gt;&lt;code&gt;printf("foobar\n");&lt;br /&gt;if(fork() == 0)&lt;br /&gt;  exit(0);&lt;/code&gt;&lt;/pre&gt;When the program is run from the terminal, the output is as expected: a single line containing "foobar". However, when the output is sent to a pipe or redirected to a file, &lt;em&gt;two&lt;/em&gt; lines appear in the output. (Actually, the problem was a bit more complicated: there were &lt;code&gt;n fork()&lt;/code&gt; calls and there were exactly &lt;code&gt;n&lt;/code&gt; additional copies of the output). After a bit of digging around and not finding any obvious fault, I asked about it on IRC.&lt;br /&gt;&lt;br /&gt;It turned out that &lt;code&gt;stdout&lt;/code&gt; is fully buffered when it is attached to a pipe or a file. What happened is that &lt;code&gt;fork()&lt;/code&gt; duplicated also the internal I/O buffers, which got flushed after the child process exited, thus producing extra output. I solved the problem by inserting a &lt;code&gt;fflush(NULL);&lt;/code&gt; statement before forking, which flushes buffers of all output streams.
	</description>
	<guid isPermaLink="false">
	  http://zwillow.blogspot.com/2009/10/tricky-bug.html
	</guid>
      </item>
      <item>
        <title>Foxit PDF reader -- no go</title>
	<link>http://zwillow.blogspot.com/2009/09/foxit-pdf-reader-no-go.html</link>
	<pubDate>September 03, 2009 23:10</pubDate>
	<description>
	  Today I tested the Foxit PDF reader, version 3.1, since many people recommend it as a faster and lighter-weight alternative to Acrobat Reader.  Well, its performance is disappointing: opening a 3MB PDF with Foxit takes 2-3 seconds before the first page is displayed. Opening the same PDF with Acrobat Reader (version 9.1) displays the document &lt;span&gt;with no delay at all&lt;/span&gt;.  I attempted to open few other PDFs with Foxit, with the same result: annoying pause before I could view the document, but with Acrobat Reader showing the document immediately.&lt;br /&gt;&lt;br /&gt;So long Foxit, Acrobat Reader is still my favorite PDF reader.
	</description>
	<guid isPermaLink="false">
	  http://zwillow.blogspot.com/2009/09/foxit-pdf-reader-no-go.html
	</guid>
      </item>
  </channel>
</rss>
