2016-02-29

Deploying a Slack bot on Heroku

Have you ever wished that you could get IRC, but with an enterprise pricing plan and fancy proprietary desktop and mobile clients? Then Slack is for you!

All jokes aside, the free version of Slack works well enough if you have a small group of people and just want to get some basic group chat features without having to mess around too much. Plus, the mobile clients are leaps and bounds ahead of any mobile IRC clients I’ve tried.

Sometimes you run out of interesting things to talk about, but you still want the chat to feel alive (especially during AU TZ…). Since an image is worth a thousand words, what could be better in a chat room than a bot that posts images?

All that is needed is to come up with a word or two, and the bot will reward the channel with a relevant image.

2016-01-03

Highlights from 32C3

The 32nd Chaos Communication Congress (32C3) in Hamburg has concluded, after four great days filled with hacking, beer and currywurst. The talks covered topics as diverse as software security, quantum cryptography, privacy, space exploration and much more.

Recordings in a variety of formats from all talks can be found here, or mirrored on YouTube.

Below are just a few of the talks that I found interesting, together with some comments and additional links and resources.

2015-12-19

Bloggin' 2: Electric Boogaloo

I decided to attempt to resurrect my old blog, and at the same time try out Hugo, a static site generator written in Go.

I previously used Pelican, which is quite similar feature-wise but written in Python. The differences in functionality aren’t massive, with Pelican having the upper hand so far (as well as a larger community). However, Hugo is a lot faster, and it’s also nice not having to mess around with Python dependencies (especially on Windows). Applications written in Go can instead be built into statically linked binaries for Linux, Windows and OS X. This means that Hugo comes as a single (well, per platform) executable without external dependencies. Even though I mainly work on Linux, I really like this portability. It’s even possible to cross-compile for Windows from a Linux system, and it works out-of-the-box!

Besides switching to a new static site generator, I have revamped and streamlined my workflow. I used to manually build and upload the site to my web host, but now most of that is automated. I’m still hosting the code and configuration on Bitbucket, but I’m now using Wercker for continuous builds and deployment, and Amazon S3 for hosting. I might do a write-up on this eventually, but the gist of it is that whenever I push to my Git repository, Wercker will build the site using Hugo and then automatically deploy it to Amazon S3. It takes less than a minute from git push until the changes are visible online.

I’m also in the process of migrating (at least some of) the old content from Pelican. It will probably be a while before everything is settled down, and old posts will keep showing up as I have time to move them over. It also means that the rss feed will look a bit strange until then, if you’re into feeds and stuff like that.

2012-10-15

Netflix on the ODROID-X

So it turns out that the ODROID-X makes for a pretty good little Netflix box, with the Android app installed on one of the standard images provided by Hardkernel. The user interface is easier to control and significantly more responsive than some alternatives I’ve tried, like the WD TV Live.

2012-01-14

Arch Linux on the BeagleBone

The BeagleBone is a low-cost (only $89!) ARM development board equipped with a Sitara AM3358 Cortex-A8 from Texas Instruments. It has on-board ethernet, a mircoSD-card slot, USB (both host and serial/JTAG), as well as expansion headers with lots of I/Os to play around with. I got mine a couple of weeks ago, but haven’t had the time to do anything really interesting with it yet. I did however install Arch Linux just for fun, and while the process was fairly straight-forward I have documented it here in case anyone wants to try it out.

2011-07-13

Android x86 Emulator and NDK

The recently released Android SDK Tools r12 added x86 and ARMv7 support to the emulator and AVD manager. However, the system images included with the SDK are still ARMv5 only, resulting in the AVD manager running in legacy mode with the ABI drop-down box disabled. This post will show you how to build new images from scratch.

2011-05-18

Android Development Tools 11

Update: Get the official release candidate build of ADT 11 if you’re feeling lazy.

The Android Development Tools session at Google I/O introduced several new fancy features in the ADT, and you can build the development tools yourself to keep up with the latest changes between releases.

The following is more or less a condensed version of the official instructions for building the SDK and the Eclipse plugins, with some minor changes.

2011-05-16

Mandroid - Man pages on Android

Mandroid is a manual page application for Android. Search and view manual pages for system calls and commands from your favorite Linux or Unix operating system.

Source code available at https://github.com/pakesson/mandroid.

I haven’t spent more than 5-6 hours on this application, so I’m sure a lot of things can be improved. You’ll need to generate the manpages.db SQLite database manually (see man2db.py for an example).

2011-05-16

ParallelDroid

The video is showing Android running natively in a window on my desktop system. Source code for the patches and utilities I’m using is available at https://github.com/pakesson/ParallelDroid.

The basic idea of ParallelDroid is that the Android UI is rendered to a virtual framebuffer, which is then displayed in a GTK application written in C. Keyboard and touchscreen input is handled by a custom input driver, and you’ll need to blacklist your physical input devices in Android to avoid confusion when other windows have focus (see android/system/etc/excluded-input-devices.xml for an example).

You’ll need a kernel with the Android patches (binder, ashmem, logger etc.), as well as the modifications from /kernel in the ParallelDroid repository. The easiest way to accomplish this is to start with the common Android kernel tree (http://android.git.kernel.org/?p=kernel/common.git;a=summary). A working Android root file system can be built using AOSP or Android-x86.

When the patched kernel is running (you might want to load the virtual framebuffer module manually to avoid conflicts with other video drivers on boot), you can chroot into the root file system and run /init to start Android. After a few seconds, you should see the UI loading in the gtk-ui application.

I recommend that you use a virtual machine if you want to try this on your own. Don’t expect anything to work, and don’t blame me if your computer explodes.

2009-09-01

Distributed mobile computer vision and applications on the Android platform

Master’s thesis

by Sebastian Olsson and Philip Åkesson.

Abstract

This thesis describes the theory and implementation of both local and distributed systems for object recognition on the mobile Android platform. It further describes the possibilities and limitations of computer vision applications on modern mobile devices. Depending on the application, some or all of the computations may be outsourced to a server to improve performance.

The object recognition methods used are based on local features. These features are extracted and matched against a known set of features in the mobile device or on the server depending on the implementation. In the thesis we describe local features using the popular SIFT and SURF algorithms. The matching is done using both simple exhaustive search and more advanced algorithms such as kd-tree best-bin-first search. To improve the quality of the matches in regards to false positives we have used different RANSAC type iterative methods.

We describe two implementations of applications for single- and multi-object recognition, and a third, heavily optimized, SURF implementation to achieve near real-time tracking on the client.

The implementations are focused on the Java language and special considerations have been taken to accommodate this. This choice of platform reflects the general direction of the mobile industry, where an increasing amount of application development is done in high-level languages such as Java. We also investigate the use of native programming languages such as C/C++ on the same platform.

Finally, we present some possible extensions of our implementations as future work. These extensions specifically take advantage of the hardware and abilities of modern mobile devices, including orientation sensors and cameras.

Download as PDF

Demo

Below is a clip of one of our proof-of-concept applications, Bartendroid, which gives drink suggestions based on the bottles found in a photo. The server performing the recognition and matching is running on Amazon Elastic Compute Cloud (EC2) for scalable distributed processing.