Jackson replace field with a Custom Serializer

  • Posted on: 12 September 2017
  • By: robin
private class CustomValueSerializer extends StdSerializer<WebTemplateResource> {
   private final String url;

   public CustomValueSerializer(String url) {
      super(WebTemplateResource.class);
      this.url = url;
   }

   @Override
   public void serialize(WebTemplateResource res, JsonGenerator jgen, SerializerProvider serializerProvider) throws IOException {

      jgen.writeStartObject();
      Field[] fields = res.getClass().getDeclaredFields();
      jgen.writeObjectField("htmlUrl", url);

      for (Field field : fields) {
         try {

NetCat on Android - Send files from your phone to your computer with NetCatdroid

  • Posted on: 21 February 2017
  • By: robin

Strangely, it is still fairly complicated to transfer data from the smartphone to the computer. There are cloud solutions and bluetooth but thats still complicated or slow. But my friend and ex-colleague and me just release a first version of NetCatdroid. NetCatdroid is a netcat client for Android which allows you to transfer multiple files to your computer via netcat. Especially Linux and Mac user will love it, because nc is preinstalled on most systems. 

HowTo: Get notifications for ssh login attempts

  • Posted on: 30 January 2017
  • By: robin

Recently one of my accounts was hijacked. I was hacked. For the first time in my life. The first thing I did was changing all passwords and keys. But still I felt not save enough. For external accounts I can not do much but for my remotely acceptable computer I could (e.g. Allow Only public-key auth). One thing I came up with is Android Notifications (or email, sms, etc.) when a ssh session is created.

Mass assembly line for Raspberry Pis

  • Posted on: 18 January 2017
  • By: robin

In early 2016, we created a indoor positioning prototype for tracking stuff in a retail market. The Devices, that we used for it, were - of course - Raspberry Pis. But we needed about 100 of them. Here you can see, how we assembled them recorded in time lapse. 

Round 1: Called the Raspberry Pi Challenge: Were each colleague was assembling a Raspberry Pi as fast as possible. We took the time and tried to beat each other. 

 

Most useful code snippets for Raspberry Pi

  • Posted on: 17 January 2017
  • By: robin

I am using Raspberry Pi's since the first generation and I use them a lot. Over the time I collected a few snippets that I find really useful and want to same them with you.

 

Turn off display programmatically

I've got a Magic Mirror and by default its screen would be always on. Thats not necessary. It should be on when I am looking at it. So I added a PIR Sensor for motion detection and let it trigger the following python lines:

Erste Schritte mit dem Alexa Skills Kit (Anleitung) - Echo & Dot

  • Posted on: 24 November 2016
  • By: robin
Neue Skills für amazon Alexa Echo Dot

Seit dem Film Space Odyssey (Odyssee im Weltraum) und dem HAL9000 sind wohl viele von uns begeistert von dem Gedanken eine Unterhaltung mit einem Computer zu führen, ihm Fragen zu stellen und Informationen zu bekommen. Genau diese Voice Services sind zur Zeit auf dem Vormarsch. Amazon's Alexa, Google Home, ivee oder Cubic. 

Dies öffnet eine ganz neue Welt für Entwickler. In diesem Tutorial möchte ich euch anhand eines einfachen Beispiels die Entwicklung eines neuen Skills für Alexa beibringen.

Raspberry Pi USB Festplatte automatisch einbinden

  • Posted on: 17 November 2016
  • By: robin
Raspberry Pi mit externer Festplatte

Nun ist es an der Zeit den Raspberry PI mit externen Dateträgern zu verbinden - sei es über LAN oder eben per USB. Besonders wegen des geringen Stromverbrauchs (~ 2 W) ist das eine klasse Sache. So kann man den Raspberry auch gerne mal im Dauerbetrieb laufen lassen - ohne viel Energie zu verbrauchen. Fangen wir also an und schliessen unsere Festplatte per USB an den Raspberry Pi. Am Besten sind USB Festplatten mit externer Stromversorgung.

DIY Smart Door für 5 Euro (Android App - Part 3)

  • Posted on: 2 November 2016
  • By: robin

Die App hat genau 2 Aufgaben: Sie soll es ermöglichen die Tür aus der Ferne zu öffnen und uns über Klingel Events per Notification informieren. Das ist nicht viel Programmieraufwand, aber trotzdem interessant. Zum realisierung wird nämlich Firebase verwendet und die unter euch die Firebase für eine Android App noch nicht verwendet haben werden heute etwas lernen.

Die App:

Pages