Log in

pavelmachek's Journal

Recent Entries

You are viewing 25 entries, 25 into the past.

15th July 2014

12:00am: Fun with spinning rust
Got a hard drive that would not spin up, to attempt recovery. Getting necessary screwdrivers was not easy, but eventually I managed to open the drive. (After hitting it few times in an attempt to unstick the heads). Now, this tutorial does not sound that bad, and yes, I managed to un-stick the heads. Drive now spins up... and keeps seeking, not getting ready. I tried to run the drive open, and heads only go to the near half of platters... I assume something is wrong there? I tried various torques on the screws as some advertising video suggested.

(Also, drives immediately stick to the platters when I move them manually. I guess that's normal?)

Drive is now in the freezer, and probably beyond repair... but if you have some ideas, or some fun uses for dead hard drive, I guess I can try them. Data on the disk are not important enough to do platter-transplantation.

3rd July 2014

12:29pm: Web browser limits desktop on low-powered machines
It seems that web browser is the limit when it comes to low-powered machines. Chromium is pretty much unusable with 512MB, usable with 1GB and nice with 2GB. Firefox is actually usable with 512MB -- it does not seem to have so big per-tab overhead -- but seems to be less responsive.

Anyway, it seems I'll keep using x86 for desktops for now.

30th June 2014

10:03pm: Warning: don't use 3.16-rc1
As Andi found, and it should be fixed in newest -rcs, but I just did

root@amd:~# mkfs.ext4 -c /dev/mapper/usbhdd

(yes, obscure 4GB bug, how could it hit me?)

And now I have

root@amd:/# dumpe2fs -b /dev/mapper/usbhdd
dumpe2fs 1.41.12 (17-May-2010)


>>> (2059923-1011347)/1024.
>>> (3108499-1011347)/1024.

. Yes, badblocks detected error every 4GB.

I'll update now, and I believe disk errors will mysteriously disappear.

22nd June 2014

4:59pm: Feasibility of desktop on ARM cpu
Thinkpad X60 is old, Core Duo@1.8GHz, 2GB RAM notebook. But it is still pretty usable desktop machine, as long as Gnome2 is used, number of Chromium tabs does not grow "unreasonable", and development is not attempted there. But eats a bit too much power.

OLPC 1.75 is ARM v7@0.8GHz, .5GB RAM. According to my tests, it should be equivalent to Core Solo@0.43GHz. Would that make an usable desktop?

Socrates is dual ARM v7@1.5GHz, 1GB RAM. It should be equivalent to Core Duo@0.67GHz. Oh, and I'd have to connect display over USB. Would that be usable?

Ok, lets try. "nosmp mem=512M" makes thinkpad not boot. "nosmp mem=512M@1G" works a bit better. 26 chromium tabs make machine unusable: mouse lags, and system is so overloaded that X fails to
interpret keystrokes correctly. (Or maybe X and input subsystem sucks so much that it fails to interpret input correctly on moderate system load?)

I limited CPU clock to 1GHz; that's as low as thinkpad can go:
/sys/devices/system/cpu/cpu0/cpufreq# echo 1000000 > scaling_max_freq

Machine feels slightly slower, but usable as long as chromium is stopped. Even video playback is usable at SD resolution.

With limited number of tabs (7), situation is better, but single complex tab (facebook) still makes machine swap and unusable. And... slow CPU makes "unresponsive tabs" pop up way too often.

Impressions so far: Socrates CPU might be enough for marginally-usable desktop. 512MB RAM definitely is not. Will retry with 1GB one day.

19th June 2014

4:49pm: debootstrap, olpc, and gnome
Versioned Fedora setup that is by default on OLPC-1.75 is a bit too strange for me, so I attempted to get Debian/ARM to work there. First, I used multistrap, but that uses separate repositories. debootstrap might be deprecated, but at least it works... after I figured need to do debootstrap --second-stage in chroot. I added firmware, set user password, installed system using tasksel, and things started working.

So now, I have a working gnome on OLPC... with everything a bit too small. I don't know how OLPC solved high-dpi support, but Debian certainly does not do the right thing by default.

21st May 2014

12:31pm: I love Python
Timetable conversion finally finished. It only run for 3.5 days...

159645.09user 151296.77system 311825.86 (5197m5.860s) elapsed 99.71%CPU

And as a bonus... Did you ever see ssh man-in-the-middle in the wild?

Someone could be eavesdropping on you right now (man-in-the-middle
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
Please contact your system administrator.
Add correct host key in /data/pavel/.ssh/known_hosts to get rid of
this message.
Offending key in /data/pavel/.ssh/known_hosts:137
RSA host key for ....de has changed and you have requested
strict checking.
Host key verification failed.

That was Hotel Kossak in Krakow. Apparently when your internet connection key
expires, they launch a free attack at you as a bonus.

18th May 2014

8:27am: Python
...easy to program in, but hard to program when you want your programs to run at useful speed.

I'm currently fighting with gtfs convertor for timetab (was running overnight; and that's after I spent yesterday speeding it up 30 times or so; still not done). And yes, I realize that Python is probably not best language for weather nowcasting...

Are there some books / online things one should read to learn Python? Or is there some different language I should be using? (Yes, I like the language. No, I don't like whitespace-based syntax. No, I don't the fact that I have to actually test the application to discover typos in variable names.)

25th April 2014

1:27pm: Never trust spinning rust that refuses to reallocate sectors
(old indian proverb)

Playstation PS/3 is a small computer... that tries a lot not to look like a computer. I thought journalling is an old invention, but when I powered it off using power plug I was reminded that that's not the case. Result was 10 minute filesystem check, with note that it will take 4 (?!) hours if any problems are found. Ouch.

Anyway, it got me thinking. With 4 hours filesystem check time, it clearly has way bigger drive that it needs. 500GB... And hdd in my notebook refuses to reallocate bad sectors. (By some miracle, I did not really lose any data, and it was mostly behaving ok.) Refusing to finish tests is also not big problem, but it also made me nervous. Time to swap disks.

Model Family:     Seagate Momentus 5400.6 series
Device Model:     ST9500325AS
Serial Number:    5VE41HDA
Firmware Version: 0001SDM1
User Capacity:    500,107,862,016 bytes
SMART overall-health self-assessment test result: PASSED
  1 Raw_Read_Error_Rate     0x000f   097   092   006    Pre-fail  Always       -       23719990
  3 Spin_Up_Time            0x0003   099   098   000    Pre-fail  Always       -       0
  4 Start_Stop_Count        0x0032   099   099   020    Old_age   Always       -       1349
  5 Reallocated_Sector_Ct   0x0033   100   100   036    Pre-fail  Always       -       12
  7 Seek_Error_Rate         0x000f   082   060   030    Pre-fail  Always       -       8963080173
  9 Power_On_Hours          0x0032   062   062   000    Old_age   Always       -       34070
 10 Spin_Retry_Count        0x0013   100   100   097    Pre-fail  Always       -       0
 12 Power_Cycle_Count       0x0032   099   037   020    Old_age   Always       -       1320
184 End-to-End_Error        0x0032   100   100   099    Old_age   Always       -       0
187 Reported_Uncorrect      0x0032   001   001   000    Old_age   Always       -       179
188 Command_Timeout         0x0032   100   094   000    Old_age   Always       -       42950329567
189 High_Fly_Writes         0x003a   100   100   000    Old_age   Always       -       0
190 Airflow_Temperature_Cel 0x0022   061   045   045    Old_age   Always   In_the_past 39 (Lifetime Min/Max 22/42)
191 G-Sense_Error_Rate      0x0032   100   100   000    Old_age   Always       -       2
192 Power-Off_Retract_Count 0x0032   100   100   000    Old_age   Always       -       3
193 Load_Cycle_Count        0x0032   001   001   000    Old_age   Always       -       2337789
194 Temperature_Celsius     0x0022   039   055   000    Old_age   Always       -       39 (0 6 0 0)
195 Hardware_ECC_Recovered  0x001a   049   029   000    Old_age   Always       -       23719990
197 Current_Pending_Sector  0x0012   100   100   000    Old_age   Always       -       2
198 Offline_Uncorrectable   0x0010   100   100   000    Old_age   Offline      -       2
199 UDMA_CRC_Error_Count    0x003e   200   200   000    Old_age   Always       -       0
254 Free_Fall_Sensor        0x0032   100   100   000    Old_age   Always       -       0
Error 170 occurred at disk power-on lifetime: 34070 hours (1419 days + 14 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      13:30:21.079  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:18.250  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:17.700  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:17.646  READ DMA EXT
  25 00 08 ff ff ff ef 00      13:30:17.644  READ DMA EXT
...Error 166 occurred at disk power-on lifetime: 34057 hours (1419 days + 1 hours)
  When the command that caused the error occurred, the device was active or idle.

  After command completion occurred, registers were:
  -- -- -- -- -- -- --
  40 51 00 ff ff ff 0f  Error: UNC at LBA = 0x0fffffff = 268435455

  Commands leading to the command that caused the error were:
  CR FR SC SN CL CH DH DC   Powered_Up_Time  Command/Feature_Name
  -- -- -- -- -- -- -- --  ----------------  --------------------
  25 00 08 ff ff ff ef 00      00:56:25.218  READ DMA EXT
  25 00 08 ff ff ff ef 00      00:56:25.217  READ DMA EXT
  25 00 08 ff ff ff ef 00      00:56:25.216  READ DMA EXT
  25 00 18 ff ff ff ef 00      00:56:25.215  READ DMA EXT
  25 00 10 ff ff ff ef 00      00:56:25.214  READ DMA EXT

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Aborted by host               90%     33409         -
# 2  Extended offline    Completed: read failure       90%     31692         961237184
# 3  Extended offline    Completed: read failure       90%     30723         961237184
# 4  Extended offline    Completed: read failure       90%     28305         961237188
# 5  Extended offline    Completed: read failure       90%     28262         961237187
# 6  Extended offline    Completed: read failure       90%     28257         961237188
# 7  Extended offline    Completed: read failure       90%     28251         961237188
# 8  Extended offline    Completed: read failure       90%     28233         961237188
# 9  Extended offline    Completed: read failure       90%     28227         961237188
#10  Extended offline    Completed without error       00%     23826         -
#11  Extended offline    Completed without error       00%      9419         -
#12  Extended offline    Completed without error       00%        40         -

It turned out that swapping disk in PS/3 is not an easy process. You need additional disk to perform backup to, side cover is not really easy to remove, and box is dead and needs "software update" after you swap the disk. It took few hours total. (Come on, 18GB of save game data...?)

I got single transient error when trying to copy out the data.

cp: reading `wnow/tmp/www.chmi.cz/meteo/rad/data/1309201315.gif': Input/output error

So far so good.

24th April 2014

4:11pm: Unison: delete a file but don't delete a file
Unison keeps filesystems synchronized across machines... If you are still manually using rsync, you might want to take a look. Now... question. I'm running low on space on one of those machines synchronized. Now what I'd like to do is to remove a file in such a way that it is not removed from other replicas. In fact, I'd like to be asked to copy the file back on next synchronization (same situation as if the file never existed in the first place). Any ideas how to do that?

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 dx.com. 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/notcc.py. 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 opencellid.org and openwlanmap.org .

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 studentagency.cz 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 gpsd.py 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.
Powered by LiveJournal.com