Connecting to a hosting provider VPN from linux

I never did this before, so the most difficult part of getting a VPN connection working was about finding the right solution.

The source of my inspiration being apt-cache search, I first tried the Gnome Network Manager but the version in Efty Edge is so buggy that it was barely usable.

Then, I tried kvpnc. I could not get through all the menus it presented and make it work.

At that point, I gave up on graphical tools and went back to basics by googling for a HOWTO on linux+vpn+windows. My today's luck drove me to an openswan-based tutorial. After meditating for around an hour on IPSec configuration, I desperately returned to Google in a quest for a simpler solution and, within 15 minutes, I stumbled upon the pptp-client which had a ... surprise-surprise! Debian HOWTO. After that, it was just a matter of 5 minutes to set up and test the first configuration.

Type C work permit in Belgium

There are three types of work permits in Belgium. Type A is delivered to liberal professions. Type B is delivered to employees and workers. Type C is delivered to asylum seekers.

What's the point of delivering work permits to asylum seekers?

To answer the question, we should look back to the past. A few years ago, asylum seekers were not allowed to work in Belgium. An average procedure of establishing whether the asylum seeker is entitled to the refugee status took a few years. In the meantime, those people received social aid in the form of ~700€ per person, often accompanied by social housing and various material and monetary grants.

With the number of asylum applications floating between 20.000 and 40.000 each year, this generosity weighted heavily on the state budget which had to financially support well over 100.000 asylum seekers at any given time.

The process of granting these people a work permit was carefully crafted to satisfy different political players. Employers were gaining from the wave of the low-cost workforce coming to the market. NGOs were satisfied with the increased integration of the asylum seekers that followed the opening of the job market to them. Trade unions could not raise their voice due to the conflict of interests between the local workforce and the human rights activists within the trade unions themselves.

However, the biggest winner was the state. The delivery of the type C work permit was linked to the request to discover the real name, the birth date and the country of origin of the asylum seeker. In the real life, this forced the asylum seekers to show their passports to the country officials. It already allowed to filter those searched for by Interpol and people with a criminal past.

Are Belgian elections unverifiable?

I recently participated in the local-level Belgian elections as a commission member.

Brussels uses an electronic voting system where all votes are done one a computer and recorded on a floppy disk.

The thing is, given that the "software already counted votes", none counts paper ballots or announces results in-place. Instead, the floppy disks are taken to the city hall where the total result is (apparently) calculated and announced.

Now the question: How do you do a parallel recount with this system? You can't just send the observers to the voting posts to hear the results and communicate them in parallel as none knows the results before they get to the officials in the city hall.

Belgian unemployment statistics

There are more than 450.000 people in Belgium that receive unemployment money from the state without doing any work at all.

  • 68.000 out of 1.000.000 living in Brussels, that is, 6.8%.
  • 171.000 out of 6.000.000 living in Flanders, that is, 2.9%.
  • 211.000 out of 3.400.000 living in Wallonia, that is, 6.2%.

Given the belgian population totalling 10.445.000, the average is 4.3%

MySQL : so advanced that it forgot the simplest things

Out of two next snippets, the first one will throw a UNIQUE KEY constraint error and the second will pass.

SET NAMES utf8;
CREATE table test(name varchar(60)) DEFAULT CHARSET=utf8;
ALTER TABLE test ADD UNIQUE KEY name (name);
INSERT INTO test VALUES("Лелик");
INSERT INTO test VALUES("Лёлик");
SET NAMES utf8 COLLATE utf8_bin;
CREATE table test(name varchar(60)) DEFAULT CHARSET=utf8;
ALTER TABLE test ADD UNIQUE KEY name (name);
INSERT INTO test VALUES("Лелик");
INSERT INTO test VALUES("Лёлик");

All this because some wise folks decided that the default collation for utf-8 be utf8_general_ci, the one that does not make a difference between upper- and lowercase, and also considers that CYRILLIC CAPITAL LETTER IE, CYRILLIC CAPITAL LETTER IO, CYRILLIC SMALL LETTER IE, CYRILLIC SMALL LETTER IO to be equal.

Лучшие фото фотосайта на рабочем столе

Фотосайт раздаёт программу под винду, которая ротирует фотообои с лучшими фото. Программа -- маленький, глючный до невозможности экзешник. А ведь её можно заменить всего одной строчкой, которая будет скачивать последнее лучшее фото в том случае, если оно ещё не скачано.

ID=`wget -q -O - http://www.photosight.ru/wallpaper/week.wp`; \
  wget -q -N  http://www.photosight.ru/pix/$ID

А ещё в три коротенькие строчки можно поставить это фото на рабочий стол Gnome Desktop

cd /var/tmp; ID=`wget -q -O - http://www.photosight.ru/wallpaper/week.wp`; \
  wget -q -N  http://www.photosight.ru/pix/$ID
mv $ID $ID.jpg
gconftool-2 -t str --set /desktop/gnome/background/picture_filename \
  /var/tmp/$ID.jpg
gconftool-2 -t str --set /desktop/gnome/background/picture_options \
  "centered"

[Poor man's langmap] using vim key bindings while typing non-latin1 texts

When I am typing in cyrillic, I can not access any of the vim key bindings, unless I switch the keyboard layout to a latin-based one.

There existed a solution for 1-byte locales, the famous langmap command. Putting the following in the ~/.vimrc solved the problem for those who worked in e.g. a koi8-r or cp1251-based locale.

set langmap=ж;;
set langmap=ё`,йq,цw,уe,кr,еt,нy,гu,шi,щo,зp,х[,ъ],фa,ыs,\
  вd,аf,пg,рh,оj,лk,дl,э',яz,чx,сc,мv,иb,тn,ьm,б\,,ю.,Ё~,\
  ЙQ,ЦW,УE,КR,ЕT,HY,ГU,ШI,ЩO,ЗP,Х{,Ъ},ФA,ЫS,ВD,АF,ПG,РH,\
  ОJ,ЛK,ДL,Ж:,Э\",ЯZ,ЧX,СC,МV,ИB,ТN,ЬM,Б

Unfortunately, this did not work in a multibyte locale. Instead, one has to map every key independently with the map command:

   map ё `
   map й q
   map ц w
   map у e
   map к r
   map е t
   map н y
   map г u
   map ш i
   map щ o
   map з p
   map х [
   map ъ ]

   map ф a
   map ы s
   map в d
   map а f
   map п g
   map р h
   map о j
   map л k
   map д l
   map ж ;
   map э '

   map я z
   map ч x
   map с c
   map м v
   map и b
   map т n
   map ь m
   map б ,
   map ю .

   map Ё ~
   map Й Q
   map Ц W
   map У E
   map К R
   map Е T
   map Н Y
   map Г U
   map Ш I
   map Щ O
   map З P
   map Х {
   map Ъ }

   map Ф A
   map Ы S
   map В D
   map А F
   map П G
   map Р H
   map О J
   map Л K
   map Д L
   map Ж :
   map Э "

   map Я Z
   map Ч X
   map С C
   map М V
   map И B
   map Т N
   map Ь M
   map Б 

see also at http://www.vim.org/tips/tip.php?tip_id=1348

Pages