14.04.2009 15:25

GPRS on GNU/Linux

I still use GPRS often as WiFi coverage is not always good in the suburbs around my city. I have a basic SonyEricsson mobile phone that doubles as a GPRS modem for my laptop. I wrote about the quality service T-Com provides and GPRS is no exception; I pay 3$ per 10MB of traffic. Using Opera Mini on your phone maybe you could stretch that trough the month but otherwise it's the amount of traffic I generate in an hour of browsing and reading e-mail... so what could I do to save bandwidth?

First let's cover the basics. Once you connect your phone with an USB cable besides standard USB core modules you will also need cdc-acm and ppp-generic modules. For a PPP dialer you can use wvdial or KPPP (provided by KDE). I use wvdial which is set up like this:

; wvdial configuration
;   /etc/wvdial.conf
;
; T-Com Web'n'Walk
[Dialer wnw]
baud = 115200
Modem = /dev/ttyACM0
Dial Command = ATD
Carrier Check = no
Init = at+cgdcont=1,"IP","web.htgprs"
Phone = *99***1#
Username = none
Password = none
You can initiate a connection with:
# wvdial wnw
Once connected I could barely open a few pages (not to mention that the general connection speed is pathetic) so I started thinking about saving bandwidth. The first thing I setup was SSH as a SOCKS proxy, with compression enabled. Further I considered adding a HTTP caching proxy to my home router such as Privoxy which has great filtering capabilities, so I could strip not only ads but maybe even all images and further modify and twist the traffic... I can't be the first person thinking about these issues yet all web searches came up empty. Or, they did until I found the Toonel service this winter. Their client routes all your traffic trough their servers while compressing it, and additionally they run a caching proxy. Their client is cross-platform and it works for a number of protocols, seems to be exactly the solution I was thinking of...

But I passed because I imagine they don't encrypt the traffic and SSH as a SOCKS proxy proved to be a good enough solution. Once wvdial is connected I initiate an ssh connection to some server:
$ ssh -C -D 40000 somehost.tld
I then have a SOCKS proxy running on localhost port 40000 which many applications directly support (Firefox, Gajim...) and tsocks can be used for apps that don't. Argument "-C" enables compression and it saves me some bandwidth in the long run. I know many people tweaked network settings of Firefox (or use Fasterfox) to gain speed, but you might consider a more conservative set of rules when using GPRS because it could backfire on you.


Written by anrxc | Permalink | Filed under main

13.04.2009 20:42

Daemon by Daniel Suarez

Recently I read a discussion about authors and books that don't make a ton of inaccuracies when it comes to technology. Suggestions for good books by authors that know their stuff were welcomed. That's how I learned about the Daemon. It's a thriller written by Daniel Suarez and it turned out to be great entertainment.

Matthew Sobol is a genius programmer angry with society and when he dies he leaves a daemon (as in process) behind him with an agenda to change the world and societies for ever. Plot is good, technology is great and it's a real page turner. I recommend you read it too.


Written by anrxc | Permalink | Filed under books

09.04.2009 20:36

Electronic book readers

I am very excited about electronic book readers such as the Amazon Kindle and Sony PRS devices. Since Kindle was released I've read numerous discussions on whether they can replace real paper and real books. The common conclusion is always: no. This technology is for now available mostly to Americans and they are the majority partaking in these discussions, which always revolve around that issue.

But they are all missing a very important point and probably wouldn't understand it because any book imaginable is available in their bookstores and they can even buy paperback editions of any book for around 5$. Can Kindle replace paper - no, but what if the paper is not even available to you? The publishers are not interested in good books, only in good money and so, here in Croatia, they mostly publish best selling romance and crime novels when it comes to foreign authors. Let's take a popular writer like William Gibson as an example, only Neuromancer and Virtual Light were translated and published here. Both are only a part of a trilogy - well isn't that a fuck-up but additionally I had to pay over 50$ for my copy of Neuromancer (which turned out to be a lousy translation mind you).

That's why electronic book readers are my salvation and if they really won't be able to replace paper I don't care because I know it in my hearth and bones that they are certainly the future for me. If we can ignore the fact that most (even remotely) popular books are already available for free on-line, as pirate copies, that still leaves us with most e-books that are sold for no more than 5-10$ by legal resellers.

In the future I will be able to read any book I desire. It will cost a few dollars and it will instantly be placed on a device that is as big as just one book but holds thousands previously inaccessible titles. Many people already read e-books from their phones, PDA's and laptops and they've been doing it for years. But for me they all have too much disadvantages and in the case of laptops there is just no way I can feel comfortable with it while laying in bed, it's just too heavy and impractical.

Current technology and software used in these devices still have too much imperfections and their price is just too high taking that into account. It's the reason I didn't buy one yet, the price doesn't bother me as much because I've spent so much money on books that an e-book reader would in short term be a big expense but in the long run would save me some serious money. I've been tracking communities like MobileRead and there are still much drawbacks and problems (i.e. with formatting of PDF's and other formats) for me to buy one. But I'm sure it will all be solved soon, I don't want to cash out for a BeBook and struggle with formatting while three months later something called "CeBook" puts all current models to shame.


Written by anrxc | Permalink | Filed under books, media

06.04.2009 23:57

Elegance of VDR

In early 2000s ADSL was an unreachable dream here, a myth. I guess ze Germans were just starting with SDSL/whatever and their old equipment was not yet available for transfer to Croatia. I had to wait 19PM for lower dial-up rates (also expensive mind you), and then spend the whole night on-line (thank you for the lovely sleep disorder). Anyway, after reviewing my options only solution was SatDSL. I signed up with Netsystem, and as a part of their service I received a PCI DVB-S card, it was a SkyStar2 card from TechniSat. At the time I was completely ignorant to all other benefits this beautiful piece of hardware brings... well, not for long anyway.

Today I still have the same card in a dedicated PC that is running VDR for watching SAT TV. In the age of eye candy and flashy things like "Boxee", "XBMC" and "MythTV" it manages to stay remarkably simple (in design, not necessarily in implementation) yet very powerful, it perfectly fits the KISS philosophy of Slackware or Arch that I learned to appreciate so much. Combined with Oxine you get a full blown media center without any complexities that solutions like MythTV imply (SQL being one). But thanks to some smart design choices VDR is infinitely expandable via plugins, so it can still offer any functionality other systems have. For example, using plugins it's possible to watch analog TV as well as IPTV (and of course DVB-C/T are natively supported) all from one interface. Speaking of DVB it also has the upper hand over MythTV as the latter was started with analog TV in mind while VDR was built around DVB from ground up. People in my country recognize VDR as a premium STB solution, yet very few know their way around GNU/Linux and VDR became kind of a myth that everyone recommends yet no one uses (sticking to lesser Windows alternatives). That bothered me as VDR is the simplest solution out there, so a few years ago I wrote a wiki article guiding people trough each step of the process. I didn't count all the thank-you notes I received since then but they are close to a hundred now.

With this introduction concluded, in the future I can write about some more interesting bits and pieces of the setup, like software CAM emulation, streaming and so on...


Written by anrxc | Permalink | Filed under dvb, media

01.04.2009 23:32

Employing org-mode

Since I started using org-mode I employed its simple format on many different documents, not just limiting it to manage my agenda. For example it's a great format for documenting systems I maintain; all system information, changes, security updates etc. are stored in per-system org files. I also use it for all projects I work on. Once terms are set I will open a new project.org file and start outlining tasks. Later all kinds of sensitive information will be added, and this brings up the issue of security, I wrote about encrypting file-systems but additionally I also encrypt every sensitive file with GPG. This is where EasyPG for Emacs fits in, it allows transparent en/decryption of files while ensuring nothing gets leaked outside of Emacs.

It's not as simple as some (custom) systems I've seen but it's a complete solution. Freelancing from home I had to come up with something to make my life easier and my hands weren't tied by some office rule or regulation. The same setup can be used to keep your passwords, logins, bank account and other personal information. Org's table mode is a good format for those files.

Along with project.org I also have report.org files for every project, holding various information, documenting everything I did and so on. When I'm done I export the report as a PDF and send it to clients, feedback was always very positive. It's simple but it makes a difference. I'll mention just one more use case. This winter I was at a hackmeeting and someone asked me to talk about video streaming. It took me about an hour to write an org file on the topic and I used it directly with Emacs to do a presentation. I did it by strategically expanding and folding relevant sections as I went over the topics, and it turned out really well. After the event I exported it to a few different formats and shared them with participants, once again I had a complete solution...


Written by anrxc | Permalink | Filed under crypto, work, emacs

29.03.2009 23:01

Publishing with NB and Emacs

Picking an engine to publish my writings I wanted something extremely simple. First thing that implies is no SQL. I wanted an engine written in Python and pyblosxom was interesting but in the end I went with NanoBlogger. NB is a blog engine written in Bash that uses standard UNIX utils like sed and grep to create static HTML content. How to write and publish the content is left as an exercise to the user.

NB can automatically generate templates on new entries or articles, but it's not perfect when it comes to GNU Emacs. I wanted at least the correct mode to be started. So I wrote nbpost.sh, it creates a new entry, inserts a template and starts the correct mode. It also recognizes when I'm editing an existing entry, and can start Emacs if it's not already running. As for the mode, html-mode is OK, but I found post-mode to fit perfectly. It was written for mutt and editing e-mails but it has other uses too.

Once written and HTML generated, an article needs to be published to the web server. Doing this manually would be tedious so I wrote nbsync.py. It uses rsync for publishing content over SSH. Rsync will transfer only changes between files, it uses compression and ssh provides encryption... very simple yet very effective.

With that in place I still wanted better integration of NB in my environment. I use ZSH which has great completion and a web search brought me to completion functions written in 2006, a little outdated but very good. I updated them and published _nb here. It completes all the commands as well as categories and entries.

I now have a complete solution for publishing from Emacs. Which also brings its related benefits; syntax highlighting, spell checking, well known key bindings and automatic publishing of content. Not to mention that org-mode found it's use too. I keep a journal.org file outlining all my entries and categories, related TODO tasks and ideas for future articles.


Written by anrxc | Permalink | Filed under main, code, emacs

27.03.2009 19:59

Filesystem encryption on Linux

After months of reviewing different filesystem encryption implementations for GNU/Linux I settled for two possible candidates. Those were: dm-crypt and eCryptfs. The first provides a block device encryption layer while eCryptfs is an actual filesystem - a stacked cryptographic filesystem to be exact. After another month of weighing options I decided to use eCryptfs for protecting my laptop.

Being a stacked FS, eCryptfs mounts on top of an existing filesystem so it doesn't require a pre-allocated block device. You can mount it on top of any single directory to protect it. Drawbacks are that you can't use it to protect you swap partition nor does it provide plausible deniability - it's obvious that encrypted data exists. Here is a nice table comparing these two implementations. Besides speed and simplicity eCryptfs is a really clever implementation and it's just what I need right now.

I used eCryptfs to encrypt my entire $HOME, which is still kind of a un-documented area. So I decided to write an article describing my setup which explains how to use eCryptfs for $HOME encryption and dm-crypt for protecting swap space (without breaking hibernation). Next Ubuntu release will have $HOME encryption with eCryptfs integrated so it will be interesting to see how they implemented it. By the way, right now I am more concerned about privacy issues then security - that's why I didn't encrypt my entire drive, yet. Even if I did all I could with current solutions I still wouldn't be at the level of security I really want:

With strong crypto I still want a few other things, most important one being plausible deniability. Either to have completely hidden encrypted volumes (Truecrypt hidden volumes can be detected) or to have different keys unlocking different data. The secret police should not be able to prove that not everything was decrypted.


Written by anrxc | Permalink | Filed under crypto, code

25.03.2009 10:45

Cryptonomicon 10 years later

I bought and read The Baroque Cycle this winter, and loved it. I avoided it for the longest time thinking it would be an overkill because I read Stephenson's books primarily for his SF work. When I finished it I just had to read Cryptonomicon again.

While reading it I couldn't stop thinking about the technology in the book. Cryptonomicon was written in 1999, before we had blogs and Windows 98 was all the rage. Even the Internet as we know it today was a lot different. But somehow Stephenson pulled it off, Cryptonomicon 10 years later is not obsolete. You have Finux and crypto, optics and data havens... Parts of it almost seem like SF, even today.

Story follows three narrations. Two of them during WW2, and how allies broke the axis crypto. There people like Turing are side characters and besides cryptography Stephenson tells us a story of IT and electronic computers. Narration set in modern days follows a hacker named Randy - grandson of a mathematician that worked on breaking the axis code - and his company Epiphyte while they are trying to build a data haven. In the process they get involved in a hunt for Japanese war gold, so you also get your share of adventure... I often saw people calling it a cyberpunk/cypherpunk bible, and not without good reason. It's one of those must-read books


Written by anrxc | Permalink | Filed under cyberpunk, crypto, books

22.03.2009 01:37

Takeshi Kovacs novels

I found Altered Carbon last year in my favorite bookshop, translated and published on its own. I really enjoyed it, even more so as a cyberpunk enthusiast. It took me another year to find electronic versions of other books in Takeshi Kovacs trilogy; Broken Angels and Woken Furies, which I read this winter in a period of a few days, or nights to be more accurate. I started by re-reading Altered Carbon which, for me, in the end turned out better then the second book but not from Woken Furies which was a magnificent finale.

Setting is some 500 years in the future, at which point humans colonized other planets. Dominant, and most interesting, concept in these books is that people don't really die anymore, as most of them have stacks in their spinal columns which store their personalities and memories. If a body dies the stack can be uploaded to a new sleeve (body). Well, there is still what they call real death, destroying the stack (and all backups of it, if any). That's where our hero, an ex envoy (elite military unit), Takeshi Kovacs comes in. He is re-sleeved on Earth and has to solve a murder case. Second book takes place some 30 years later, where Kovacs is involved in a war on some distant planet... a classic SciFi novel with interstellar warfare and aliens. While in the third book he finally returns to his home planet for a conclusion of a series. We also get to learn a lot about his early days. As I said before the last book was the best for me, a must read.

I don't read much SF, apart from cyberpunk novels, but this was really something. It's a mix of hard-boiled noir detective stories, cyberpunk and contemporary Sci-Fi. Something in it for everyone. Richard Morgan is now one of my favorite authors, side by side with writers like Neal Stephenson and William Gibson.


Written by anrxc | Permalink | Filed under cyberpunk, books

21.03.2009 19:55

Pvol and ossaudiodev

Pvol screenshot My laptop has a lot of extra keys, a few of them for controlling sound. At first I mapped those to change the volume silently with amixer. While I was at a hackmeeting this winter I noticed a few laptops that had internal OSD showing a progress bar on volume changes. I liked that, and recently Gigamo showed me his rvol utility for changing the volume that displays a GTK progress bar. It's written in Ruby and I didn't have ruby-gtk2 bindings to try it (nor wanted to install them).

I considered it a good exercise to rewrite it in Python with pygtk, because so far I used only WxGTK and PythonCard. Good thing that I did as Pylendar was next and it was much easier to write. Anyway pvol.py is a command line utility for changing the volume, showing an optional GTK progress bar. While rvol uses an external utility for actual volume changes I decided to use ossaudiodev, so pvol is standalone. One especially tricky task with it was muting audio channels. I worked with pyalsaaudio before and I like it more but it's not part of the standard Python distribution. Finally I re-mapped my keys to use pvol and I'm very happy with it, it's simple but it makes a difference. Let's see what it actually does:

$ pvol -h

Usage: pvol [-s] [-m] [-c PERCENT] [-p] [-q]

Options:
  -h, --help            show this help message and exit
  -s, --status          display current volume
  -m, --mute            mute the main audio channel
  -c PERCENT, --change=PERCENT
                        increase or decrease volume by given percentage
  -p, --pcm             change PCM channel (default is MASTER)
  -q, --quiet           adjust volume without the progressbar


Written by anrxc | Permalink | Filed under desktop, code, media