BAD :(
Now I have to use this to do presentation:
1 | john@john-laptop:/etc/acpi$ cat videobtn.sh |
BAD :(
Now I have to use this to do presentation:
1 | john@john-laptop:/etc/acpi$ cat videobtn.sh |
I did the following things in the past few days:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18opkg_svn.bb: fix a stupid typo that ruined everyone's build...
diff --git a/packages/opkg/opkg_svn.bb b/packages/opkg/opkg_svn.bb
---
a/packages/opkg/opkg_svn.bb
+++ b/packages/opkg/opkg_svn.bb
@@ -23,8 +23,8 @@ echo "#!/bin/sh
if ! test -f /etc/.configured; then
opkg-cl configure
fi
-" > $D$/{sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure.sh
-chmod 0755 $D$/{sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure.sh
+" > $D/${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure.sh
+chmod 0755 $D/${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure.sh
test -f $D/${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure && rm -f $D/${sysconfdir}/rcS.d/S${OPKG_INIT_POSITION}configure
update-alternatives --install ${bindir}/opkg opkg ${bindir}/opkg-cl 100
and, on my own computer, I wanted to do:
tar zxf openmoko-asu-image.tar.gz -C /mnt
but instead I did:
tar zxf openmoko-asu-image.tar.gz -C /
So I have to reinstall debian…
DON’T WORK WHEN YOU’RE TIRED!
Quote from Interview with Donald Knuth
Still, I hate to duck your questions even though I also hate to offend other people’s sensibilities—given that software methodology has always been akin to religion. With the caveat that there’s no reason anybody should care about the opinions of a computer scientist/mathematician like me regarding software development, let me just say that almost everything I’ve ever heard associated with the term “extreme programming” sounds like exactly the wrong way to go…with one exception. The exception is the idea of working in teams and reading each other’s code. That idea is crucial, and it might even mask out all the terrible aspects of extreme programming that alarm me.
I also must confess to a strong bias against the fashion for reusable code. To me, “re-editable code” is much, much better than an untouchable black box or toolkit. I could go on and on about this. If you’re totally convinced that reusable code is wonderful, I probably won’t be able to sway you anyway, but you’ll never convince me that reusable code isn’t mostly a menace.
I wanted to move this blog to blogger for more flexible css and java script manipulation, so I wrote this py-w2b project to do that. So far I’m able to transfer blog posts, but not comments, since every comment posted by an authenticated session will become my own comments instead of the original authors. It’s trivial to use so I’ll skip the introduction here.
This is just a guess, but I think the way Dalvik, the JVM of Android, launches an app is similar to the processing launcher I wrote for Openmoko. It starts a service on dbus, then load and run the processing apps by request. This can make the start up time much shorter because basically it runs in the same jvm instance. Something like this:
1 | fork() |
So, during system start up, the first instance of Dalvik is created, and all the common java classes are loaded because you need to start the ‘home’ application. Now whenever you fork a new process, the linux kernel will try to be smart and only copy memory pages if the child process modified something in it. (copy on write)
Anyway, we will see after the release of Android source code.
2008/09/30: So, it turns out I’m right. According to Anatomy & Physiology of an Android, that first instance is called ‘zygote’. Quite self-explaining.
I finally got bothered enough to fix the /etc/network/interfaces problem on my Ubuntu notebook. The problem is that when my neo got connected, I want to do some automatic setup. On Debian lenny, it’s quite easy:
1 | allow-hotplug usb0 |
But on Ubuntu gutsy it doesn’t work. I have to replace “allow-hotplug” by “auto”. Even if I changed that, it will only work for the first time you plugged the device. That’s because of a bug listed here. The solution is to remove the DRIVER="?*"
in /etc/udev/rules.d/85-ifupdown.rules
.
Now, finally, if works even after multiple plug/unplug. However, there is still one problem left: “auto usb0” basically means the system will try to bring up the device during booting. It works for “lo”, the local loopback network interface because it’s always there. But the usb0 won’t be there everytime we boot. That causes some error messages. My solution is to modify /etc/udev/rules.d/85-ifupdown.rules again, replace “auto” by “hotplug”, and use “allow-hotplug usb0” in my /etc/network/interfaces . The final 85-ifupdown.rules looks like this:
1 | # This file causes network devices to be brought up or down as a result |
Some further digging shows the difference between debian lenny and ubuntu gutsy in the handling of the “interfaces” file. On Debian:
1 | john@buddha:/etc/udev/rules.d$ grep net.agent * |
so it runs net.agent
, a script under /lib/udev/
to bring up the interfaces. On Ubuntu, this is simply the job of the 85-ifupdown.rules
above.
NOTE: The illume info is outdated now. Just opkg install illume-theme-illume and modify /etc/enlightenment/default-profile to get the wrench and qwerty buttons.
I used the Om2008.8-update as the base image, then modify it for daily usage.
First of all I would like to use the illume default keyboard instead of the qtopia one because it gets a full-qwerty layout and it’s more suitable for terminal application. It also gives me access to illume configuration besides of the default ‘Settings’ application, which is not enough for advance usage. To do this, you need to switch to the testing repository.
replace all urls under /etc/opkg to the testing repository Then remove all the illume related packages and install the new ones.
opkg list_installed | grep illume | awk ‘{print $1}’ | xargs opkg -force-depends remove
opkg list_installed | grep libe | grep cvs | awk ‘{print $1}’ | xargs opkg install Now delete the old configs and switch to the illume default profile.
rm -rf ~/.e
replace ‘asu’ by ‘illume’ in /etc/enlightenment/default_profile Prevent the qtopia keyboard from showing up:
Add “export QTOPIA_NO_VIRTUAL_KEYBOARD=1” into /etc/X11/Xsession.d/89qtopia The second thing I did is to lower the volume of gsm handset. The original setting is so loud that everyone around me can hear the caller talking.
(call someone)
(hang up) I also need Chinese font so I can read the sms messages.
(on host) scp <chinese_font.ttf> root@192.168.0.202:
vi /opt/Qtopia/etc/default/Trolltech/qpe.conf , find [Font], change FontFamily[] to the name of the ttf. (not the filename) Change back to the default om2008.8 repository.
mv /etc/opkg /etc/opkg.testing
It seems there will be a new option for git-clone, ‘–mirror’. The command line
1 | $ git clone --mirror $URL |
is now a short-hand for
1 | $ git clone --bare $URL |
Refer to http://kerneltrap.org/mailarchive/git/2008/8/2/2793244 about this.
This is extremely useful if you need to check the contents of different branches in different directories at the same time. Each directory will be a local git clone -l -s
, and git push
will use --mirror
as well by default.
Since like forever, I have never succeed in executing python-opengl demos on debian lenny. It always segfault during glutInitDisplayMode
. After some debugging, here is why.
One should be able to call glGetError
at any time. If there’s nothing wrong, it should just return something like GLNOERROR
. Any raw (native) function call in python-opengl, no matter it belongs to GL, GLU or GLUT, will always call glGetError
right after each call to check for error. I think this is wrong since functions like glutInitDisplayMode
have NOTHING to do with glGetError. With mesa 7.0.3-5 in my system, the call to glGetError
without glInit
will cause segfault. I check the same thing on Ubuntu, which has an older version of mesa and python-opengl, and it does not happen.
python-opengl enabled error checking by default with OpenGL.ERROR_CHECKING
, which is set to True in OpenGL/__init__.py
. This code snippet can disable it:
1 | import OpenGL |
or you can just modify the __init__.py
to disable it by default.
Given the current status of python-opengl and low level x protocol support in python, I think the best language to do 3D in FOSS world will still be pure simple C.
First you have to enable oprofile in your kernel, i.e. you must have
1 | CONFIG_PROFILING=y |
in your kernel config. Then you need userspace utilities to use it. I used oprofile 0.9.4. First of all you need to setup it with something like
1 | opcontrol --init |
After that, here is the script I used to do profiling against a program:
1 | john@buddha:~$ cat bin/profile |
Use profile <the name of your executable>
to get the profile. Use opreport
to read the result. opreport -l
might be more meaningful. You can use opreport <the name of your executable>
to only get the result related to your program, but personally I prefer to check the whole system.