Archive for June, 2012

Samsung Galaxy S2 i9100 over-heating battery symbol fix (Probably water related)

It turns out that phones don’t like water (even rain). After a particularly heavy rain shower, my phone developed a strange behavior where it would show a battery symbol together with a hot thermometer and refuse to switch on. This fixed itself after 10 minutes or so, but some time later the similar symptoms reappeared.

  • The phone ran fine when on
  • When switched off the phone refused to switch on (with aforementioned over-heating battery symbol)
  • However, when the micro-usb had a power source plugged in everything worked fine.

It seems like this is a common problem with the usb connector, and some people have fixed similar issues by buying replacement usb cards. Fortunately, I didn’t need to go so far, blowing compressed air into the micro-usb connector completely fixed this issue.

June 28, 2012 at 6:55 pm 3 comments

Ensure a bash process tidies up its children

When you have a bash process that spawns a number of background children, there is an unforunate side effect: These processes never exit. If you try to kill their parent they are happilly adopted by init.


Code

Adding the following line at the beginning of your bash script ensure that all your children are truly dead when you yourself are killed.

trap "kill -- -$BASHPID" EXIT

The -PID argument tells bash to kill the process group with id $BASHPID, process groups have the same id as the spawning process (but the process group id remains even after processes have been reparented). The — gets kill not to interpret this as a signal :S.


Caveats

The one caveat here is if someone sends you kill -9. If this happens, you don’t get to do anything before your imminent death (even murder all your children).

June 22, 2012 at 2:56 pm Leave a comment


June 2012
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930