Archive for the 'Computer' Category

Thu
15
Oct '09
pgrep or pkill sometimes do not find process
by Frank Spychalski filed under Computer, Work

The usual problem: you want to kill a process.

$ ps aux | grep randomprocessname
psycho 20429 0.0 0.0 11824 1580 pts/7 S+ 12:00 0:00 /bin/bash ./randomprocessname
psycho 20528 0.0 0.0 4188 740 pts/17 R+ 12:00 0:00 grep randomprocessname
$ pkill -9 randomprocessname
WTF? Kill that sucker!
$ pkill -9 randomprocessname
No typo... Am I crazy?
$ pgrep randomprocessname
What's wrong?
$ pgrep randomprocessna
20429
$ pkill -9 randomprocessna

For some arcane reason pgrep/pkill matches only the first 15 characters.


Last week I added the 1gb data plan to my Simyo contract to use the SIM with my Christmas G1. I tried a few configurations I found online for simyo but they did not work for me. After some frustration I tried an eplus configuration and this one finally worked for me:


Name: does not matter
APN: internet.eplus.de
Proxy: <empty>
Port: <empty>
Username: eplus
Password: <empty>
Server: <empty>
MMSC: <empty>
MMS proxy: <empty>
MMC: 262
MNC: 03
APN type: <empty>

Update:

The recommended configuration is:


Name: does not matter
APN: internet.eplus.de
Proxy: <empty>
Port: <empty>
Username: simyo
Password: simyo
Server: <empty>
MMSC: <empty>
MMS proxy: <empty>
MMC: 262
MNC: 03
APN type: <empty>

After the initial success with the eplus configuration, I had some problems with it, too. But I guess these errors were internal eplus network hiccups because they were gone without me changing anything and now both configs work.


Thu
26
Feb '09
Tab + Firefox on OS X
by Frank Spychalski filed under Computer

A few days ago I finally upgraded my (== my employer’s) Macbook Pro from Tiger to Leopard. Everything worked flawless except for one crazy problem: I could not use to tab key the way I used to in forms. My usual routine of quickly entering username, tab, password, tab, hit return did not work anymore. I searched through the Firefox settings but couldn’t find the “Drive psycho crazy”-option.

But thanks to the omniscient internet I found a solution. At the bottom of the “Keyboard & Mouse” preferences page is a setting which allows you to navigate only between text boxes or between all controls. I don’t know who came up with the great idea that the default should be “text boxes and lists only”, but I guess the mighty Steve knows what he is doing.


Sat
21
Feb '09
Pair Programming killed the Uber-coder…
by Frank Spychalski filed under Computer

I stumbled over a great essay on pair-programming (via James Shore).

Rod Hilton explains it much better than I could ever do, why you should Pair-Program. But I haven’t heard about the “ping-pong pairing”:

When doing Test-Driven Development, one of the things we do is called “ping-pong pairing”. So the other developer will write a test, then make it compile but fail. Then he passes the keyboard to me. I implement the feature just enough to make the test pass, then I write another failing test and pass it back.

I have to try this on Monday…


Sat
31
Jan '09
Drop all tables from a mysql database
by schlumpf filed under all, Computer, Work

Sometimes you want to reset a database to its virgin state, without actually deleting and re-creating the whole database (perhaps because your user doesn’t have the right to create a database). There are a lot of links out there that give you a quick answer on how to drop all tables from a database in a single-line shell script. Some examples:

However this does not work if there are foreign key constraints between the tables (because the tables constraining others need to be deleted first). Here’s the advanced version that solves this problem:

#!/bin/bash
USERNAME=myUser
PASSWORD=myPassword
HOSTNAME=dbHost
DATABASE=mydb
while (true) ; do
    TABLES=`mysql -h $HOSTNAME -u $USERNAME -D $DATABASE --password=$PASSWORD 
                  --batch -e "show tables" | grep -v Tables_in`
    if [ -z $TABLES ] ; then break; fi
    for i in $TABLES ; do
        mysql -h $HOSTNAME -u $USERNAME -D $DATABASE --password=$PASSWORD  -e "drop table $i"
    done
done

I agree this is not nice because it’s a brute force approach – but hey, it works! And resetting a database is most probably not a performance-critical task anyway.


Today I wanted to implement something that would prevent me from accidentally closing the browser window while I was doing stuff in my webapp. I’m no javascript expert, so I checked some newsgroups and found more and more complex solutions the longer the threads were. Read the rest of this entry »


Mon
2
Jun '08
Chumby goes i18n – soon available outside US?
by Frank Spychalski filed under Computer, Fun


I just stumbled over a this ad for someone to do the internationalization for (probably) chumby.com. I hope this means that they will start selling the chumby outside the US soon :-)

Title: Ruby On Rails I18N Developer
Skills: I18N, Ruby on Rails, mySQL

Job description:

Chumby Industries is looking for a Ruby On Rails/I18N Contractor to deliver results for the internationalization (I18N) effort on the server.
This candidate would be responsible for externalizing all the text strings (both static and dynamically generated) that the website uses so that Chumby could later change the language of the site based on location.

Skills required:
Previous I18N efforts on browser-based platforms
Strong web-based development experience
Ruby on Rails experience
mySQL database experience
Familiarity of layout issues involved with I18N


Fri
16
May '08
Chumbytime
by Frank Spychalski filed under Computer, Fun

mikelutz chumby pic from flickrTwo days I got my chumby. Chumby Industries tries really hard to keep foreigners from buying one of their nice toys: they only accept US credit cards and shipping only to a US address. But I’m lucky, one of my colleagues from Mountain View ordered one for me.

My experience so far was great.

Step one: configure WiFi
It detected my local network without a problem. I had to enter the password and was ready to go.

Step two: activate chumby
Create an account at chumby.com and click on “activate chumby”. It shows a 4×4 matrix of dots you have to copy to your chumby to connect you account with your device. This is a nice idea. It’s very simple, easy to use but effective. And surprisingly that’s it.

Step three: add widgets
Just one click. Sometimes the widgets need a some configuration but everything is explained right there.

Minor annoyances

  • only two brightness settings: high & low
  • you have to press pretty hard on the touchscreen

Plans:
Find a German power supply (should be easy) and start coding a widget :-)


Fri
25
Apr '08
Girl’s day in the office
by Frank Spychalski filed under Computer, Fun, google

Google had a special doodle for the Girl's day
Yesterday was Girl’s day and our office hosted a few girls from schools in and around Munich. Read the rest of this entry »


Sun
30
Mar '08
Darling, I shrinked the menu
by Frank Spychalski filed under Blog

Yesterday I installed version 2.5 of WordPress (which is great!) but the menu in the admin interface uses up a lot of screen estate. That’s why I just patched wp-admin.css to save some of this precious space in the admin interface. Just follow the above link and replace your version found in wp-admin/ if you think the menu is too big. Read the rest of this entry »


Bad Behavior has blocked 622 access attempts in the last 7 days.