Dave here, tech geek among other things.

Small python script to rename iOS-graphics to fit in Android

Posted by: on Mar 6, 2016 | No Comments

Wrote a small little script when the designers only give me files that are made for iOS with the silly name ending such as @3x.png. According to the scaling guidelines in iOS and Android they should fit pretty nicely without demanding that the designer create new graphics (which they will most likely complain and not do). @3x goes into xxhdpi, @2x goes into xhdpi and @1x goes into mdpi.

Apparently code tags in WordPress doesn’t include spaces. So it’s available on GitHub gists here: https://gist.github.com/davols/3bd1c874a351dcb95308

Decompiling Android applications

Posted by: on Mar 5, 2015 | No Comments

It’s always great fun to reverse engineer something. Either if you have a goal or just want to have a look at what other people use.

I’ve previously used smali2java with rather good success, but only on smaller projects. And even then there’s a lot of parsing errors. So you end up losing entire (interesting) functions. Besides, it has to run through Wine on my desktop.

Recently came across some other tools that makes it even easier.

  • dex2jar
  • jd-gui
  • It’s remarkably easy and since I’ve used it it’s worked much better than smali2java. Even though it’s a two step process. The User Guide is extremely easy to follow.

    Android gradle on gitlab-ci with Sonar

    Posted by: on Sep 30, 2014 | No Comments

    Backstory
    Gradle has a bug where the plugin sonar-runner does not work properly. There is a fix in the nightly builds (2.1-rc1) which fixes this issue. However, the plugin android studio uses is way older than 2.1-rc1. And it’s not possible to use the newer gradle binary when building in android studio or outside.
    For version control I use gitlab and for continous integration testing I use gitlab-ci. Gitlab-ci uses runners that are decoupled from the server that hosts the code, which for security reasons is great.

    So this post is a guide in how to install a gitlab-ci runner with a sonar runner. Tested and working on Ubuntu 14.04.

    Sound on highlight weechat when beep.pl doesnt work

    Posted by: on Aug 10, 2014 | 2 Comments

    So I use weechat as my main IRC client. It’s awesome and looks lovely with solarized theme. Running on ubuntu 14.04 and using gnome-terminal there is a problem somewhere that beep.pl doesn’t work. It seems to be some problem in gnome-terminal since the terminal bell isn’t working. I’ve spent countless of hours trying to figure this out. In the end I just thought, to hell with it. Let’s hack beep.pl.
    So I looked around for sound files and found a not too long once that sounds pretty decent.

    Awesome WM – move window to another screen

    Posted by: on Aug 8, 2014 | No Comments

    I’m a big fan of awesome window manager on Ubuntu. Got my config on github. Just got my second monitor today and browsing the internet it took some time to find how to move a window to another screen. Be active on the window you want to move and then:
    modkey+o
    If that doesn’t work look into your rc.lua and see if you find anything mentioning movetoscreen

    Luxembourg away

    Posted by: on Jul 12, 2014 | No Comments

    IFK Göteborg vs CS Fola Esch in Luxembourg. Here are some pictures.

    uchiwa sensu android app mockups

    Posted by: on Jun 15, 2014 | 2 Comments

    Started using uchiwa and sensu for monitoring my servers. So been playing around with the help of Taylor Ling’s building blocks for kitkat to create some mockups for an app.

    Dashboard / Home

    NavigationDrawer

    Edit:

    Some more examples playing around with it.


    More cards!

    Ubuntu + Huawei E398 LTE modem

    Posted by: on Apr 16, 2014 | No Comments

    Since I moved to Norway the internet I’m able to get at home is pretty shitty. So I decided to order a modem from Ebay. I ordered an unlocked Huawei E398 from Lithuania that has all possible bands used by different providers here in Norway.

    However, it’s not plug and play for ubuntu. Even though it was stated from the seller. I tried loads and loads of different kinds of “solutions” (probably solutions to other peoples problem but not mine) online but they all failed. After a while I eventually found it.

    LSUSB showed it as 12d1:1505 but network-manager/modem-manager wouldn’t want to recognize it. So it had to change to 12d1:1506. This was a bit weird to fix. I had to create a file named 12d1:1505 in /etc/usb_modeswitch.d/ As you see below.


    $ cat /etc/usb_modeswitch.d/12d1\:1505
    DefaultVendor= 0x12d1
    DefaultProduct=0x1505

    MessageContent="55534243123456780000000000000011062000000100000000000000000000"

    And then you had to call usb_modeswitch (I needed root).

    usb_modeswitch -I -W -c /etc/usb_modeswitch.d/12d1\:1505

    Android app

    Posted by: on Dec 18, 2013 | No Comments

    Got the sending working yesterday so I spent some minutes to hack together a small android app in order to control my switches.

    Here’s a current sample on the json that the arduino outputs.
    [{"Name":"lampa","deviceId":"A","deviceChannel":1,"mStatus":255},{"Name":"hall","deviceId":"A","deviceChannel":2,"mStatus":255},{"Name":"pult","deviceId":"A","deviceChannel":3,"mStatus":255},{"Name":"bad","deviceId":"A","deviceChannel":4,"mStatus":0}]

    Most of the time was used trying to find a good lightbulb icon :(.

    Some Arduino goodness

    Posted by: on Dec 17, 2013 | No Comments

    Managed to get some progress on the code today. Able to switch on and off several Nexa devices through http. Next stop the android app!

    In the meantime I though I could list the stuff I’m using.

    Some One-wire temperature sensors too but they are not used at the moment.