: Python is a nice... language
Oh, and I already used my main SIM in N900/Debian... and I really used N900/Debian. I needed to tether a network, but not provide wifi hotspot. Done.
You are viewing the most recent 25 entries.
15th April 2016
Python is a nice... trap
: Python is a nice... language
Easy to program in. No need to recompile, you can hack in as you would in shell. Fun.
Lets see if I can predict the weather. Oh yes, lets hack something in python. Hey, it works. But it is slow on a PC and so slow on a phone that future is already past when you predict is.
Then you try to improve the speed. That's very very bad idea. You can't optimize Python, but you can spend hours trying. You make a mental note to never ever use Python for computation again.
But Python should be fine for simple Gtk project, communicating over Dbus, right?
For bigger projects, Python has some support. Modules / object orientation really helps there. Lack of compilation really hurts there, but this is fun language, right? Allowing you to write nice and clean code.
Refactoring is hard, because variables are not declared.
Python is a nice... trap
But then your project grows larger, and you realize it takes 30 seconds to start up. Because many module need gtk, and importing gtk takes time. Heck... compiling _and_ running C based hello world is still faster then running Python based one.
Ok, C++ was tempting. Gtk Hello world takes 55 seconds to compile. My g++ does not support "auto", so the application starts with Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example"). I think I'll stick with C.
Oh, and I already used my main SIM in N900/Debian... and I really used N900/Debian. I needed to tether a network, but not provide wifi hotspot. Done.
11th April 2016
pypy: suprisingly good
Using python for weather forecasting was a mistake... but it came with some surprises. It looks like pypy is as fast as gcc -O0 on simple correlation computation: : https://gitlab.com/tui/tui/blob/master/n
Finally... power management on Nokia N900
After long long fight, it seems power management on Nokia N900 works for me for the first time. N900 is very picky about its configuration (you select lockdep, you lose video; you select something else 50mA power consumption... not good). That was the last major piece... I hope. I should have usable phone soon. :
10th March 2016
liferea .. allows tracking. Too much tracking for my taste.
I noticed that every time I click a header in liferea, on http://servis.idnes.cz/rss.aspx?c=zprav
I turned off network, and three broken images... So it turns out liferea is downloading three invisible images to assist idnes in tracking.
Can I somehow tell liferea not to download anything just because I clicked the headline?
4th March 2016
blinking cursor of death
: Yesterday, my / filesystem on Debian on Nokia N900 went full. Ok. So I removed some cached dpkgs. I believe phone still worked today morning.
Now, at the point where it should start X, screen goes dark, and then blinking cursor reapears. Normally, I'd hit ctrl-alt-f1, and debug
stuff from there, but N900 has no alt, and no f1. I'll image filesystem now. I can take a look at logs and fix stuff on filesystem,
but can't do other experiments easily. Debian 7.9. If you have some ideas what log to look at, let me know.
Window manager warning: CurrentTime used to choose focus window; focus window may not be correct.
Window manager warning: Got a request to focus the no_focus_window with a timestamp of 0. This shoul\
nagement - but it is provided by the application
** Message: applet now removed from the notification area
polkit-mate-authentication-agent-1: Fatal IO error 11 (Resource temporarily unavailable) on X server \
g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes\
on an async read (g-io-error-quark, 0). Exiting.
The application 'mate-panel' lost its connection to the display :0;
most likely the X server was shut down or you killed/destroyed
(nm-applet:3386): Gdk-WARNING **: nm-applet: Fatal IO error 0 (Success) on X server :0.
This is second time it happened, so it would be good to solve, OTOH just restoring from backup might be easier.
10th February 2016
Fire from the moonlight
Actually, I think you can make fire from the moonlight -- it just won't be easy. All you need is square inch (or so) of mirrors on moon. If there was not enough of mirros on moon hundred years ago, I'm pretty sure we put enough junk there in last 100 years.. probably including some mirrors for distance measurement.
9th February 2016
: Yes, I did contribute to free software. Does it mean every person from university has to spam me, just because he's "researching" it? Jeffrey Carver <email@example.com> , I'm talking about you. And we are not talking one message, either.
1st February 2016
The day Google went evil
: Now, it will activelly prevent you from using it unless you enable cookies (with excuse of european data protection laws). So I disabled cookies for google.com. Now google works... for a day... so its now duckduckgo.com for me. Interesting how tricky it was to add into chromium, how well hidden cookie settings are in chromium, and how they change yourself if you are not careful.
11th January 2016
X servers and dangerous aircraft
: It is very easy to lose track of cursor on multiple monitors... Especially if cursor is on down or right edge, only few pixels remain. Should some kind of pointer remain on the monitor even when mouse is on other monitor -- providing kind of "look that way" pointer?
Oh and... when activating USB-to-VGA adapter, mouse disappears altogether. Ouch. Unfortunately, that means system is unusable.Is there way to adjust DPI setting, preferably per application? Does gtk has some option like that? N900 has 800x480 display. When using stylus, you can put your phone close to your eyes and pretend its a PC, but when using fingers, many controls are just way too small.
Its official: Airbus killed them.
Airbus A320 has two sidesticks, with no force feedback, and no physical link. So you are trying to recover from stall, you are pushing the sidestick fully and your first officer pulls the stick fully -- result is you remain stalled. You don't even know your first officer fights with you... That's what happened to PK-AXC, report is here. (How did they get to stall? Computers spuriously adjusted their rudder trim when they lost power. No, you should not reset flight computers like that.)
10th January 2016
2016: Year of the GNU/Linux phone
: Well, Linux is running significant fraction of cellphones these days... but usually very old and very patched kernel. But maybe we can run mainline kernel with free userland?
Today, I made first successfull call with Nokia N900 running 4.4-rc8 kernel and Debian userland. Latency was cca second, and I was told my voice was not recognizable, but we had no problems understanding each other.
Maybe voice format is not 4kHz, 16bit, stereo after all?
4th January 2016
N900: Found a way to do rotation in X
...which is needed for control by single hand. Unfortunately, xrandr refuses to rotate on N900 for some reason, so I'm doing Xephyr and
...and looking for better ssh.
Sitting at the train, ssh-ing from laptop to phone, with second phone providing hotspot (okay, I do feel a bit silly). Now... this does not work too well. First, I had to manually copy the IP address, and second, I did not really verify the ssh key. And as IP address changes, I'd have to do it each time. Better solution would be welcome.
I want to connect to my phone, no matter what IP address it has. If possible, I'd like the keys to be checked during connection, too.
2nd January 2016
N900 progress... and roadblock
Ok, developing directly on target is easy... and phone is now in much better shape. I added watchdogs, so I'm no longer afraid to let it run debian for extended periods of time. Voice calls work, but audio quality is awful/unusable. :
Developing directly on target also has problems:'
remote: error: object c86cce9eda127cd891a7cf2d23e007deaddf4d34:
remote: fatal: Error in object
pavel@n900:/my/tui$ git show c86cce9eda127cd891a7cf2d23e007deaddf4d34
error: object directory /data/l/clean-cg/.git/objects does not exist; check .git/objects/info/alternates.
Author: Pavel <firstname.lastname@example.org>
Date: Wed Dec 31 23:59:43 1969 +35150858
Fun. I wonder what happened there, if it is going to happen again, and if I can fix it somehow...
Happy New Year!
4th September 2015
Wifi fun and misc..
(And apology for the SSD entry some time back. Apparently yes, they can fail to retain data after less than a week... at the very end of their lifetime.) :
In the last weeks, learned that transfering real-time data over WIFI is way more fun than I thought. And that it is possible to communicate from inside of (closed) microwave oven using 2.4GHz WIFI. I don't know about you, but it scares me a little.
N900 and not everything is a file
Pocket Computer. We had pocket computers before ... Sharp Zaurus lines was prominent example. They had keyboards and resistive
touchscreens... Resistive touchscreen with stylus is accurate enough to serve as mouse replacement. Unfortunately, such machines are slowly going extinct. Sure, we have Quad-core Full-HD smartphones these days... but they lack keyboards, making ssh from them impossible, they lack accurate pointing device, and they are really phones, not small computers. N900 can almost be used as a pocket computer...
New Mer is "broken beyond repair" for n900.. as it uses qt5. qt4 works well (well... little slow) on n900, but qt5 needs stable egl
drivers. Ok, so that was another nice-looking trap. I'm starting to think that text-only user interface is right thing to do on n900 at
Baking n900 for 15minutes at 250C seems to have fixed the "no sim card" problem... for a week. It now seems a bit flakey, but definitely better than before baking. Thanks for everyone at Czech BrmLab!
To backup mmc card on N900, I'd like to rsync root@maemo:/dev/mmcblk1 mmcblk1.img ... but that does not work, as rsync is too clever and refuses to transfer content of special files. Is there trick I'm missing?
On the n900 front... it has 256MiB RAM and 800x480 screen. What web browser would you recommend for that? I tried links2, but its support is not good enough for properly working m.mobilecity.com pages... which I'd kind of like.
Linus, please reconsider -rc0
Hmm. There's big difference between 4.1 (expected to be pretty stable kernel) and 4.2-rc0 (which is probably going to be as unstable as it gets. Unfortunately, Linus does not change makefile before merging, so it is quite tricky to tell if
Linux amd 4.1.0 #25 SMP Wed Jul 1 11:20:22 CEST 2015 x86_64 GNU/Linux
is expected-to-be-stable 4.1, or expected-to-be-very-unstable 4.2-rc0...
Its tempting to name your branches simply "v4.1", "v3.11". Don't. When -rc's are done, Linus will create "v4.1" tag, and you'll have fun
figuring out what whent wrong in your git.
Google play bloatware
I got very cheap LG optimus chic.. and android did improve from G1 days. Its still Google's spying empire, but.. at least it is fluid and mostly works.
Not sure what "Google Play services" are good for, but taking 50MB of internal flash is not funny.. and when moved to SD card, the SD card tends to disconnect. "Google Play Store" still works without them. "My Tracks" need them, but 60MB of flash is not reasonable price to pay for GPX recording. "Pubtran" got removed, too. MHDdroid has strange interface, but perhaps it will not need that much storage.
Do you know a way to search czech public transport without Android and without desktop browser or Opera Mini? m.idos.cz leads to "full" version.
And ...dear Android, "force close" dialog is last thing I want to see after hearing ringtone. If you could at least add the number to call log...
Wed Jul 1 01:59:58 CEST 2015
Wed Jul 1 01:59:59 CEST 2015
Wed Jul 1 02:00:00 CEST 2015
Wed Jul 1 02:00:01 CEST 2015
Wed Jul 1 02:00:02 CEST 2015
Wed Jul 1 02:00:03 CEST 2015
Different power supply for X60
Thinkpad X60 is marked as 20V, 3.25A. I wonder if using 19V, 2.63A power supply is a good idea. The power brick is way smaller, and 65W seems to be a little high for a small notebook.
10th July 2015
Front USB connectors are evil
: NFSroot over USB on n900 was only giving me 300KiB/sec... and I thought that was normal. Now I plugged the cable to back USB port (not front one) and... speed went from 300KiB/sec to 2.5MiB/sec. Not bad for old cellphone.
Someone must be joking?
Vbus off, timeout 1100 msec
It looks like my n900 was bitten by famous "all calls disabled" problem. ( example solution ). Prague Brmlab helped a lot, and baking n900 for 15minutes at 250C seems to have fixed the problem... for a week. Now it looks like it slowly creeps back.
20th May 2015
Alcatel Pixi 3.5
Available in Czech Republic, too, 98 grams, and pretty cheap. On my Nokia n900, GSM parts died, and hacking cellphone you are using is a bad idea... So... what about Pixi? Underpowered hardware, but still more powerful than n900. Does firefox os support wifi tethering by default? Is it reasonably easy to hack? (I guess "apt-get install python would be too much to ask, but..) Other candidates are Jolla/Sailfish and Ubuntu Phone. :
11th May 2015
More SSD fun
This scheds some light on how tricky multi-level NAND drives are.
SSD temperature sensitivity.
If you store SSDs at higher temperature than operating, bad things will happen... Like failure in less than a week. "Enterprise" SSDs are more sensitive to this (I always thought that "enterprise" is code word for "expensive", but apprently it has other implications, too).
Oh and that N900 modem problems... it seems it was not a battery. Moving SIM card to different phone to track it down...
9th May 2015
Good use for old, 80GB 3.5" hard drive
If it does not work, open it and try to repair it. :
If it works, and you are tired of killing working drives...
tar czv /data/$1 | aespipe > /mnt/$1.tgz.aes
...fill your harddrive with data you'd like to keep, and bury it in the woods on a moonless night.
On a unrelated note... it seems Nokia N900 does not have as many capacitors at it should have. If you battery is too old, it will be still good enough to power most functions, but not the GSM/SIM card parts, resulting in network errors, no calls possible, etc. Problem mysteriously goes away with newer battery...
10th March 2015
Happy Easter from DRAM vendors
DRAM in about 50% of recent notebooks (and basically 50% of machines without ECC) is : so broken it is exploitable. You can get root from normal user account (and more). But while everyone and their dog wrote about heartbleed and bash bugs, press did not notice yet. I guess it is because the vulnerability does not yet have a logo?
I propose this one:
+==. | \ +---+ +====+ -+ +- || |DDR| || -+ +- || +---+ ||
Memory testing code is at github. Unfortunately, Google did not publish list of known bad models. If you run a test, can you post the results in commments? My thinkpad X60 is not vulnerable, my Intel(R) Core(TM)2 Duo CPU E7400 -based desktop (with useless DMI information, so I don't know who made the board) is vulnerable.
Time: 1039 Safe: 101 Plane 'X' landed at the wrong airport. You beat your previous score! #: name host game time real time planes safe ------------------------------------------------------------------------------- 1: pavel duo default 1040 34:38 101
And some good news: Old thinkpad x60 can take 3GiB RAM, making machine usable a little longer.
gpsd can run non-root, and seems to accept output from named pipe. Which is good, because it means using wifi accesspoints to provide position to clients such as foxtrotgps is easier. Code is in gitorious tui.
6th March 2015
Position privacy protection
: Mozilla maintains access points (AP) database at location.services.mozilla.com. Location using WIFI is cool: you don't need GPS hardware, and you can fix quicker/for less battery power in cities, and you can get a fix indoors.
Mozilla will return your position if you know SSIDs of two nearby access points, using web service. That has disadvantages: you need working internet connection, connection costs you time, power and money, and Mozilla now knows where you are.
Obvious solution would be to publish AP database, but that has downside: if you visit Anicka once and learn SSID of her favourite access point, you could locate Anicka with simple database query once she moves.
first = select N numerically lower (or most commonly seen) access points in the area
second = all access points in the area
for i in first:
for j in second:
at position sha1(i, j, salt?) in the database, store GPS coordinates.
If probability of missing access point when you are in the right area is P, probability of not being able to tell your location is P^N. Database will grow approximately N times.
Storing salt: it will make it harder to see differences between different version (good). But if we play some tricks with hash-size to artificaly introduce collisions, this may make them ineffective.
Problem: There is only 2^48 access points. Someone could brute force hash. Solution: store fewer bits of hash to create collisions?
Problem: If you can guess Anicka anicka likes South Pole, and suddenly new access point appears in the area, you can guess her address. Comment: not a problem since Anicka would have to take two access points to the South Pole? Or still a problem since you don't need to know address of the second AP to locate her?
Problem: If you know Anicka likes Mesto u Chciplyho psa, where noone ever moves and noone ever activates/deactivats APs, you can still locate her. Comment: is it a problem? Are there such places?
Any ideas? Does it work, or did I make a mistake somewhere? Is there solution with lower overhead?
20th February 2015
What you might want to know about uloz.to
1. captcha is not case-sensitive :
2. you can get around concurrent downloads limit using incognito window from chromium. If you need more downloads, chromium --temp-profile does the trick, too.
What you might want to know about Debian stable
Somehow, Debian stable rules do not apply to the Chromium web browser: you won't get security updates for it. I'd say that Chromium is the most security critical package on the system, so it is strange decision to me. In any case, you want to uninstall chromium, or perhaps update to Debian testing.
18th February 2015
When you are drowning in regressions
..then the first step is to stop more regressions. That's the situation with Nokia N900 kernel now: it has a lot of hardware, and there's kernel support for most of that, but userland support really is not mature enough. So I added test script to : tui/ofone, which allows testing of battery, audio, LEDs, backlight, GPS, bluetooth and more. It is called "tefone". "ofone" script (with gtk gui) can be used to control modem, place calls and read SMSes. You'll need a library to actually get voice calls with audio.
On a related note, my PC now resumes faster than my monitor turns on. I guess we are doing good job. (Or maybe Fujitsu did not do such a good job). Too bad resume broke completely in 3.20-rc0 on thinkpad.
26th January 2015
On limping mice and cool-looking ideas
I got two Logitech mice, and they worked rather nice. But then buttons started acting funny on first, then second, and I switched to Genius one (probably with lower resolution sensor). I quickly found that I have two mice with working sensor, and one mouse with working buttons. Not good.
Now, I got new Logitech M90.. this one has working sensor, two working buttons, and three legs of the same length. Ouch. It wobbles on table :-(.
It also shows why mouse-box is cool-looking, but not quite cool idea. Mouse is something that gets damaged over time, and needs to be replaced... which is something you don't want to do with your computer. (Plus, your mouse will not be too comfortable to use when it has three cables that were not designed for bending, connected.)
12th January 2015
Why avoid ACPI on ARM (and everywhere else, too)
Grant Likely published article about ACPI and ARM at http://www.secretlab.ca/archives/151 . He acknowledges systems with ACPI are harder to debug, but because Microsoft says so, we have to use ACPI (basically).
I believe doing wrong technical choice "because Microsoft says so" is a wrong thing to do.
Yes, ACPI gives more flexibility to hardware vendors. Imagine replacing block devices with interpretted bytecode coming from ROM. That is obviously bad, right? Why is it good for power management?
It is not.
Besides being harder to debug, there are more disadvantages:
* Size, speed and complexity disadvantage of bytecode interpretter in the kernel.
* Many more drivers. Imagine GPIO switch, controlling rfkill (for example). In device tree case, that's few lines in the .dts specifying which GPIO that switch is on.
In ACPI case, each hardware vendor initially implements rfkill switch in AML, differently. After few years, each vendor implements (different) kernel<->AML interface for querying rfkill state and toggling it in software. Few years after that, we implement kernel drivers for those AML interfaces, to properly integrate them in the kernel.
* Incompatibility. ARM servers will now be very different from other ARM systems.
Now, are there some arguments for ACPI? Yes -- it allows hw vendors to hack half-working drivers without touching kernel sources. (Half-working: such drivers are not properly integrated in all the various subsystems). Grant claims that power management is somehow special, and requirement for real drivers is somehow ok for normal drivers (block, video), but not for power management. Now, getting driver merged into the kernel does not take that long -- less than half a year if you know what you are doing. Plus, for power management, you can really just initialize hardware in the bootloader (into working but not optimal state). But basic drivers are likely to merged fast, and then you'll just have to supply DT tables.
Avoid ACPI. It only makes things more complex and harder to debug.