You are viewing [info]mikhailian's journal

mikhailian

Recent Entries

5/21/12 12:25 pm - Better MySQL output formatting: what a life saver!

Also published here.

Instead of the usual

SELECT * FROM users WHERE uid=1;

type

SELECT * FROM users WHERE uid=1\G

and enjoy a much better formatting!

5/4/12 12:58 pm - How to block Tor exit nodes from accessing your website

Also published here.


Internet trolls are using Tor nowadays to avoid bans by IP. However, banning Tor exit nodes is just slightly more complex. The Tor Project provides a regularly updated list of exit nodes that can access your IP here. As there may be many hundreds or even thousands of nodes, adding them to iptables can hurt your server's network performance. Enter ipset, a user-space hash table for iptables:

# create a new set for individual IP addresses
ipset -N tor iphash
# get a list of Tor exit nodes that can access $YOUR_IP, skip the comments and read line by line
wget -q https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$YOUR_IP -O -|sed '/^#/d' |while read IP
do   
# add each IP address to the new set, silencing the warnings for IPs that have already been added
  ipset -q -A tor $IP
done
# filter our new set in iptables
iptables -A INPUT -m set --match-set tor src -j DROP

5/4/12 08:02 am - "Independent", "impartial", "european"… professional journalism

Also published here.

EU Observer runs a report on Belarus. See this gem: Earthquake zone on EU border to host Belarus nuclear plant.

Earthquake zone…

4/9/12 07:19 pm - Automatically switch between internal and external screens when using a laptop and a dock station

Also published here.

Assuming that the internal screen is LVDS and the external screen is DVI-0. inotifywait comes from the inotify-tools package.

# Wait for the changes detected by the kernel laptop mode.
while inotifywait -e modify /proc/sys/vm/laptop_mode do
laptop_mode=`cat /proc/sys/vm/laptop_mode`  
# If on battery, switch on the internal screen.  
if [[ $laptop_mode -gt 0 ]]; then
    xrandr --output LVDS --mode 1280x800
    xrandr --output DVI-0 --off  
# Otherwise,
  elif [[ $laptop_mode = 0 ]]; then
     # if the external screen is connected, switch it on.
     if [[ `xrandr -q|grep DVI-0|cut -f2 -d\ ` = connected ]]; then
       xrandr --output DVI-0 --mode 1920x1200
       xrandr --output LVDS --off
     fi
  fi
done

3/11/12 07:08 pm - Опаньки…

Also published here.Опаньки…

Tags:

3/10/12 10:09 am - О вреде Test-Driven Development

Also published here.

Цитата отсюда:
(какой-то функциональный тест написанный таким образом падал и разработчик решил проблему использованием datetime2).

1/14/12 10:54 pm - Подписался на Spotify Premium по наводке, заплатил 10 евро…

Also published here.

И выдержал ровно сутки. Половины музыки, которую я слушаю, у них нет. При регистрации через фейсбук linux-клиент Spotify уведомляет (sic!) что будет анонсировать музыку, которую я слушаю, в фейсбучный timeline. Без спросу индексирует всё музыку на компьютере. К чёрту.

9/28/11 08:42 pm - The continuation of the HTC saga

Also published here.

I bought an HTC Desire S smartphone in June. Since then, I sent it three times for repair to Dynafix, which is apparently the HTC Repair Center for Belgium. For the 3rd time, Dynafix replaced the mainboard for my phone, which fixed the original problem. However, I quickly noticed a new and easy to reproduce problem that I communicated to the HTC call center. I was told over the phone that I will get a replacement unit.Read more... )

9/4/11 12:26 am - Sorry state of HTC hardware and warranty support

Also published here.

I bought a Desire S smartphone a little more than 2 months ago, but did not have a chance to really use it, yet. It came with an elusive and odd bug. The touch screen stopped responding once in a while. This could occur any time, but seemed to happen less frequently after 5-10 minutes of active use.

The first time I sent the phone to repair, it came back with flashed ROM, but the problem stayed.

The second time I sent the phone for repair, it came back with a new touch screen, but the problem stayed.

Read more... )

7/29/11 01:02 pm - I am a Mobile Viking now

Also published here.

My first request for number porting from the Proximus mobile business acount of my former employer to Mobile Vikings dates from 6th of June. A few dozen emails, several phone calls and one complaint to the Telecom Mediator later, I had my phone number ported to MobileVikings today, July 29.

4/4/11 01:04 pm - Everything you can not do with a Windows Phone 7

Also published here.

Three days ago, I got my hands on the HTC Trophy 7 running Windows Phone 7. Until now, I played occasionally with Android, but never used a smartphone.

Here's a list of things I'd like to do on the smartphone:

  • Transfer the contacts from the old Nokia phone
  • Listen to music and audio books from the local collection
  • Read books from Flibusta

In the process, I'd rather not to reveal too much personal information to Microsoft. The wishlist looks simple, huh? Let's see what I managed to do.

Read more... )

3/30/11 10:04 pm - Saving the private notebook

Also published here.

Saving the private notebook После нескольких лет верной службы, ноут зашумел и стал греться. Я уж грешным делом задумался о покупке нового, но в процессе поисков замены ноут себе любимому самопроизвольно отключился. Операция на внутренностях обнаружила толстый и плотный кусок мусора, в центре кулера. Совершенно не понятно, как он там образовался.
Tags:

2/21/11 10:54 pm - Liars, big liars and risk managers

Also published here.

This is how the Belgian public credit risk insurance body evaluates risks in select world countries. The country that has the world record of being without the government is rated best, the other, buried down in a full-fledged civil war, is just marginally worse, and the most stable political regime on earth is very risky.

2/11/11 01:19 pm - ESA fingerprint?

Also published here.

Is it just me or the ESA logo indeed looks like a fingerprint? Turns out, they wanted to represent a planet. I learned this while reading the ESA Visual Design Guidelines. Do you see a planet on the picture?

Tags: ,

1/26/11 12:13 pm - Об автокреслах, волнах ненависти в интернете, экономистах и производителях

Also published here.

В этих самых интернетах очередной скандал: все сливают некую российскую компанию, которая продаёт некачественные автокресла в интернете.

По поводу автокресел в 2008 году вышло исследование американского экономиста Стивена Левитта, который более известен как автор книжки Freakonomics. Стивен на свои деньги заказал испытания ремней безопасности по программе испытаний автокресел. С макетами детишек разных возростов, датчиками, замедленной съёмкой. Короче, полный фарш.

Read more... )
Tags:

1/1/11 10:35 pm - What's the most important event on the most popular belgian leisure catalogue on Jan, 1?

Also published here.

What's the most important event on the most popular belgian catalogue of leisure activities on Jan, 1?

This is a gay fucking party!

12/17/10 01:50 pm - Индекс свободы слова

Also published here.

тут

11/5/10 05:49 pm - Lies, damn lies and the World Bank

Also published here.

The recent Doing Business '2011 report states on page 98 that Belgium has no limit on the maximum length of fixed-term contracts. AFAIK, this is wrong. The maximum length of fixed-term contracts is 2 years (exceptionally, 3 years). In some sectors, this is down to 6 months. My knowledge dates from 2007, but I bet nothing changed since then.

Read more... )

11/3/10 10:51 pm - Mplayer package with VDPAU support on Debian Lenny

Also published here.

I recently bought an Asrock ION 330 Pro HTPC which supports VDPAU, an NVIDIA API for Linux that offloads parts of video processing to the GPU. The upgrade from the old HTPC went smoothly with a mere dd if=/dev/sda of=/dev/sdb and a few system tweaks. However, it turned out that Mplayer in Debian Lenny that I was running on my new HTPC box did not support VDPAU. Checking the usual places, like backports and debian-multimedia did not help, either.

Read more... )
Tags:

10/28/10 10:01 am - Переврали всё, что можно

Also published here.

Переврали всё, что можно

Картинка из детской книжки про Хеллоуин. Избушка montée sur des pattes de poule, ага. Но на двух, а не на шести. И летает не в чугунном котелке, а в деревянной ступе (pilon en bois!).

10/15/10 09:32 am - О стереотипах в кино

Also published here.

Вчера смотрел последнюю серию Lie to me, там Лайтман вымучивал из себя книгу на новеньком макбуке, параллельно расследуя некое происшествие на конкурсе красоты. Вымучивал он книжку на протяжении всей серии, а под конец показали кадр, в котором он сидит за ноутом с виндовс и упоённо строчит текст новой книжки.

«Сядь за венду, займись делом.» © popular stereotype
Tags: ,

10/12/10 11:01 am - Tell me, Sodexo, tell me, Accor, where those unused 7 mln € go each year?

Also published here.

Tell me, Sodexo, tell me, Accor, where those unused 7 mln € go each year?Even Metro can be source of insightful information. Look, 1.4 mln belgians get luncheon vouchers, 0.35% of luncheon vouchers stay unused, so how much do the distribution companies pocket each year on these unused luncheon vouchers?

Read more... )

10/12/10 09:52 am - Omnipresent Loyalty Protection & Control strikes in America!

Also published here.

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

Tags:

9/28/10 09:34 am - Sur l'importance des majuscules

Also published here.

La Première a annoncé aujourd'hui dans son journal de 9 heures le limogage du maire de Moscou Yuri loujkov, qu'ils ont prononcé comme [jʊri jʊjkov]. Le nom du maire est Юрий Лужков, transliteré le plus souvent comme Yuri Loujkov et prononcé comme [jʊri lʊʒkof].

9/24/10 02:47 pm - The Belgium Root CA homepage ran with an expired SSL certificate for well over a year, now

The Belgium Root CA homepage ran with an expired SSL certificate for well over a year, now

Also published here.

It's not that I am searching for epic fails, they are searching for me. Check that site, it comes high in Google SERPs for the eid keyword.

9/23/10 04:08 pm - There are more house cleaning jobs in Belgium than IT jobs

Also published here.

Look at the list of 100 most popular professions in Belgium. Sales and medical care jobs are topping. There are two times more public administration workers than IT workers, but IT workers already outnumbered accountants and haulers.
Tags:

9/23/10 03:37 pm - Definition: disgraceful degradation

Also published here.

disgraceful degradation [dɪsˈgreɪsfʊl ˌdɛgrəˈdeɪʃən]
vulg.
Degradation in website usability for Internet Explorer 8, 7 and 6 users, done on purpose.

9/16/10 04:32 pm - Controversial popularity of Belgian music and films

Also published here.

«When I use a word, Humpty Dumpty said in a rather a scornful tone, it means just what I choose it to mean — neither more nor less». © Lewis Carroll

Check out that article from Metro. Seems like the text was written by the Belgian anti-piracy association, and the title — by a Metro editor who tried to please the public by indicating that some still like belgian music and movies.

Now, do the numbers given in the article make any sense to you? What would have changed if they were divided by 100 or multiplied by 1000?

7/20/10 09:22 am - Intervat or Fight agains the electronic windmills

Also published here.

Belgium has a multitude of e-government solutions. Local residents have now ID cards in the form of a banking card with a chip, there are services to order certificates online with these cards, pay taxes and check for medicines.

Read more... )
Tags:

7/12/10 09:32 am - Справа по борту бесплатный вайфай!

Also published here.

Морячок с парусника Мир Морячки с парусника Мир Моряки учебного парусника «Мир» в порту Антверпена. Интересно, им всем Acer'ы выдают, или так случайно получилось?

7/12/10 09:26 am - Беларусь — марская дзяржава!

Also published here.

Гл. сьцяг уверсе.

Tags:

6/4/10 11:23 am - Job Architect. Helping companies write job ads

Also published here.

First appeared in westartup.eu

Nowadays, IT companies do not rely on intermediates when looking for new employees. They use the Jobs sections of their websites, advertise on Stepstone, Monster or LinkedIn. They use the power of the word-of-mouth. In the ongoing battle for the new talent, the attractiveness of the job ad for the company is as important as that of the resume for an applicant. However, many IT job ads are written either by the middle management or by HR, that is, people who are likely to miss the most attractive features of the new position by sheer lack of domain knowledge.

Read more... )

6/4/10 11:20 am - Create a public poll service with eID authentication for Belgians

Also published here.

First appeared in westartup.eu

The eID is not only a small piece of plastic that replaces your old cardboard national ID card, but a means to electronically sign legally binding documents.

Read more... )

5/31/10 11:44 am - Write a useable FP7 proposal collaboration tool

Also published here.

Appeared originally in westartup.eu.

There are already some FP7-related services, two clicks from the google home page, but they are mostly about consulting or badly written tools that none uses anyway.

Read more... )

5/31/10 11:32 am - Use version control software for lawmaking processes

Also published here.

Originally published in westartup.eu.

As usual, the US is ahead of the rest of the world with the law.gov initiative that formalizes and makes available in a useful way all existing information pertaining to the country's legal system. It is important to change the lawmaking processes so that they create data in ways that are immediately useful by services like law.gov.

Read more... )

5/22/10 03:40 pm - Вот так вот фламандофоны сражаются за свой язык

Originally published here

Казалось, в просвящённой Европе подобные методы революционной борьбы давно вышли из моды, ан нет.

Tags:

5/22/10 01:08 pm - A old but still useable phpbb2drupal conversion script

Originally published here.

Read more... )

5/10/10 04:29 pm - О кажущейся неправдоподобности технологических прорывов

Any sufficiently advanced technology is indistinguishable from magic.

© Arthur C. Clarke

Иногда получается, что какой-то отдельно взятый технологический прорыв кажется шарлатанством из-за неправдоподобных заявлений.

Ну вот кто может поверить, что к началу 2000-х годов никому не известной конторой в Минске был разработан уникальный синаксический анализатор английского языка? Звучит неправдоподобно, да и проверить нельзя.

Несколько лет назад мне пришлось пользоваться некой мутной структурой данных. Имеющаяся в наличии библиотека не подходила по множеству причин. Библиотека эта была ориентирована на однопоточное применение, являлась по сути реализацией ORM для конкретного случая и выставляла в качестве API собственный язык запросов, явлюящийся надстройкой над SQL, тогда как мне нужен был низкоуровневый доступ и возможность бродить по дереву данных вдоль и поперёк.

Я в то время как раз собирался изучить Ruby-on-Rails, и его ORM подсистема под названием ActiveRecord мне показалась подходящей для реализации необходимой функциональности.

Сказано-сделано. Периодически мучая вопросами ближайшего гуру руби и рельсов [info]divine_assass1n, я за несколько вечеров написал нужную функциональность. Вышло меньше 1000 строк кода. Счастливый, я начал использовать свою библиотечку, делясь с коллегами радостью по поводу простоты и элегантности найденного решения.

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

Теперь исходные коды всех трёх библитек свободно доступны. Моя библиотека за последнее время подросла и занимает 1 200 строк на руби, конкурент похудел до 30 000 строк на С++, ну а в монстре в настоящее время около 200 000 строк на Java.

5/6/10 10:33 pm - Первая работа — как первая любовь

Собрано из двух постингов на dev.by.

Когда дискеты ещё только выходили из моды, а запороть компакт-диск считалось западлом, когда Invention-Machine Belarus ещё назывался Научсофтом, меня, совсем ещё желторотого несмышлёныша, уволили оттуда, прознав, что я получил предложение работы от тогдашнего лидера индустрии.

Увольнение было обставлено в лучших традициях большого и жестокого бизнеса. У входа в здание меня встретили и проводили к тогдашнему директору, который, тряся поджилками, полдня уговаривал меня подписать задним числом NDA, угрожая сделать невыездным и наслать порчу если я вдруг стану рыпаться. Верные коллеги тем же вечером размонтировали мой опечатанный комп и записали всё, что было личного, на компакт-диск. Как сейчас помню, хватилo места даже для инсталляции Quake 2 вместе со всеми сэйвами. Через месяц-другой любимый начальник предложил мне подработать по специальности на нелегальном положении, на что я с радостью согласился, и ещё шесть месяцев, пока оформлялись документы на отъезд, колбасил сявки на дому. C тех пор прошло много лет. Обида забылась. Из верных коллег на старом месте осталось только двое. Году в 2001, встретив директора Invention-Machine в зале ожидания аэропорта, я даже удосужился пожать ему руку и обсудить туманные перспективы моего тогдашнего работодателя.

Все эти годы я внимательно следил за Invention-Machine, ведь как-никак, а эта фирма дала мне путёвку в жизнь, там я встретил замечательных людей, с которыми дружу до сих пор. Но меня всегда поражало, насколько эти замечательные люди, профессионалы своего дела, незаметны даже в своей профессиональной среде.

С тем человеческим потенциалом, который имелся в Invention-Machine в начале 2000-х годов, можно было получить известность на мировой научной арене, зарабатывать не единицы, а сотни миллионов в год на продаже технологий и сиять на мировом рынке звездой первой величины.

Однако прошло 10 лет, а воз и нынче там. Ни один из этих замечательных лингвистов не написал ни одной статьи ни в ACL, ни в Coling, ни в EMNLP. То есть, в топовых научных конференциях, в которых ежегодно участвуют работники Микрософта и Гугла, никто не слышал о Invention-Machine. Да, контора выжила. Да, возможно она даже приносит прибыль американским владельцам. Но я уверен, что потенциал её не был реализован.

Я считаю, что причина этого в том, что в руководстве Invention-Machine никогда не было людей, разбиравшихся в технологиях, на которых строится бизнес фирмы. Отец-основатель был так же далёк от языкознания, как декабристы от народа. После того, как власть в Invention-Machine захватили венчурные капиталисты, ситуация только ухудшилась. Руководство этой конторы за 10 лет не удосужилось предпринять элементарные маркетинговые ходы: заняться написанием научных статей, участием в конференциях, выпуском на рынок библиотек для выполнения типовых задач. Компания так и не вышла на массовый рынок и не завоевала известность. Вместо этого, как и десять лет назад, они продают инсталляции невнятной тулзы под названием Goldfire Innovator за сотню тысяч долларов штука, заключая сделки на поле для игры в гольф.

5/4/10 09:51 am - The Java.net resource runs Drupal, haha!

In a desperate act of self-humiliation, people behind Java.net upgraded their Drupal-based website and left the default Drupal favicon on their site, as a sign of a total professional failure.

P.S. Looks like they had a MovableType before Drupal. Dries blogged about it half a year ago.

4/11/10 04:30 pm - Куда деть колонки в условиях хронического недостатка рабочего места?

В перерывах между работой и хобби, приделал колонки под крышку самодельного стола из цельной доски. Качество звука, как и ожидалось, пропорционально площади резонатора. Низкие передаются прямо в грудную клетку через лежащие на столе локти.

3/22/10 04:21 pm - A beautiful filter for SSH brute-force attacks for your admiration

A bad sysadmin changes the default SSH port.

A good sysadmin throttles the brute-force attackers by disallowing new connections every 20 seconds

# requires xt_TARPIT
iptables -A INPUT -p tcp -m state --state NEW \
  --dport 22 -m recent --update --seconds 20 -j TARPIT
iptables -A INPUT -p tcp -m state --state NEW \
  --dport 22 -m recent --set -j ACCEPT

A brilliant sysadmin blocks intruders indefinitely

# requires hashlimit
iptables -A INPUT -p tcp -m tcp --dport 22 -m state \
  --state NEW -m hashlimit --hashlimit 1/hour \
  --hashlimit-burst 2 --hashlimit-mode srcip \
  --hashlimit-name SSH --hashlimit-htable-expire 60000 
  -j ACCEPT

iptables -A INPUT -p tcp -m tcp --dport 22 \
  --tcp-flags SYN,RST,ACK SYN -j DROP 

iptables -A INPUT -p tcp -m state \
  --state NEW -m tcp --dport 22 -j ACCEPT

In the last example, the 1st rule allows up to two connections per hour. After the limit of two connections per hour is reached, the second rule becomes active and the hashlimit module starts to countdown from 1 minute (60 000 milliseconds). If you connect within 1 minute, the hashlimit counter is reset to 60 000. If you connect after 1 minute, you drop to the 3rd rule and are allowed access.

Cherry-picked from Habr

2/19/10 09:22 pm - А в Кении Гоблинов-Пучковых оказывается пруд пруди

Пришла ко мне сегодня афишка от Kaaitheater. В ней — анонс театрального перформанса девки из Кении. В краткой аннотации говорится, что в Кении популярны «живые» переводы фильмов, совсем как у Гоблина. Ничто не ново под луной.

2/10/10 11:02 am - Простейший сниффер TCP и UDP трафика в три строчки

mknod backpipe p 
mknod log p
while :; do cat backpipe |nc -l -p 3001 |tee log| nc localhost 3000 |tee log >backpipe; done


Зависимости: (ba,k)sh, netcat, mknod, tee.

Работает следующим образом. Скажем, нам нужно просмотреть трафик на порту 3000. Устанавливаем netcat сервер на 3001 порту, форвардим соединение в оба конца на порт 3000. Копию всего, что передаётся в обоих направлениях, пишем в файл log. Если вдруг соединение закрывается, запускаем всё заново.

Посколько log — не обычный файл, просматривать его можно только в режиме мониторинга c помощью tail -f или less -f.

Естественно, сниффер строго однопоточный.

2/8/10 10:20 am - How to return a custom mime type from a Rails application

Add the new mime type to the respective rails initializer



echo "Mime::Type.register \"application/xhtml+xml\", :xhtml" \
  > config/initializers/mime_types.rb


Use the name of this mime type in the config/routes.rb



map.root :controller => "test", :action => 'view', :format => 'xhtml'

12/16/09 05:55 pm - «Viewgraphs», a new eupemism for «PowerPoint sildes»

Just spotted this nice little euphemism slipping into the corporate newspeak. Is it because the old-fashioned nature of the word gives more weight to PowerPoint slides? Or it is because saying aloud "PowerPoint" has become suddenly reprehensible?

12/7/09 10:44 pm - And these people will teach us how to work…

The official OMG SysML website is edited entirely in Microsoft Frontpage 6.0. Its first page contains 124 links, 18 links among them are broken. Being backed by the biggest and richest corporations like Lockheed-Martin, Airbus, EADS, etc, it also displays a Google Ads block which shall bring in at most 5 USD per month, judging by the traffic it generates.

12/7/09 04:18 pm - A quote from the SysML 1.1 specification

A composite requirement may state that the system shall do A and B and C, which can be decomposed into the child requirements that the system shall do A, the system shall do B, and the system shall do C.

12/2/09 12:42 am - When the state spams their citizens, what shall we expect from criminals?

I just received offline spam from Fedict in the form of a letter without any postage marks and with the text on the envelope stating:

"An important message from the government".

The letter contained an invitation to buy a bundle of a PC with 12 months of free internet access for 422 EUR.

Update: Apparently, the same letter was distributed (not sent by post, but carried to the postbox by a spam delivery company) to a big share if not all belgian residents.

11/26/09 11:34 pm - Квота на евреев в американских университетах

Читаю книжку Фейнмана What Do You Care What Other People Think? Он там упоминает, что не смог поступить в Колумбийский университет из-за квоты на евреев. Интересно, как там сейчас с дискриминацией евреев.

Tags:
Powered by LiveJournal.com