Posts

Raspberry Pi - enabling ipv6

Enabling IPv6 on Raspberry Pi is quite trivial. Just invoke: root@raspberrypi:~# echo "ipv6" >> /etc/modules then just reboot your Raspberry Pi root@raspberrypi:~# reboot

Raspberry Pi

Image
I recently found one piece of this in my garage. Bought two years ago to play with it, but never really had time to do this. As I needed to create tor anonymity box (for running unrestricted WiFi hotspot in my area), I decided to do this on Raspberry Pi (my Linksys WRT54gs has 32MB of RAM which is not enough to run tor software). The very first problem was to configure Debian (called Raspian, which is really Debian ARM Wheezy) on it. I did not wanted connecting this through HDMI, so decided to use serial cable. All you need is to listen with putty on serial port (baudrate of 115200): Than just connect your Raspberry Pi to RS232-TTL 3.3V: And finally turn power of Raspberry Pi: Now, just login using user pi and password raspberry . It is recommended to issue  sudo raspi-config after first login to set up various parameters,

USB to RS232 TTL

Image
In my opinion the best USB to serial converter is FT232R. Windows Drivers are available there:  http://www.ftdichip.com/Drivers/VCP.htm  I've bought the following device for 10 bucks on popular Internet auction. Some nice features of that converter are: TTL 3.3V and 5 V RTS and CTS on golpins other signal lines (DTR, DSR, RI plus additional I/O lines) on standard raster holes on top and bottom of the converter board, you can solder goldpins for breadboard. The most simple test can be done by shortening TXD with RXD with simple jumper and using Putty to see if USB converter will do echo of what we are typing.

Ansible on minimalistic Debian

Let's assume we have really minimalist Debian distribution, something like on Raspberry Pi. And we want to use Ansible on that box. The official Ansible documentation do not cover in details installing it on really minimalist distro and using the official documentation would mess up Python libraries, as it suggest to use pip to install libraries that are already packaged as *.dpk (you know Debian packages all in "debian way"...). So the correct sequence is as follow: apt-get update apt-get upgrade apt-get install aptitude aptitude install apt-utils  (Necessary to correctly handle Python *.dpk with Python libraries) aptitude install python-httplib2 aptitude install python-jinja2 aptitude install python-yaml aptitude install python-paramiko aptitude install git aptitude install sshpass At this point we shall have all dependencies necessary to run Ansible installed. The official Ansible docs recommend the pip install paramiko PyYAML jinja2 httplib2 what will...

Signing release APK in Android Studio Gradle project

When you try to release your app, using Android Studio, you are pointed to that info: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Signing-Configurations Despite being correct, it is not accurate and it will take few moments to realize how to configure the signing in the correct way: android { compileSdkVersion 18 buildToolsVersion "17.0.0" defaultConfig { minSdkVersion 7 targetSdkVersion 16 } signingConfigs { release { storeFile file("../android.keystore") storePassword System.console().readLine("\n\$ Enter keystore password: ") keyAlias "edziecko" keyPassword System.console().readLine("\n\$ Enter key password: ") } buildTypes { release { signingConfig signingConfigs.release } } } }

Java, Maven, GAE, Spring and Vaadin all together - part one

In this chapter I will cover how to develop single-paged web applications using the techniques mentioned in title. Source code is available there:  https://github.com/bartprokop/bart-gae-poc/tree/version1 . Working application is available here . Problem: putting all pieces together. Vaadin is great tool for developing Web based business application. It uses GWT for rendering the server side kept UI structures. So basically the whole application - both UI and backend runs on the server, while browser merely renders it. One of the properties of Vaadin application is that UI state is always serialized and kept inside http session. This feature has it's cons and pros. If you correctly persist session, you can run application on a cluster and the app will survive the restart or outage of single node. But everything what is references by any GUI elements must implement java.io.Serializable. As such is necessary to ensure that by accident we will not serialize whole object graph to h...

GAE BigTable datatypes and Vaadin Form Properties

As we already discussed, Vaadin provides easy way to edit JAVA POJO object using its com.vaadin.data.util.BeanItem  representation, that can be used in Vaadin forms, just out of the box. However we cannot expect that our Java POJO's will have only fields of Strings and some primitives/their wrappers. App Engine Datastore itself provides rich set of basic types - see here for complete reference. As we already show, it was very easy to use Vaadin to bind POJO fields (through Vaadin properties) to UI form elements. It worked great for Strings and primitives/their wrappers, but it will not work for other BigTable data types. The reason for that is that Vaadin does not know how to handle such classes as  com.google.appengine.api.datastore.Email , com.google.appengine.api.datastore.Category  or com.google.appengine.api.datastore.GeoPt . However if we look closer into it, we can assume that those types can be quite well represented by java.lang.String with very straightf...