Archive for the 'Work' Category

Last week I was asked whether I knew how to set up a dyndns server. Well, I didn’t at that time, but I did some research. This is what I found. Read the rest of this entry »


Wed
13
Apr '11
New project at Google.
by Frank Spychalski filed under Work

For the last 3 years I was working in an area called Engineering Productivity at Google. This group builds internal tools for other engineers but sadly there is very little I can talk about, except for the obvious facts: it’s challenging, fun and at a scale I hadn’t seen before.

Well, a few weeks ago I switched projects and focus areas. Now for the first time in my career[1] at Google I work on a customer facing product: the Google Privacy dashboard. Obviously I can’t write about upcoming launches, but I can assure you that there are many cool new features in the making.

[1] This is not 100% true. A little over two years ago I did some 20% work on the dashboard, so there is already a tiny little bit of code online that yours truly wrote. In case you are curious, it’s the logic that makes sure you get to see the privacy statement for your country, e.g. http://www.google.com/chrome/intl/en/privacy.html or http://www.blogger.com/privacy?hl=en.


Thu
20
May '10
Customize Chrome Omnibar
by Frank Spychalski filed under google

I love Chrome! But one thing drove me crazy: we have numerous internal web-apps running on different hosts. From Firefox was easy to get to these tools by just typing the toolname (not the FQDN) in the url bar. Chrome knows it better and assumes that I want to search for toolname. A moment later it asked me if I meant toolname/ and remebers this choice (at least it annoys me only once per tool).

Yesterday I I got an idea and tryed a snippet of javascript as a search engine and was happy to see that it worked as intended. A few minutes of javascript hacking later the omnibar behaved the way I like it:

  • multiple words are a search query
  • single words are URLs, even without the trailing slash, always!
  • fix broken http at the start of an URL (happens to me sometimes when I cut’n'paste)

This is the current version of my default search engine, feel free to criticize, I’m a JS noob:
javascript:query="%s"; if (query.search(/\s/) != -1) { window.location="http://www.google.com/search?q=" + query; } else { query = query.replace(/^h?t?t?p?:///, ""); window.location="http://"+query; }

Enjoy and let me know if you have other ideas on how to improve this!


Wed
10
Feb '10
Buzz…
by Frank Spychalski filed under google, Work

This is mainly a test to see how adding this blog to my Buzz account works. Additionally I want to say how thrilled I am to finally buzz with people outside work ;-)


Wed
6
Jan '10
JRuby on appengine with Ubuntu
by Frank Spychalski filed under appengine, JRuby, Ruby

Overall the instructions on code.google.com are really good, so this is just a dump to remind me of the Ubuntu specific stuff I did on a pristine Ubuntu installation…


sudo apt-get install sun-java6-jdk
sudo apt-get install ruby-full rubygems

This installs only rubygems 1.3.1 but appengine needs 1.3.5.

ERROR: Error installing google-appengine:
bundler requires RubyGems version >= 1.3.5


sudo gem install rubygems-update
sudo /var/lib/gems/1.8/bin/update_rubygems
sudo gem install google-appengine

Et voilà! Ten minutes later I have a running hello world in the cloud ;-)


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.


Tue
4
Aug '09
Android scripting environment supports JRuby
by Frank Spychalski filed under android, Ruby

Quite some time has passed since the last time I wrote something on this blog, mostly because I did little non-work related worth mentioning.

But last week I helped Damon to finally support JRuby on his Android Scripting Environment (ASE).

  • Downloaded JRuby sources (jruby-1.2.0RC1) from http://www.jruby.org/download.
  • Patched the build.xml to not include doc/index.html from dynalang.jar otherwise dx will complain about an HTML page in the ruby-complete.jar.

    $ diff -r jruby-1.2.0RC1 jruby-1.2.0RC1.patched/
    Only in jruby-1.2.0RC1.patched/: build
    diff -r jruby-1.2.0RC1/build.xml jruby-1.2.0RC1.patched/build.xml
    42c42
    <
    ---
    >
    238c238,240
    <         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
    ---
    >         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar">
    >           <exclude name="**/doc/index.html"/>
    >         </zipfileset>
    268c270,272
    <         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
    ---
    >         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar">
    >           <exclude name="**/doc/index.html"/>
    >         </zipfileset>
    387c391,393
    <         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
    ---
    >         <zipfileset src="${build.lib.dir}/dynalang-0.3.jar">
    >           <exclude name="**/doc/index.html"/>
    >         </zipfileset>
  • Downloaded the JSON sources from http://rubyforge.org/frs/?group_id=953 and put them in lib/ruby/1.8/json/
  • Copied android.rb to lib/ruby/1.8/.
  • Built jar-complete (ant jar-complete) and added jruby-complete.jar to eclipse project.
  • Connected the bits and pieces in com.google.ase.interpreter.jruby

    But beware! The new ASE apk is HUGE (4.6M) and JRuby is fairly slow. But it works ;-)



Sun
22
Feb '09
Code reviews work
by Frank Spychalski filed under articles, comments, google

Seems like nowadays I only write blog posts in response to other blog articles… But I hope this is better than not writing at all. Ted Neward asks if code reviews do actually work because evidence suggests, that the scientific review process does not. Read the rest of this entry »


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.


Fri
25
Apr '08
Looking for an intern
by Frank Spychalski filed under google, Work

Asok the internI am looking for an intern (more details) for later this year. I have a number of interesting ideas for projects, most of them involve Ruby (more specific JRuby), Android and Eclipse. Your skill set should include at least Java and if possible Ruby and/or Eclipse API.

I’m looking for a commitment of at least three months (I would prefer six) and you should be within one or two years of receiving degree. If this sounds interesting please apply here and add a note that you would like to work with Frank Spychalski in Munich.