CV Göran Engdahl

CV finns att hämta nedan.

Posted in Uncategorized | Leave a comment

Sånghäfte för kräftskivan

Här kan du ladda ner sånghäftet för kräftskivan.


Posted in Uncategorized | Leave a comment

Loppiskassan v1.2

Loppiskassan har blivit uppdaterad och stödjer nu redovisning av olika betalningsmetoder. De två betalningsmetoder som stöds är [Kontant, Swish].

Funktionen är densamma som tidigare version men gränssnittet är något ändrat.
Continue reading

Posted in java | Leave a comment

Välkommen till världen

Grattis till barnet, kul att det blev en Vidar 🙂

Bildresultat för vidar

Posted in Uncategorized | Leave a comment


Vad är loppiskassan?

Loppiskassan är ett litet program som hjälper till med kassahantering och redovisning för inlämningsloppisar.

En inlämningsloppis är ett smart sätt att locka kunder till en stor loppis där flera säljare samsas om lokal och delar på kostnader.

Som säljare lämnar man in sina varor innan loppisen öppnar, och hämtar pengar och eventuella osålda varor när loppisen är över.

Continue reading

Posted in Uncategorized | Leave a comment

Vacker hund


Teddy heter denna vovve!

Posted in Uncategorized | Leave a comment

Some aliases I use

In my daily work I often find myself doing repetitive tasks, some simple others more advanced.

Here are some of my favorite aliases I use for some of the simple tasks.

#Listing my IP addresses in a format so that I can easily copy the IP address I need.

ips='/sbin/ifconfig | grep "Link encap" -A1 | sed "s/.*inet addr://" | sed "s/ .*//"'

#Listing targets in an ant build.xml

catb='cat build.xml | grep -e".*target name.*"'

#finding java files (often used in conjunction with grep to look in files)

findjava='find . -type f | grep -e".*\.java$"'

#finding log files

findlogs='export log=$$;find . -type f | grep -e".*\.log$" >/tmp/$log ; find . -type f | grep -e".*\.log\.[0-9]*$" >>/tmp/$log ; cat /tmp/$log | sort '

#Grepping in history (eg 'hgrep scp')

hgrep='history | grep -v hgrep | grep '

Posted in Uncategorized | Tagged | Leave a comment

Wrap SharedPreferences in an enum for easy access

Sometimes you need to share a couple of global preferences in your android application and one option is to use the SharedPreferences to accomplish this;

    //get the preferences

    SharedPreferences prefs = myActivity().getSharedPreferences(“ConfigurationStore”, Context.MODE_PRIVATE);

    //store a value

    prefs.edit().putString(“user”, “Teddy”).commit();

    //get the value

    prefs.getString(“user”, null); 

I like my code simple so I wrote a very simple wrapper to hide the above, here is the result.

    public enum ConfigurationStore {
      private String key;
      private SharedPreferences prefs = //get this from your activity class
      ConfigurationStore(String key){
        this.key = key;
      public String get(){
        return prefs.getString(key, null);
      public void set(String value){
        prefs.edit().putString(key, value).commit();


The usage of the wrapper is shown below

    //Set a value:
    //get a value

It’s easy to extend with new properties just by adding to the enum:

    public enum ConfigurationStore {
    //Set a value:
    //get a value

Note that this is strictly using Strings. Ideas how to extend this to support other primitives in a type safe way are most welcome!

Posted in Uncategorized | Tagged , , | Leave a comment

Set proxy if @work

I got tired of manually setting http_proxy & ftp_proxy on my job computer that I sometimes use at work (proxy needed) or at home (no proxy needed) so I came up with this dirty, but workable pice of bash script.

The ip x.x.x.x in the script below is the office IP (assigned by DHCP, but always resolved to static IP address based on my MAC)

#Set proxy if in office
ip=$(/sbin/ifconfig eth0 | grep -e".*inet addr.*" | sed -e "s/.*inet addr://g" | sed -e"s/ .*//g")
if [ $ip = "x.x.x.x" ]
  export http_proxy
  export ftp_proxy

The above is part of a bigger script ( that set other stuff as well, and this script is called from my bash profile (~/.bashrc) so every time I create a bash shell I get this set.

Posted in bash, shell | Leave a comment

ISP connection monitoring

I have had some issues with my internet connection lately so I made some scripts to monitor it from my NAS.

First, let’s look at my network topology to understand what we want to test. I have my NAS attached via LAN to my modem with built in router, in other words we will only check LAN connectivity (not WLAN) to Internet.

The scripts I wrote will first see if router is reachable, and if it isn’t ping test is aborted (no point testing ISP connection if we can’t get to the modem). If router is reachable we will in parallel try to ping a set of hosts. Let’s look at the script first:

SUCCESS=$(ping -c $count $host | tail -2 | head -1 | grep -c -e".* 0% packet loss.*")
  if [ "${SUCCESS}" -lt 1 ];then
    echo "${host} is dead at $(date)"

The script above will ping a host a number of times, and return an error string if there is packet loss. Example: 1 will send one ping message to Now to the main script,

hosts="bbb-router isp-gateway"
routerdead=$("${pinghostcommand}" bbb-router 1)
if [ "X" = "X${routerdead}" ]; then
  for host in $hosts
      $("${pinghostcommand}" $host $COUNT > "/tmp/$host") &

sleep 11
for host in $hosts
    cat /tmp/$host | grep dead >> /samba-share/stats/pingStats.txt
    rm /tmp/$host

With the above script set in crontab

# m h dom mon dow command
0,10,20,30,40,50 * * * * /samba-share/scripts/

I can check the ping stats log file to see if my sampling indicates packet loss to what hosts and at what time.

cat  /samba-share/stats/pingStats.txt | tail -n 10 is dead at Wed Sep 19 21:30:07 CEST 2012 is dead at Wed Sep 19 21:30:07 CEST 2012 is dead at Wed Sep 26 04:50:11 CEST 2012 is dead at Wed Sep 26 05:10:12 CEST 2012 is dead at Sat Sep 29 08:00:12 CEST 2012 is dead at Sat Sep 29 08:00:12 CEST 2012 is dead at Sat Sep 29 19:20:12 CEST 2012 is dead at Wed Oct 3 15:50:12 CEST 2012 is dead at Mon Oct 8 19:00:11 CEST 2012 is dead at Tue Oct 9 21:20:11 CEST 2012

Posted in sh, shell | Leave a comment