Monday, March 11, 2013
Android memory corruption
Friday, January 25, 2013
Start call settings with newer Android
adb shell am start -a com.android.phone.CallFeaturesSetting.ADD_VOICEMAIL
Wednesday, August 5, 2009
enable wifi ad hoc on Andrid
Thursday, May 14, 2009
command line launching Android app
Sunday, February 22, 2009
PAN and SSH Android phone
To do anything below, the phone must be rootable. G1 dev phone, or hacked G1 commercial. There is hacking info all over the web. Maybe someday I will come back and sort it up and place it here.
Enabling PAN on Android.
Android does not come with PAN enabled. The default Bluetooth profiles are Handsfree and Headset. When tried with "pand" command, error return says "Failed to open control socket: Protocol not supported". This means it needs bnep.ko module.
To enable PAN, I needed to build bnep.ko kernel module and insmod it on the device. Here is a very good tutorial. I pretty much followed it.
But it did work for me initially. When loading the ko module, it told me "insmod: init_module 'bnep.ko' failed (Exec format error)". Dmesg gets "bnep: version magic '2.6.27-01843-gfea26b0 preempt mod_unload modversions ARMv6 ' should be '2.6.25-01843-gfea26b0 preempt mod_unload ARMv6 '". Ahh! So the version of my kernel source is newer than the one in my phone. Then I went off to www.kernel.org and downloaded version 2.6.25, and repeated the same work, config, make modules, adb push bnep.ko, insmod. Dallah!
Then set up a pand NAP
# pand -s -r NAP
Now if I see NAP in my service list
# sdptool browse local
...
Service Name: Network Access Point
Service Description: BlueZ PAN Service
Service Provider: BlueZ PAN
Service RecHandle: 0x10002
Service Class ID List:
"Network Access Point" (0x1116)
Protocol Descriptor List:
"L2CAP" (0x0100)
PSM: 15
"BNEP" (0x000f)
Version: 0x0100
SEQ16: 800 806
Language Base Attr List:
code_ISO639: 0x656e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Network Access Point" (0x1116)
Version: 0x0100
A simple "pand -c " from my computer, I had 2 devices connected via PAN. Of course I had to assign them IP address manually. A little tricky with Android is that, ifconfig does not print anything. But I figured out that before they could ping each other, I had to explicitly
# ifconfig bnep0 up
SSH from PAN'ed Android phone
Natually, I wanted to try ssh once the 2 devices can see each other on the same subnet. But here is what I get
# ssh ktang@192.168.11.4
ssh: Warning: Reading the random source seems to have blocked.
If you experience problems, you probably need to find a better entropy source.
Internet never fails me. Here is some good info. Smart people everywhere. Briefly, this is the cure.
# ls /dev/random
/dev/random
# ls /dev/urandom
/dev/urandom
# mv /dev/random /dev/random.bk
# ln -s /dev/urandom /dev/random
# ssh ktang@192.168.11.4
ssh: Warning: failed creating //.ssh: Read-only file system
Host '192.168.11.4' is not in the trusted hosts file.
(fingerprint md5 ..................................)
Do you want to continue connecting? (y/n)
y
Password:
Last login: Sun Feb 22 02:08:36 2009 from tanglin
TangMac:~ ktang$
Made me happy!
Sunday, February 15, 2009
enabling ip forward
net.ipv4.ip_forward = 0
ktang@TangLin:~$ sudo vi /etc/sysctl.conf
ktang@TangLin:~$ sudo sysctl -p /etc/sysctl.conf
kernel.printk = 4 4 1 7
kernel.maps_protect = 1
fs.inotify.max_user_watches = 524288
vm.mmap_min_addr = 65536
net.ipv4.conf.default.rp_filter = 1
net.ipv4.conf.all.rp_filter = 1
net.ipv4.ip_forward = 1
ktang@TangLin:~$ sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 1
Here is a great site of cheap sheet
Wednesday, January 21, 2009
Installing Adobe Flash Player 10 on Ubuntu Hardy
sudo apt-get install remove --purge flashplugin-nonfree libflashsupport
dpkg -i install_flash_player_10_linux.deb
But it did not work. After all the googling fun, this link was helpful. Briefly this is the key:
sudo ln -s /usr/lib/libssl3.so.1d /usr/lib/libssl3.so
sudo ln -s /usr/lib/libnss3.so.1d /usr/lib/libnss3.so
sudo ln -s /usr/lib/libnspr4.so.0d /usr/lib/libnspr4.so
sudo ln -s /usr/lib/libsmime3.so.1d /usr/lib/libsmime3.so
sudo ln -s /usr/lib/libplds4.so.0d /usr/lib/libplds4.so
sudo ln -s /usr/lib/libplc4.so.0d /usr/lib/libplc4.so
Yeah, it worked, for me at least.
Another overflow, or it looks like
- Flash Player cannot progressively load files that are greater than 2Gb (210223)
Thursday, January 8, 2009
MP4Box - Out Of Memory
Monday, November 24, 2008
burn cd / dvd
CD --
mkisofs -f -U -iso-level 4 -R -x unused_dir 59m/59mh | cdrecord -v -pad speed=1 dev='/dev/scd1' -
In this command, "-f" makes it follow symbolic link. 59m/59mh is the src dir. What will be burnt into the CD everything under this dir recursively. But 59m or 59mh will NOT be in the image. /dev/scd1 is the cdrom device.DVD --
Unsure if this can be piped. But breaking it down to 2 steps works fine
mkisofs -f -U -iso-level 4 -R -x unused_dir src | growisofs -dvd-compat -Z /dev/scd1=/dev/fd/0
Wednesday, October 15, 2008
ripping an audio cd on linux
Thursday, September 11, 2008
the evil CSS, region cod, etc.
Typically technologies are enablers. DVD is far from being the newest technology, but it makes easy and quality yet at home movies watch experiences possible. DVDs are affordable, if you don't travel.
There are other "technologies", that are rather blockers. They are there to make something not working for paid users, in hopes that (abiding) users pay double or multiple. Among the most evils, is this DVD region + css thing. Someone decided that DVD buyer only can see a DVD in 1 geographic region by paying once. If you want to see your favorite movie in Japan while you already purchased a DVD in U.S., you still have to pay for another copy in Japan. If you travel globally, you better not want to watch different movies, otherwise you have to pay for the same thing 7 times. And whats worse, you better not buy DVDs outside your region, because your home DVD player is not supposed to be able to play them, after 5 times region switches. Or you must pay a hefty fee to the player manufacturer to get you addition 5 region switches. All but you are the winners. Good deal!
Losers, forced ones, don't get to be good citizens, not voluntarily.
Monday, September 1, 2008
svn server set up
Today I set up a svn server on my Ubuntu. Since I am good at losing my works, thought svn might be a good help. I don't have a good grasp on cvs, and pretty close to hating it. svn on the other hand is closer to clearcase that I am most used to. So that was my choice. Well, clearcaes would have been nice, just that it surely would be an overkill, and non open source.
To get to the meat, first this very nice site got me a jump start - http://www.section6.net/wiki/index.php/Setting_up_Subversion_in_Linux
I already had svn installed. But to follow the instructions, I did
apt-get install subversion-tools python-subversion libsvn-perl
mkdir /svnroot
svnadmin create /svnroot
vi /svnroot/conf/svnserve.conf (set proper configs, commends are explanatory)
vi /svnroot/conf/authz (to add rw account to /)
vi /svnroot/conf/passwd (to add account / password pairs)
vi /etc/init.d/svnserve (paste in the bash script provided by the above mentioned blog)
chmod +x /etc/init.d/svnserve
update-rc.d svnserve defaults
/etc/init.d/svnserve start
Unless I forgot something, these were all I did. It was pretty simple and quick, and working (more importantly). Not bad, eh?
Saturday, August 30, 2008
"find" performance on windows ntfs vs linux ext3
Cygwin over Windows:
ztang@LV017554 /cygdrive/c/same_folder_tree_node
$ time find . -name b.bat
./b.bat
real 0m9.290s
user 0m1.483s
sys 0m7.796s
Linux
ztang@ubuntu2:~/projects/same_folder_tree_node$ time find . -name b.bat
./b.bat
real 0m0.196s
user 0m0.056s
sys 0m0.136s
sdl, gpac, dss, and others
I should have roughly about 300 gig HDD to fill for my new toy, Ubuntu 8.04. The smallest of the 4 HDDs is a 40 gig one, where I store the boot, os, and everything the is dependent on it, so that pretty much means all the software. Then I should have 250+ gigs for data, should be primarily multimedia. That should be fun.
For now, I am reloading the all software I used and think that I will be using, ffmpeg, mm codecs, mplayer, vlc, etc. All were kind of smooth, just time consuming. Here are couple of hurdles that might be worth documenting.
SDL - when configuring and compiling SDL, it does not care if there is no graphic drivers, or devices available. Don't get why. So a successful build of it does not mean much. I ran vlc or mplayer, all were fine with audio, but video could not find any device. So I had to go apt-get install a bunch of directfb, gtk stuffs. Easy enough, just don't get why SDL doesn't crap out at config time.
gpac, except for its MP4Box, I never used anything else of it. But it seems it has a player, a streamer, along with many other cool stuffs. It seems that it does not compile with OpenGL. Could also be something of OpenGL is missing on my machine. I did not dig into it. It was not recommended to build with OpenGL anyways, for performance risks, as it said in README.
dss, this is an interesting one. It does not compile. Something are apparently missing in header files, conditional compiled linux defs, head inclusion path in makefiles, head includes are even spelt wrong (in upper / lower cases). It does not even have a readme file to tell you how to compile. Try at your own risk :) . Tired and frustrated, at 2 am in the morning, I found a patch file by chance, http://freebsd.ntu.edu.tw/FreeBSD/ports/local-distfiles/nork/dss-6.0.3.patch . No description or anything. I figure it wont hurt to give a try. Turned out it was one of the few right things I did in my life. It took me 2+ hours to bust a quarter of all the problems, but 1.5 seconds to resolved the rest with this patch. And then the build and install went on a smooth sail.
By now I think the re-setup of my Linux box, upgraded with Ubuntu 8.04 Hardy Heron is pretty done. It is a pretty distro. When I plugged my cell phone, a mass storage device was automatically mounted.
Sunday, August 24, 2008
GRUB Loading, Error 15
GRUB Loading Stage1.5
Grub Loading, please wait...
Error 15
I don't remember when was last time I did not hit a wall the first step out of the door. Anyhow, standard procedure is googling with this error. So I did. Unlike most of the other times, did not find something that was close enough. So I played with it myself, and found something. The root cause was as dumb as it could be, the /boot partition did not have bootable flag set.
I have a total of 4 HDDs in the system, 2 previously loaded with fc6, 2 were from my Sony Vaio. While loading Ubuntu, I did not want to lose any data, so I loaded onto a hw that only had fc6 boot partition. That was a 40GB HDD. I loaded the whole Ubuntu 8.04 system on this single HDD. For some reason, bootable flag was not set, or perhaps was not set correctly. I found 2 other partitions were set with this flag, but not the actualy boot. Changing the flag fixed problem.
Today, a year after I posted the above, I was reading something regarding GRUB, where it mentioned that GRUB stage 1.5 is to load a program that understands file systems, ext2, ext3, or rfs. It is located in the first 30 kilobytes of hard disk immediately following the MBR. So guess my original problem was that this program was loaded, but when it tried to parse the boot flag marked partition, which did NOT have GRUB stage 2 to be found and loaded, it hung.
Grub error 17, cannot mount selected partition
I was not done with grub yet. After grub loaded, it shows all the bootable options, all 4 of them, Ubuntu 8.04, Ubuntu 8.04 (recovery), memory test, and XP (the HDDs from Vaio). That was nice to see things going fine, until it came to me the another error after hit the first boot option.
Grub error 17
Cannot mount selected partition
It apparently was trying to start Linux OS. But I did not have guesses better than this. Google proved to be my friend this time. Here is a link to some very nice info.
http://ubuntuforums.org/showthread.php?t=442945#9
Briefly, there is misunderstanding between what hd[0 - 3] are on my system, between Ubuntu and BIOS. The HDD, that has both boot and root on it, was considered hd0 by BIOS, but Ubuntu's guess was hd3. So when Ubuntu wrote up the menu.lst for grub to find os image, it put hd3. Modifying menu.list so thta it points to hd0 fixed problem.
Now I am awaiting for the next blocker.
Overtuure - Never ending problems
Been an engineer for so many year, I am led to believe that we are here not just to fix problems, but to also create problems (so that we can then fix). If there is a quiet period of time when there is no problems to tackle, it itches.
Lately I killed my Sony Vaio (that I never quite understood how I did it), so bad that, I think the motherboard is gone. Buying a new 24" iMac as the consequence of it made this rather a celebrative accident than sorrowful, but the engineer part of me took out the 2 hard drives from Vaio and put in my OTHER box, which is a fc6 Linux. I had a PCI raid card in it from a coupla years ago, so I can have up to a total of 6 (P)ATA HDDs. Well, now I have 4. The fc6 finds the PCI card, but NOT the 2 foreign HDDs. FC6 is kind of old, and every customization I ever tried to have, I had change a lot of things, and many times rebuild the kernel. So finally I got fed up with it, and decided to load Ubuntu (better forum support) 8.04.
OK, this is gonna make me busy for the next few months, I am pretty sure. Since I did that two sleepless nights ago, I have already experienced quite a few problems. I never used to do this, but age finally put me to where, I believe some documentation might save time. Now I got myself a fresh start (newly loaded Ubuntu, well, sort of), I will log the problems I experience.