You are viewing pavelmachek

pavelmachek's Journal

Recent Entries

You are viewing 25 entries, 25 into the past.

20th April 2014

8:57pm: ext3 -> ext4 switch: 3x improvement of find performance
I switched filesystem on old Thinkpad X60 from ext3 to ext4. It took a while, but it looks like it will be worth it. find over kernel tree now takes 6.3 second instead of 17.7, performance improvement of 2.8x. As I use unison to synchronize machines, I expect to see some real improvement.

And here's some fun you can have with busybox. Spot 3 glitches.

root@socrates:/mnt/my# dd if=u-boot.img of=/dev/mmbclk0p1 bs=64K seek=4
3+1 records in
3+1 records out
224220 bytes (224 kB) copied, 0.00113385 s, 198 MB/s

root@socrates:~# dd if=/dev/mmcblk0p1 of=orig.spl.1 bs=64k seek=0 count=0
0+0 records in
0+0 records out
0 bytes (0 B) copied, 3.972e-05 s, 0.0 kB/s

socrates login: riit^H^H^H^[[2~^H^H^[[3~
login: loginprompt.c:164: login_prompt: Assertion `wlen == (int) len -1' failed

18th January 2014

4:55am: Evil people at mozilla
Mozilla people are now officially evil. When asked, why they don't offer database for download, it was for "privacy of the contributors". Nice. I contributed quite a bit of data. At that time, map only showed numbers of known points in the area.

Now, map contains precise GPS points. So, I can not only see where I live, or where my horse lives, but also where I have been, and how fast I was traveling at that time. Thanks, mozilla. Data actually useful for non-evil purposes, like cell numbers and wifi APs are still not available for download.

Can you spot your house on mozilla map?

(Ideal solution would be of course to stop displaying detailed information on the map, and start allowing database download, in "central point for given cell id / wifi id" form. That should be enough to protect privacy, and it is also useful for geolocation.. without offering your position to mozilla.)

17th January 2014

5:02pm: How to benchmark battery in flashlight, low temperature performance
I have Zebralight H600... and TrustFire cells from TrustFire cells may have been a mistake.

Anyway... they do perform as advertised -- when benchmarking, it gives > 1 hour on 420lm. Not bad. it also has low light modes, like 65lm and 3lm. Using the low-power modes will make battery last significantly longer, right?

Well, not at all. I use it for horseback riding, which means in weather around 0 celsius (freezing). The lamp will behave quite nicely if I switch it on and let it on. It will start in 750lm mode, heat itself, and continue in 420lm, warm, for cca hour. But if I try to extend battery life (or try to be nice to my surroundings) by keeping light down, the temperature will go down, and when I then attempt to use high mode, it will fall to 3lm mode, or even fail completely. Usually it is possible to restart it in 3lm mode after few minutes wait. Ouch. (Switching to 750lm mode is too easy; that usually kills the light when cold. Selecting 420/200/100lm is not possible without going through 750lm mode; that does not help, either).

I have had light failing within 10 minutes -- go low for 10 minutes in cold weather, then switch 750lm mode, then battery trips.

Would some kind of isolation for the light help? Would the results be significantly different with better battery? Is NiMH better than LiIon for this? Is someone doing more realistic benchmarks that cycle maximum mode, but let the light cool down between tests?
3:49pm: Searching for gamma radiation pictures
Do you have radioactive source and N900? I have program that should detect radiation -- script for N900. But, without gamma source nearby, I have no way to test it. If you have both, could cover the lens, and let the script run for a while, and then would send me the resulting jpeg-s / stdout, I could do some attempts at calibration. Anyone?

8th January 2014

1:11pm: LED controller on Nokia N900 now computes prime numbers
I played a bit with lp5533 controller on N900, and result is a compiler preparing scripts for it. It is possible to control more than one led from one engine, it is possible to communicate between the engines, and it is possible to compute prime numbers directly on the controller. Code is in gitorious repository, in maemo/ Oh, and the kernel driver would really need some improvements. Right now, it limits programs to 16 steps. 30 steps should be easy, and 90 steps per engine should be possible with dynamic allocation. (OTOH... if current setup is strong enough to compute primes, maybe improvements are not critical?)

14th December 2013

6:44pm: Liveview hardware
Sony's solution for keeing liveview on your wrist does not really work. Clip works a bit better, but then, liveview keeps falling off the holder. I tried hot glue... worked for a few hours, but then I left it charging in car near hot-air exhaust. Oops. So use super (one second) glue. That seems to work.

Plus a rant: I understand that they use low refresh rate on the OLED display. Power consumption or cost... but it is nasty. What is worse... they use too low frequency to refresh the status LED, so it flickers too... On the other hard, the device was $10 or so. (Originally, I purchased "new" one. Apparently it was "new" for too long, and its li-ion battery failed completely after cca month. That one went back to manufacturer, and now I have second-hand one. Works a bit better.)

11th December 2013

12:05pm: (Second) Sony LiveView to play with
If you could run unix commands on your wrist, which commands would you use?

That's what Sony LiveView can do... and there are actually scripts to control LiveView from linux (good). (One version is in the tui cvs, I actually did partial LiveView emulator, too, but real watch came sooner.)

But... unix does not really have commands one would want to run on wrist... does it? Are there command-line tools to get weather? Public transport info? Navigation?

26th November 2013

5:35pm: Mozilla wifi location
I played with Mozilla wifi positioning a bit; I was not patient enough for full test, but mozilla was able to identify position of 105 points out of 9322 points tested, or about 1%. That's significantly better than GSM situation.

Anyway, upload of points I collected is now finished, so situation near Prague should improve rapidly.

What is expected range of wifi? Normally, 300 meters is quoted, but I frequently see way bigger distances in my testing. Is it possible that there are multiple transmitters with same MAC address?

23rd November 2013

7:56pm: Mozilla Location service
I've been playing with location using GSM cells / WIFI accesspoints for almost a year now, so Mozilla Location service was interesting news to me. Unfortunately, I soon realized that while you can contribute data to Mozilla, and ask Mozilla to locate you, you can not download database from Mozilla... Which makes it less useful than and .

Yesterday, I got to play with Mozilla location service again, and decided to check their progress... (And learn how to deal with json over http in the process). Results are not exactly pretty: my GSM database had over 72000 measurements, with 2065 unique cells (mostly Czech republic). Of those, Mozilla knew location of 6 cells...

(I'm now uploading my measurements to mozilla, so results for center of Czech republic should get a bit better.)

If someone is interested in the code, it is at tui project at sourceforge.

Situation with wifi seems to be a bit better, but scripts are slow, so it will take few hours before I know the results.

10th November 2013

11:32am: Reason to avoid Toyota cars
How not to do embedded development is worth reading. The full testimony was worth reading, too before it disappeared from the web... And yes, I believe the fault is ultimately in laws; mass-produced cars should be certified in similar way to airplanes. No, certification does not catch everything, but hey, Toyota did not even have bug tracking system... and the list of bugs they made was pretty impressive.

There's another problem near: 1) anything on CAN is considered trusted (how could attacker get here?) and 2) car radios now have bluetooth/wifi/USB and CAN connection and are easy to hack (but how could hacked radio be a problem? And yes, from the automotive summit it is pretty clear this will get worse). I actually thought about buying bluetooth odb-2 adapter for the next car, then I realized how bad idea it is.

I'm quite happy that my car does not have power steering or CAN bus, and has mechanical clutch, brakes and ignition key. It _does_ have ABS, so bad computer could probably kill my brakes. [I could probably kill that computer by turning off ignition, but I don't think I would do it fast enough in emergency. There is still vacuum for two/three
brake assists with engine off.]

Unfortunately, my horse is completely fly-by-wire. Unintended acceleration happens basically whenever there are other horses around...

21st October 2013

12:11pm: Safe way to travel to UK, GPS track editing format
I researched UK border policy, and it would certainly make Stalin happy.... "However, Immigration Officers also have far broader powers under the Terrorism Act 2000 to examine, question, and search anyone in order to establish whether or not they appear to be or have been concerned in the commission, preparation or instigation of acts of terrorism.[8] A person may be detained under Schedule 7 for up to 9 hours.[9] The Immigration Officer need not have reasonable suspicion that the detainee has in fact been involved in terrorism.[10] The detainee has a duty to provide the Immigration Officer with all information requested and a failure to do so constitutes an offence, punishable by 3 months imprisonment and a fine." (from wikipedia). In particular, traveling with your main computer seems to be very bad idea.

I'm thinking about extending gtracks project with some easy GPS tracks editing capabilities. I'd like something normal unix tools would work on, that is "one point per line". There are 1000 formats for GPS tracks, but GPX is not really suitable for this, and I'd like to be able to add fields without changing the format, so it probably should not be CSV based. (Ideally, I'd like something like lat=50 lon=15 distance_to_prev=4, with fields such as distance_to_prev being computed and added there by the tools). Since there's already 1000 of them, inventing the new one seems pretty bad, but I can't find suitable one...

3rd October 2013

10:14pm: Czech autor claims copyright on two words
"Metelesku blesku" is copyrighted according to Zdeňek Svěrák's lawyers. I think he just went crazy. (And if our copyright law indeed allows this kind of abuse, the law should be fixed.)

30th September 2013

4:42pm: Not-so-safety matches
Low quality matches sometime have their heads fall off, on fire. Unpleasant. I had one that went even worse -- part of match head, still on fire, actually stuck to the matchbox. Ouch. Match box with "safety match" in big friendly letters, on fire...

Good news is that it seems I got the airplane tickets. Now I wonder if it is wise to travel with development board in carry-on luggage.

28th September 2013

11:05am: Airline industry: treating people as cattle even before boarding
At October 2nd, I'll be presenting on workshop on Linux development on Altera Socfpga boards. And, well, that means I should get there, right? I wanted to fly there. I know I'll be treated like cattle on airports, and there's little I can do about it... (Well, Ruzyne is still better than Heathrow. Signs "insulting staff is a crime" are sure sign that you'll be treated in a way that will make you want to insult them.) But I expected that buying the ticket should be easy and painless process. After all, money is going their way, and they do a lot to explain they may not actually transport me for a wide variety of reasons (including improper clothing).

Seems like I was wrong. I guess you should never try to buy airline ticket on friday, and that is not as solid as I thought they are. When I wanted to hit "pay" button (after having window with reservation open for a while), I got dropped back to "main" menu, with no way to get back to payment page. Not a problem, I had instructions for money transfer open... so I just asked mbank to transfer the money. Bad idea, it seems. I got call explaining that this way money will not make it till Monday, and that price may chance on Monday.

So now I have no money, and no guarantee of airline ticket. Thanks a lot, studentagency.

I wonder if it is good idea to try to reserve another ticket, so I have backup in case of it does not work out, or if it will only increase my chance of not getting the ticket....

2nd September 2013

5:02pm: Bell Labs, I hate you
...for using mirror of standard calculator layout. You should have gone with the cross, that would hopefully be stupid enough for everyone switching to standard calculator layout...

25th August 2013

3:05pm: Wherigo on Nokia n900 -- solved
There is in tui project -- it provides gpsd interface for applications such as rana. I added "-n" option, which outputs nmea instead of gpsd data... so all you have to do is run gpsd, run java -jar DesktopWIG.jar, tell desktopwig to connect on localhost port 2948. Now... looking forward to some nice wherigo cache.
1:53am: Wherigo on Nokia n900
I kind of assumed that getting wherigo cartridge to run on N900 would be hard. I was wrong. Desktopwig from openwig project actually works well. I assumed that installing java using apt in debian chroot on N900 would be very easy. I was wrong again. Apt-get writes too much data to the flash, resulting in watchdog reset and corrupted partition. (It is quite incredible that N900 in default config is so broken that writing 80MB of data causes this...) Using settings from obscure maemo thread solved that.

So now I'm running at running cartridge on n900 and have one more problem: how to connect gps. Desktopwig talks nmea, but n900 exposes gps on dbus. I do have fake gpsd for N900... but that is still not NMEA. There must be ssome tool that talks to gpsd and outputs NMEA data, but how to find it?

9th August 2013

1:13am: Switch from notebook to desktop
Yesterday, I switch my "main" computer from notebook. Thinkpad X60 was getting too slow for regular use. Now, if only there was some nice and easy way to keep home directories synchronized... People were researching distributed filesystems for 30 or so years now... is there something usable?

5th August 2013

1:49am: Live with spinning rust
So far we went along with hard drives pretty well -- I never lost significant amount of data.

And yes, that includes CF-size hard drive in zaurus, which fell to ground few times, includes disks with big red letters saying "BAD", includes disk that screamed "I'm bad" so loudly I get warning at every GUI start (and had bad sectors, but kept going) and includes 2.5" drive in notebook that played dead for a week or so... and then magically came back to life when notebook overheated. Drive was so hot you could not hold it in your hands, and magically started working. It even includes current .5T drive that has bad sectors and refuses to relocate.

My meetings with flash were not that happy. Basically, when I start using flashcard, it dies. Ok, sandisk 16GB seems to holding fine with ext3 on it... but I'm careful not to load it too much. 2GB card that came with HTC Dream also survived (and was lost somewhere in fields along with the phone). Most flashcards were not that lucky, one died within seconds of use when I did tar czvf /dev/sdX files. 2 other died when I partitioned them and formatted ext3. Basically they just don't keep data I put on them.

Now... .5T drive works fine, but has bad sectors and git on kernel trees is slow on it. I tried bcache on the hdd + usb stick, and it seemed to work, but... Today I got Seagate Laptop SSHD 1TB hybrid (FP660g5), and I wonder if it will be more of a harddrive or a flash. (It is 1TB drive with 8GB NAND). So far it seems to behave like flash. It is in external USB; SMART worked on first boot but does not seem to work now. Ouch. It started giving errors (leading up to system crash) immediately when I tried to do bulk copy there. It seems to work on second boot. (Ok, USB envelope has some problems with power, like not enough; but hdds usually just shut down when there's not enough power. And yes, I do have 2 USBs connected to the envelope).

So... I still hope SSHD will have reliability of spinning rust. But I'm afraid I'll lose some significant amount of data this time.

(Does anyone know if the SSHD will keep working when the NAND dies? Is there part that fits into 2.5" notebook slot and has HDD and SSD as separate devices? I can still return this one. I'm just not sure if I'll be able to erase it securely... another nasty issue with flash.)

15th July 2013

2:54pm: Documenting a crime should not be a crime (2)

Not even if crime(s) are commited by goverments. Yes, that means I wish best luck to Edward Snowden and Julian Assange.

Now, while playing with n900, I realized that automatic regression testing and maybe even automatic bisection should be possible. I wonder if someone did it before? Current experiments are at tui/auto. Maybe I'll even try to integrate trinity :-).

1st July 2013

3:17pm: Fast cpu, flakey network
I got small desktop system with core2 duo to play with. First surprise was pleasant: performance is 2.6x performance of core duo in thinkpad x60, and even per-mhz performance is 1.7x that of x60. Good. And then the bad news: debian wanted firmware patch for networking, and even with firmware-realtek installed, networking fails every 10 minutes or so. I thought network card problems were things of the past...

I thought I could use usb networking card, but then I saw usb problems in dmesg, too. Better not try that.

Ouch, and it seems that for some very strange reason, pressing the power buttons make the network card work. Anyone seen that before?

I thought I would shame the system manufacturer, but he failed to leave his name:

# dmidecode 2.11
BIOS Information
        Vendor: Intel Corp.
        Version: MJG4110H.86A.0006.2009.1223.1155
        Release Date: 12/23/2009
System Information
        Product Name:                                  
        Serial Number:                                  

Ouch. Anyway, this makes network work well-enough for debugging:

while true; do ping -c 5 || ( echo "kicking network"; ifconfig eth0 down; ifconfig eth0 up; route add default gw ); done

Another surprises came from distcc: It actually speeds up compilation. Good. It needs same debian version on all machines. My x60 is running debian6. Bad. (There is gcc-4.4 for debian7, but I could not figure alternatives system to actually use it. Update-alternatives does not seem to know about gcc.)

10th June 2013

11:00am: Dear William Hague
If you are not a criminal, please publish your PIN, bank account password, email/facebook passwords and complete medical history. You don't have anything to hide, do you?

1st June 2013

3:12pm: Scary copy&paste issues
This is scary. I wonder if it is worth filling security bugs against web browsers?

14th May 2013

2:54pm: Slides from openmobility talk
...are here. Recording was going on, but I'm not sure if it is online somewhere...

9th May 2013

2:20pm: From squeeze to wheezy and back, and how not to backup your / filesystem
I'm still running squeeze on my X60... and I decided that with wheezy becoming "stable", it was good idea to upgrade. Before I started, I did back up my root filesystem (fortunately), with

cp -a --one-file-system / somewhere

Upgrade was a bit of fight (like aptitude trying to take hours of cpu time), but eventually I succeeded... Only to realize that system no longer boots into GUI and (worse) that gnome2 is gone. I'm not great fan of gnome3; definitely on X60, anyway. Its animations feel excessive even when system is unloaded, if there's some background load it quickly becomes unusable. I googled a bit, and it did not look like going back to gnome2 is not exactly easy.

So I went back from the backup. First, chromium refused to run because new version broke the config files. I restored those from backup. But next... strangely my self-compiled 3.9 kernel stopped working. Stock debian kernel kept running, but own kernel ran init then rsyslogd broke the boot.

Can you guess what went wrong?

pc jvgu bar svyr flfgrz bcgvba vf ernyyl onq vqrn; vg jvyy abg pbcl rirelguvat sebz lbhe / svyrflfgrz, va cnegvphyne vg jvyy abg pbcl /qri, orpnhfr gurer'f gz csf zbhagrq bire vg. Bhpu.
Powered by