Internet, this is Edoardo

cat /var/log/life

A Decentralised Tracker

Recently I received a wonderful gift, a Piratebox! Now I have my own Internet! With a forum, a chat and a file sharing server! So cool!

What is not cool is that my hardware is very limited and the platform is stable only when the custom part is kept at minimum.

Definitely the best part of the box is the shared file server, connect, upload/download and go, a single download can go as up as 1Mb/s (using scp) or 30Mb/s with wget but not everyone can use a terminal or have credentials to access the box, the easiest option is definitely the HTML interface.

Under the hood the piratebox is powered by lighttp, a very resource-light webserver that fits good in the great picture of the project but we are a little late with the updates. Piratebox ships whit v0.9 and lighttp is now at v1.4, maybe we can squeeze more from the hardware with asyncronous I/O or some modern witchcraft but that’s not the point.

Before diving into the development part of this article I would like to say a few word about Droopy. Droopy is the magic that runs the piratebox most loved feature, the file sharing. It provides a dead simple upload page that you can encapsulate inside an iframe and you can use python to make more magic happen during the upload process. What I don’t really like about this approach is that it’s good only if you have small files or you are really patient.

A better approach would be using a file-sharing protocol like bittorrent, the file is avaiable to the network, not uploaded to the piratebox storage and there is virtually no size limit to what you can share.

Enough with the tecno-blabbery, let’s run our PirateBay!

Everything has been made possible by the bnbt tracker project, I think it has been abandoned a long time ago (2006) but the docs is something good and I did most of the experimentation for you.

The package we are gonna install is cbtt and you can find it in the package list for the OpenWrt attitude adjustment release. We will also need the uclibcxx package, a C++ library on diet, required to run our tracker.

quick link to cbtt for tp-mr3020

quick link to uclibcxx for tp-mr3020

Move the packages to the piratebox either with scp or upload it to the shared folder.

As in every linux distro we have a package manager, opkg; here you can find more info about the usage.

1
2
3
# sobstitute the package filename to the generic name
root@piratebox:~# opkg install uclibcxx -d ext --cache=/mnt/usb/install/cache
root@piratebox:~# opkg install cbct -d ext --cache=/mnt/usb/install/cache

This commmand will install both the library and the tracker software on a extended-root partition we have “mounted” as ext, se opkg.conf file for more info.

Link this new executable in /bin and you will be ready to go on.

1
root@piratebox:~# ln -s /usr/local/usr/bin/bnbt /bin/bnbt

Go on and give it a try, start the server with the command bnbt, a lot of log lines will come out and you can see what happens.

1
2
3
4
5
6
7
8
9
10
11
12
13
[Sun Aug  9 11:10:56 2015] config warning - unable to open bnbt.cfg for reading
[Sun Aug  9 11:10:57 2015] server - listening on port 26213 ("port")
[Sun Aug  9 11:10:57 2015] warning - unable to open dstate.bnbt for reading
[Sun Aug  9 11:10:57 2015] warning - unable to open tags.bnbt for reading
[Sun Aug  9 11:10:57 2015] warning - unable to open users.bnbt for reading
[Sun Aug  9 11:10:57 2015] warning - unable to open clientbans.bnbt for reading
[Sun Aug  9 11:10:57 2015] Client Banlist parse called
[Sun Aug  9 11:10:57 2015] warning - unable to open bans.bnbt for reading
[Sun Aug  9 11:10:57 2015] IP Banlist parse called
[Sun Aug  9 11:10:57 2015] server - start
## Ctrl + c stop the process and kill the server
[Sun Aug  9 11:11:03 2015] server warning - select error (error 4)
[Sun Aug  9 11:11:04 2015] server - exit

Good news, it works! After you killed the server you will find some files around that it has generated for you.

1
2
3
4
5
6
root@piratebox:~# ls -al
drwxr-xr-x    3 root     root          1024 Aug  9 11:11 .
drwxr-xr-x    5 root     root          1024 Jan  1  1970 ..
-rw-r--r--    1 root     root          3616 Aug  9 11:10 bnbt.cfg
-rw-r--r--    1 root     root            36 Aug  9 11:11 dstate.bnbt
-rw-r--r--    1 root     root             2 Aug  9 11:11 tags.bnbt

You can open them and look around, bnbt.cfg is the configuration file, dstate.bnbt is the internal file to keep some stats as number of completed torrents and tags.bnbt is the internal file to keep track of the tags you can add to torrents.

But I don’t like it this way, these files are polluting my limited memory on the root filesystem and they can grow very large, let’s move them to somewhere else.

1
2
3
root@piratebox:~# cd /mnt/ext/etc/config/
root@piratebox:/mnt/ext/etc/config/# mkdir bnbt && cd bnbt
root@piratebox:/mnt/ext/etc/config/bnbt/# bnbt

This is definitely better. Let’s move on and let the tracker start at boot.

init files

I don’t know if this is the best way to handle this but I found that init files are the simplest option so I will go that way.

1
2
root@piratebox:~# cd /etc/init.d/
root@piratebox:/etc/init.d/# touch tracker

Init files are all alike, so I will just post mine, just copy and paste it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh /etc/rc.common
# description: run tracker server on startup
# the new galaxy most resilient tracker

NAME="torrent tracker"

# Start order
START=99
# Stop order
# STOP=

# move to config directory

cd /mnt/ext/etc/config/bnb

# Start the torrent tracker
start () {
  service_start /bin/bnbt &
  ## create a lock file
  ## touch /var/lock/subsys/bnbt
  ## success $"Tracker Server startup"
  ## echo
}

# Stop the torrent tracker
stop () {
  service_stop /bin/bnbt
}

Now the final touch, enable it. This will write a file, S99tracker to /etc/rc.d/.

To enable it

1
root@piratebox:~# /etc/init.d/tracker enable

Reboot the piratebox and wait until it is back online, go to http://piratebox.lan:26213/users.html, here you can create a user with every permission, it will be your administrator. Do me a favor and don’t call it admin, administrator or root and give it a decent password. The email is required but you can put anything in there, so be creative.

The next page you will see is the tracker’s index page, there you can see what your tracker is doing with the torrent network you set up.

There won’t be a lot of info but this is good, we prefer anoninmity and no logging.

configuring your tracker

You can find a lot of info on the official documentation of the bnbt project, so I won’t cover (now) what these config means, just copy and paste it to your config file (which is now /mnt/ext/etc/config/bnbt/bnbt.cfg).

I know working on the Piratebox is not that simple, so here it is the config file, upload it to the piratebox and mv it to the bnbt config folder.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
allowed_dir =
announce_interval = 60
bind =
bnbt_access_log_dir =
bnbt_access_log_file_pattern = %Y-%m-%d.log
bnbt_allow_comments = 0
bnbt_allow_info_link = 0
bnbt_allow_scrape = 1
bnbt_allow_scrape_global = 1
bnbt_allow_search = 0 
bnbt_allow_sort = 0
bnbt_allow_torrent_downloads = 0
bnbt_archive_dir =
bnbt_charset = iso-8859-1
bnbt_comment_length = 800
bnbt_comments_file =
bnbt_compression_level = 0
bnbt_count_unique_peers = 0
bnbt_debug = 0
bnbt_delete_invalid = 1
bnbt_delete_own_torrents = 1
bnbt_disable_html = 0
bnbt_dump_xml_file =
bnbt_dump_xml_interval = 600
bnbt_dump_xml_peers = 1
bnbt_error_log_dir =
bnbt_error_log_file_pattern = %Y-%m-%de.log
bnbt_external_torrent_dir =
bnbt_file_dir =
bnbt_file_expires = 180
bnbt_flush_interval = 100
bnbt_force_announce_on_download = 0
bnbt_force_announce_url =
bnbt_guest_access = 3
bnbt_max_conns = 64
bnbt_max_peers_display = 500
bnbt_max_recv_size = 128
bnbt_max_torrents = 0
bnbt_member_access = 79
bnbt_name_length = 32
bnbt_parse_on_upload = 1
bnbt_per_page = 100
bnbt_private_tracker_flag = 0
bnbt_realm = BNBT
bnbt_refresh_fast_cache_interval = 30
bnbt_refresh_static_interval = 10
bnbt_require_announce_key = 1
bnbt_robots_txt =
bnbt_rss_channel_copyright =
bnbt_rss_channel_description = BitTorrent RSS Feed for BNBT
bnbt_rss_channel_image_height = 0
bnbt_rss_channel_image_url =
bnbt_rss_channel_image_width = 0
bnbt_rss_channel_language = en-us
bnbt_rss_channel_link = http://localhost:26213/
bnbt_rss_channel_title = My BNBT RSS Feed
bnbt_rss_channel_ttl = 60
bnbt_rss_file =
bnbt_rss_file_mode = 0
bnbt_rss_interval = 30
bnbt_rss_limit = 25
bnbt_rss_online_dir =
bnbt_show_added = 0
bnbt_show_average_dl_rate = 0
bnbt_show_average_left = 0
bnbt_show_average_ul_rate = 0
bnbt_show_completed = 0
bnbt_show_file_comment = 0
bnbt_show_file_contents = 0
bnbt_show_gen_time = 1
bnbt_show_info_hash = 0
bnbt_show_left_as_progress = 0
bnbt_show_max_left = 0
bnbt_show_min_left = 0
bnbt_show_num_files = 0
bnbt_show_share_ratios = 0
bnbt_show_size = 0
bnbt_show_stats = 0
bnbt_show_transferred = 0
bnbt_show_uploader = 0
bnbt_static_footer =
bnbt_static_header =
bnbt_style_sheet =
bnbt_swap_torrent_link = 0
bnbt_tag_file = tags.bnbt
bnbt_tlink_bind =
bnbt_tlink_connect =
bnbt_tlink_password =
bnbt_tlink_port = 5204
bnbt_tlink_server = 0
bnbt_tracker_title = The Piratebox Bay
bnbt_upload_dir =
bnbt_use_announce_key = 1
bnbt_users_file = users.bnbt
bnbt_users_per_page = 50
cbtt_abuse_detection = 0
cbtt_abuse_hammer_limit = 10
cbtt_abuse_limit = 5
cbtt_ban_file = clientbans.bnbt
cbtt_ban_mode = 0
cbtt_blacklist_below_1024 = 0
cbtt_blacklist_common_p2p_ports = 0
cbtt_block_private_ip = 0
cbtt_dont_compress_torrents = 1
cbtt_download_link_image =
cbtt_ip_ban_mode = 0
cbtt_ipban_file = bans.bnbt
cbtt_page_number_count = 3
cbtt_require_compact = 0
cbtt_require_no_peer_id = 0
cbtt_restrict_overflow = 0
cbtt_restrict_overflow_limit = 1099511627776
cbtt_restricted_peer_spoofing = 0
cbtt_scrape_file =
cbtt_scrape_save_interval = 0
cbtt_service_name = BNBT Service
cbtt_stats_link_image =
dfile = dstate.bnbt
downloader_timeout_interval = 2700
favicon =
image_bar_fill =
image_bar_trans =
keep_dead = 0
max_give = 200
min_announce_interval = 1500
min_request_interval = 18000
mysql_cbtt_ttrader_support = 0
mysql_database = bnbt
mysql_host =
mysql_override_dstate = 0
mysql_password =
mysql_port = 0
mysql_refresh_allowed_interval = 0
mysql_refresh_stats_interval = 600
mysql_user =
only_local_override_ip = 0
parse_allowed_interval = 0
port = 26213
response_size = 50
save_dfile_interval = 300
show_names = 1
socket_timeout = 15

Now you only need a torrent to upload and we will see if the tracker is really working.

make a torrent

I will be only covering how to do this with a command line but google is your friend.

We will use mktorrent because it’s dead simple but it’s not avaiable on the current release of the piratebox custom OpenWrt so you have to use another pc.

1
edoput@edoput~: mktorrent path/to/my/file -a http://piratebox.lan:26213/announce

let it run and we are done, upload the torrent file to the piratebox, download it from the Shared file folder and open it with your torrent client of choiche. When prompted where to save the file choose the current file location on your pc and Enable local peer discovery to share your file with the local net.

Web seeds

Okay but if I already have a file on the piratebox and I want it to stay there how can this help me achieving a better download speed?

Intrducing Web Seeds, just use the option –web-seed with the file url like this.

1
edoput@edoput~: mktorrent path/to/my/file -a http://piratebox.lan:26213/announce -w http://piratebox.lan/Shared/myfile

Basically this will enable the piratebox to be a seed box, serving the files both on http and torrent.

Firefox in Enterprise

In may I have been asked about Firefox deployment in enterprise environment but I did not know much at the time. Time for a first draft of what I’ve discovered so far.

Firefox has two variants, Rapid Release and Extended Support Release aka RR and ESR, both for enterprise environment.

Rapid Release

Released every 6 weeks, just like Firefox for everyone but bugfixes are not backported to previous versions; make tests, fix your environment, move on. Here you can find the release calendar for RR

A softer approach is the Extended Support Release, just like a Ubuntu LTS edition.

Extended Support Release

Released every 42 weeks, follows the standard versioning so there is a jump of 7 Rapid Release between every ESR release.

Up to now we had the following versions: 10, 17, 24, 31 and 38.

Every ESR version has a support window of 54 weeks, an overlap of 12 weeks between the old and the new version gives you a lot of time to make changes and to be sure you can switch to a newer release without problems.

Sure, 12 weeks are a lot of time but you can get 6 more if you try the RR beta before the next ESR gets published, 18 weeks seems a lot better.

Again, ESR gets bugfixes for 54 weeks but after that it’s done, expect no more and switch to the newer version.

Download

RR download link

ESR download link

SMIL(E)

Inspired by CSS3 Animations in real life.

Working with web tech is mostly using a tool to get something done, animations are something that isn’t that simple to deal with but there are tools out there that can make your life simpler.

We can use CSS, DOM, sprites and? Obviously something no-one heard of, SVG animations in the browser!

Obviously we have an acronym SMIL, pronounced as smile, which is Synchronized Multimedia Integration Language.

Basically we can add a nested <animate> svg element within the one we want to animate, like this.

1
2
3
<myElement>
    <animate />
</myElement>

set what we want to animate

1
2
3
<myElement center="0">
    <animate attributeName="center" from="0" to="100" dur="5s" repeatCount="indefinite"/>
</myElement>

and now the center attribute will go from the value 0 to 100 in 5 seconds and cycle indefinitely.

Wow that was easy, time to level up

1
2
3
4
5
6
7
8
<myElement transform="rotation">
    <animateTransform
    type="rotate"
    from="0"
    to="360"
    dur="5s"
    repeatCount="indefinite"/>
</myElement>

this is a little tricky, we did not se the center of rotation so it is assumed to be (0,0) the top left corner, lets fix this.

1
2
3
4
5
6
7
8
<myElement transform="rotation" width="1024" height="1024">
    <animateTransform
    type="rotate"
    from="0 512 512"
    to="360 512 512"
    dur="5s"
    repeatCount="indefinite"/>
</myElement>

now the center of rotation is (512,512), the center of myElement.

And this is the effect we can get with SMIL, the example is forked from Edoardo Odorico’s one.

What is missing is the CSS animation and we could pack the three files into one.

These are the images with animation included

Zero Lag Backbone Views

It is not a secret that I have been playing Dungeon & Dragons with my friends for a long time and that I am passionate about it, I could roleplay more but we have a lot of fun.

I should not be wrong when I say that what is important in a game session is the ratio played time over total time, strategy meetings are ok but consulting manuals and other things should be kept out of the session.

One of the activities my Dungeon Master (Lorenzo) found to be time-sucking was planning the battle order: making a list of the warriors, getting everyone to throw a dice roll, throwing dice for the enemy, the NPC, order the list.

Pencils and paper could be replaced by a laptop but ordering a list is not that easy in a word processor, I do not know if other attempts have been made by Lorenzo but in the end we kept using pencils and papers.

And that is the main problem of today, to update elements in a list and order it when the update is done. Hmmm… if a character could be treated as a model and the company as a collection I would only need a view to display the information and a way to sort the list, I like this MV* approach so let’s see if something can be done with a SPA with Backbone.

Spoiler alert: this is not a working application written with Backbone.js, more or less is a guideline, what really matters is the problem of the view.

I definitely need a model for our heroes with names and values to order them

1
2
3
4
5
6
var Hero = Backbone.Model.extend({
    initialize: function (options) {
        this.name = options.name;
        this.value = options.value;
    }
});

and a collection to keep everyone toghether, with something that can compare model and order them.

We are reversing the order because it is default ascending. We could deal with this in the view, prepending model instead of appending but I would like to leave my view without any extra code.

1
2
3
4
5
6
var Team = Backbone.Collection.extend({
    model: Hero,
    comparator: function (model){
        return -parseInt(model.get('value'));
    }
});

Now we need a view,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var View = Backbone.View.extend({
    template: myTemplate,
    events: {
        'click #addHero': 'addPlayer',
        'click #sortTeam': 'sortHeroCollection'
    },
    initialize: function () {
        this.listenTo(this.collection, 'add', this.render);
    },
    render: function () {
        this.$el.empty();
        this.$el.html(this.template(
            this.collection.toJSON()
        ))
    },
    addPlayer: ...
    sortHeroCollection: ...
})

Ok this is not that performant or anything else, in my real work I used nested views so this will not definitely work as before.

What is important is the template I am using

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!-- this is the hero template -->
<p>
    <!-- name -->
    <span contenteditable="true" title="nome" class="nome">${nome}</span>
    <span>
        <!-- initiative -->
        <span contenteditable="true" class="single-line" title="iniziativa"> ${iniziativa} </span>
        <!-- health -->
        <span contenteditable="true" class="single-line" title="salute"> ${salute} </span>
        <!-- AC -->
        <span contenteditable="true" class="single-line" title="armatura"> ${armatura} </span>
        <!-- listen -->
        <span contenteditable="true" class="single-line" title="ascoltare"> ${ascoltare} </span>
        <!-- spot -->
        <span contenteditable="true" class="single-line" title="osservare"> ${osservare} </span>
    </span>
    <button class="fa remove fa-remove" title="rimuovi"></button>
</p>

the property contenteditable=true of the span element make it so that I don’t have to update my view when values are updated because the content of the page has already been edited, all I need is an additional event handler attached to my view.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var View = Backbone.View.extend({
    template: myTemplate,
    events: {
        'click #addHero': 'addPlayer',
        'click #sortTeam': 'sortHeroCollection',
        'input': 'update'
    },
    initialize: function () {
        this.listenTo(this.collection, 'add', this.render);
    },
    render: function () {
        this.$el.empty();
        this.$el.html(this.template(
            this.collection.toJSON()
        ))
    },
    addPlayer: ...
    sortHeroCollection: ...
    // you have to find a way to reference models from the view, hence subviews
    update: function (e) {
        this.model.save(
            takeWhatIsUpdated(e),
            {
                patch: true
            }
        )
    }
})

In the same event handler I could wait for validation from the model and the server and update the view to display errors if needed.

I think this is a good trick that we can use, it’s an enhancement both in performance (less views updates) and user experience (less view updates), the only drawback is compatibility and telling the user that even if there is no input field on the page they can submit their changes to the application but a big (dismissable) banner on the top of the page should work.

Mozilla in Rimini

First post ever of my Mozillians experience as guest speaker, this time for Firefox OS developing experience and tools in Rimini 16th of May 2015.

Like I said this was the first time I have been able to discuss face to face with an interested audience about this topic and I’ve put a lot of effort covering the material and providing an interesting approach to the topic with a presentation (in html5, obviously ;) ).

The host was the Rimini LUG, whose president, Roberto, got in touch with the community after the event in Bologna last year. Roberto is a keen fan of Firefox OS and ditched his smartphone to get a Flame last year (way to go!).

Roberto got everything sorted out from the hotel to the venue and the dinner, a big thanks from Florence, I’ll surely came back if invited :) .

Before the talks we chit chatted with the members of the LUG, many of them wanted to ask questions about the quick guide and the absence of the developer tools from the guide.

Some question were about managing the use of Firefox in enterprise/academic solution and the best resource we coul point those users to was the page on the MDN documentation.

A tought question was “How can I install Firefox OS on my phone?” we couldn’t give an exaoustive answer because we are not familiar with the process of coocking custom rom from source for a generic device but we provided links to the documentation on MDN or XDA.

The talks

Beginning in the early afternoon the event consisted of four talks, three held by Daniele Scasciafratte and one by me. The first three covered the “What is Mozilla”, “The Mozilla manifesto” and “Programming OpenWeb App” topic of the event; the presentation were solid (materials refined in the years) and the audience showed interest and asked question like “In what Mozilla differs from the FSF?”, “What does a Mozillian?”, “Is there a italian community?”, “How can I flash Firefox OS on my phone?”, “Is there Whatsapp for Firefox OS?”.

During Daniele’s talks I was able to provide informations and manage hands-on test of the devices with Firefox OS that we had at the moment. We had a Flame, a Keon, a Fire E and a Flatfish to show-off with various versions of Firefox OS ranging from 1.1 to 3.0 .

Then it was my turn, my first target was to give a quick answer to a question “Do we really need another mobile OS?”.

The answer lies in the question “Who owns the Internet? And who owns the Android project/iOS project?”. Obviously the answer is that no-one owns the internet, instead Android and iOS are commercial project just like the Sailfish OS or Tizen.

The real purpose of the Firefox OS project is to provide a real community driven mobile OS to the one who needs it, the users.

Then the talk shifted to the effort of the italian community, I talked mostly about the Firefox OS quick guide which we have translated, updated and re-published to ease the transition and the overhead required to get started with developmente on Firefox OS (yeah, dog-fooding).

But what is needed to develop an OpenWeb App?

I introduced the standard tools (HTML, JS and CSS) for web dev, their purpose in web programming and their benefits. Multiplatform and multidevices standards, ease of distributions were the ones I mostly talked of.

But in order to develop OpenWeb Apps you need more than just the standard tools, you need to glue together the device and the web and the only (super)glue we could use is the browser.

The browser can expose device functionalities to the web with the use of the WebAPIs, this is a central topic in the Firefox OS development but I could not cover every API so the introduction featured a wide and generic approach, not a deep and technical one, which maybe should suits better an event like an hackathlon.

But you can’t go out there alone, with just those standard tools, take theese, the Firefox Developer Edition browser and the WebIDE, your toolbelt new best tools. A quick introduction about these new tools and we were ready for the last topic, the use of Firefox Developers Tool.

The last topics that I wanted to talk about were the Firefox Developer Tools, mostly the CSS editor and the JS debugger but I managed to provide a brief overview of every standard tool.

There were many questions about development, pricing, logic obfuscation and the differences between building an app with NodeJS and an app with an embedded server and most of the audience was satisfied with the answer we could give.

We are still waiting for some feedback (first time using a feedback module) but everyone complimented us for the talks and no one left with unanswered questions.

The end

After 3 hours and a half of talks and Q&A we could have used some help, maybe a shower, but Roberto already planned to fill our body with a delicious dinner in the countryside with all the associates and families of the Rimini LUG, probably the best idea of the day.

Last but not least I got a membership card of the Rimini LUG as a gift, hooray for me!

Flickr album by Daniele

My crappy pictures

My slides

Password Reuse

Today using the same username and password over and over it’s definitely the quick way to weaken your security online; too bad that it’s nearly impossible to keep track of every password and it’s reuse rate in a standard browser, although this is an addressed problem.

I made a very simple addon, just a proof of concept of what the functionality should be. Enter your user and password combination and it will pop your statistics about that combination reuse.

Here’s the repo if you know how to build addons from source or do you want to contribute, I will post the link to the addon page on addons.mozilla.org as soon as it will be approved by Mozilla.

Android and Adb, a No Permissions Story

Many of us have seen this message printed on the terminal, heads have been scratched, Google interrogated, sudo has been used.

It seems that developing something for the Android platform is something that begins with the problem of communicating with your devices and end in “$?!# MY LIFE! $?!# USB AND ANDROID!”.

My pc struggled communicating with my Nexus 4 in the last month, after transitioning from 32-bit to 64-bit, I couldn’t push or debug anything and it stopped my work with Android (I wanted to switch from ListView to ReciclerView in my apps) but I couldn’t get any work done, Android Studio refused to talk to my device.

Today I found that if I enable mass storage on my phone everything turns out to work pretty nice with my current system configs.

So if you are on a search, desperate and furious because your Android phone is not listening to you take this wild guess and enable mass storage.

EURION Constellation

When the printer consumer market got flooded by an invasion of sharper, faster, cheaper machines a question bubbled in the mind of many: ‘Can I print money with that?’.

To prevent copy and image manipulation of currency is a real nasty problem, counterfeit money is more than ever unrecognisable from real money. Not longer than a month ago I saw and touched six 20 euro banknotes and I could’t feel the difference from real money, the only deficency was the missing stripe in the middle of that piece of paper.

That’s why we have to introduce new designs and form factors in the newer batches, because the bad guys are catching up with the technology and the supply chain. Keeping things movin' is a way to zeros their knowledge and know how.

But how can you prevent software manipulation of images containg currency? It appears that this problem has already been addressed.

I present you the EURion constellation, a pattern you can find on your banknotes that can be recognised by machines like your scanner.

When this pattern is found in the image the scanner could also refuse to scan your document, making it a good choice to use it as a watermark to prevent copy and distribution of confidential material.

Image courtesy of Florian Heise, Druckerchannel.de. Licensed under Public Domain via Wikimedia Commons.

This image shows that under blue/black light the pattern glow making it visible.

Other techniques similar to the previous includes the printer steganography, a way to include informations into a piece of paper at printing time.

Edit 03-04-2015: I found an article about the topic of photoshopping money, it’s on hyperallergic.com

Recording With Kazam on Gnome Shell

I always wanted to try and record a screencast but I always ended up arguing with the tools because I couldn’t get it worked.

Today I found the solution to my problem: Kazam’s icon would disappear when recording therefore I couldn’t stop or pause anything.

It turns out that Gnome Shell hide icons from the tray without asking so the quick solution is to install this extension that prevent this behavior.

Now the camera icon indicating that Kazam is recording won’t disappear.