2006-09-28 23:06

September 28th, 2006 by Vasil Kolev

Tomorrow I’ll probably have to go to Lirex because of this:

Sep 28 11:22:31 marla kernel: [44573558.810000] 3w-xxxx: scsi0: AEN: WARNING: ATA port timeout: Port #0.
Sep 28 11:23:29 marla kernel: [44573558.830000] sd 0:0:0:0: WARNING: Command (0x2a) timed out, resetting card.
Sep 28 11:23:29 marla kernel: [44573587.630000] 3w-xxxx: AEN: ERROR: Incomplete unit detected: Unit #0.
Sep 28 11:23:29 marla kernel: [44573587.750000] 3w-xxxx: AEN: ERROR: Unit degraded: Unit #0.

It’s about time to upgrade her, there’s the idea to make a fundraiser to get part of the money… I’ll also have to pick the new configuration first (which I have some ideas about).

And the publishers from “Trud” have again started their intimidating campaigns, this time against the site People library, but this time I don’t see anyone that wants to yield. More info can be found in the blogs of Peio, Yovko and many more (the links are easy to be found :) ).

And I’m in vacation, but I’m feeling more tired. Could it be because of the lack of adrenaline?

2006-09-28 22:59

September 28th, 2006 by Vasil Kolev

Утре най-вероятно ще трябва да ида до Лирекс заради това:

Sep 28 11:22:31 marla kernel: [44573558.810000] 3w-xxxx: scsi0: AEN: WARNING: ATA port timeout: Port #0.
Sep 28 11:23:29 marla kernel: [44573558.830000] sd 0:0:0:0: WARNING: Command (0x2a) timed out, resetting card.
Sep 28 11:23:29 marla kernel: [44573587.630000] 3w-xxxx: AEN: ERROR: Incomplete unit detected: Unit #0.
Sep 28 11:23:29 marla kernel: [44573587.750000] 3w-xxxx: AEN: ERROR: Unit degraded: Unit #0.

Крайно време е да я upgrade-на, има идеята да се направи fundraiser (как беше термина на български?) за събиране на част от парите… Трябва и да си избера първо новата конфигурация, разбира се (за която имам няколко идеи).

А издателска къща “Труп” пак са започнали да се изсилват, тоя път тормозят сайта Народна библиотека, обаче не смятам, че някой има желание да им се дадем. Повече информация може да се намери по блоговете на Пейо, Йовко и кило други (линковете се намират много :) ).

Уж съм в отпуска, но реално се чувствам още по-уморен. Да не би да е от липсата на адреналин?

2006-09-26 10:04

September 26th, 2006 by Vasil Kolev

Got extremely drunk last night…. And a headache to go along with it…

2006-09-26 10:04

September 26th, 2006 by Vasil Kolev

Са напил кат’ алигатор…И главата ме боли…

2006-09-24 23:25

September 24th, 2006 by Vasil Kolev

There aren’t a lot of things so relaxing as a two-hour game of bzflag…. In the last few days I’m running a server on one nicely-connected machine and 4-8 people are gathering there to kill each other.
(and if someone is in the office to listen to us how much we swear is just incredible)
(and listening to Tool while playing helps)

My situation is generally messed up, I hoped to take the next week as vacation, but it seems that I’ll be only able to take Monday and Tuesday, Wednesday I’ll probably be flying to Belgium for another project (if not – I’ll sleep through the week with no remorse). I don’t know how much laziness I’ll need to be able to rest…

I’ve started re-reading BOGH and I’m almost finished (I’m at the 2005 stuff), it’s really worth it laughing again with it (but right now it’s accessible only in archive.org, because Simon has put on the main page the obituary for his father, may he rest in peace).

What’s next now is sleeping and laziness… I slept through yesterday, tomorrow I might sleep until noon.

2006-09-24 23:20

September 24th, 2006 by Vasil Kolev

Не са много нещата, които така да разтоварват човека като една двучасова игра на bzflag… В последните дни съм пуснал сървър на една добре свързана машина и се събираме по 4-8 човека да се трепем.
(а човек да е в офиса и да ни слуша как се псуваме е просто неповторимо преживяване)
(слушането на Тооl по време на игра помага)

При мен ситуацията е генерално объркана, надявах се да си взема отпуска цялата идна седмица, но май ще са само понеделник и вторник, вероятно в сряда ще летя за Белгия по една друга работа (ако не – ще проспя седмицата без никакви угризения). Не знам колко мързел ще ми трябва, за да успея да си отпочина …

Хванал съм се да препрочитам BOFH-а и почти го свърших (на нещата от 2005 съм), струва си пак да се посмее човек (само че е е достъпен само в archive.org, понеже Саймън е сложил на главната си страница некролог за баща си, мир на праха му).

Сега следва пак спане и мързел… Вчера проспах деня, днес мисля да спя поне до обяд.

2006-09-19 14:32

September 19th, 2006 by Vasil Kolev

(I’ve started writing too much these days :) )

It’s to be noted that we’re working really hard to achieve the ultimate gift for someone’s 33rd birthday… Year-two ago we gave Guninski a normal hammer and some screws (we weren’t able to find good nails), and a few minutes ago we gave Yourii one 2kg hammer (I first asked for 5kg, but it looked like something Conan the Barbarian would use), five 20cm nails and a crown made of barbed wire (which we made ourselves, there wasn’t any in the store). The next one is Milen after a few months, and we’re thinking about having a cross for him (some people around here sell big enough beams).

2006-09-19 14:29

September 19th, 2006 by Vasil Kolev

(много почнах да пиша тия дни :) )

Трябва да се отбележи, че вървим усилено към подаряването на ultimate подаръка за 33ти рожден ден… Преди година-две подарихме на Гунински един нормален чук и малко видии (не намерихме подходящи пирони), а преди малко на Юрий подарихме един 2кг чук (аз първо питах за 5кг, ама се оказа размер като за Конан Варварина), пет 20см пирона и един венец от бодлива тел (нямаха там, та си я правихме на ръка). Следващия е Милен след няколко месеца, за него мислим да сковем и кръст (наоколо по околовръстното продават талпи).

September 19th, 2006 by Vasil Kolev

I hate when my schedule gets messed up.

Turns out that I won’t be travelling to the US this Wednesday – there are some problems with movings right now and it won’t be a really good idea… Because of that I’m thinking of taking my vacation for next week and to get some rest.

Last night I went to visit Velin (to clear my head a bit) and we listened to three songs from Tool’s Lateralus – Schism, Reflection and Triad… I won’t waste my time describing them :)

I also set up gvim for my normal text editor instead of gedit – it’s faster and much more comfortable (it wasn’t hard to make the spell check work, I just had to download one package from experimental with the spell files).

2006-09-19 11:53

September 19th, 2006 by Vasil Kolev

Мразя да ми объркват разписанието.

Оказа се, че няма да пътувам за щатите в сряда – има някакви проблеми с разместванията и точно сега няма да е особено добра идея… По тоя случай мисля да си преместя отпуската за следващата седмица и да си почина малко.

За сметка на гадостите снощи бях на гости на Велин и слушахме три парчета от Lateralus на Tool – Schism, Reflection и Triad… Няма да си губя времето да ги описвам :)

Подкарах си най-накрая gvim за нормален текстов редактор вместо gedit – по-бърз е и е по-удобен (не беше сложно и да му подкарам spell check-а, само трябваше да източа един пакет от experimental със spell файловете).

2006-09-18 19:24

September 18th, 2006 by Vasil Kolev

I’m late with the blogging this week, I’m tired…

Friday we celebrated Bobson’s birthday with a good drink-up (he made from his incredible heated wine, recipe is below) and fun (and I have an arrangement for a great over-drinking around the next st. Moneybringer).

There weren’t any more interesting events, I feel extremely tired, after I’m done with the stuff in the US I’ll be in vacation until 9th of October.

Here’s the recipe:

3 cups of water
1 cup sugar
12 pieces of clove
2 pieces of cinnamon
the peel from two lemons
750 ml of red wine
50 ml rakiya

Boil and leave simmering on low power the water with the sugar, cinnamon, clove and lemon peel in a steel pot for 10 minutes. Then add the wine, heat without boiling and add the rakiya.

2006-09-18 19:17

September 18th, 2006 by Vasil Kolev

Забавих се с блогването тая седмица, нещо съм се уморил…

В петък отпразнувахме на Бойчо рождения ден с прилично напиване (той направи от неговото велико греяно вино, рецептата след малко) и веселба (а аз имам уговорка за зверско напиване около следващия св. Паралей).

Други интересни събития май нямаше, адски уморен се чувствам, да свърша дивотиите в щатите и ще съм в отпуска до 9ти октомври.

Ето и рецептата:

3 чаши вода
1 чаша захар
12 пъпки от крамфил
2 пръчки канела
кората от 2 лимона
750мл червено вино
1/4 чаша ракия

Кипваш и оставяш да къкри на слаб огън водата със захарта, карамфила, канелата и лимонената кора в стоманена тенджера за 10 мин. Добавяш виното, загряваш без да кипи и добавяш ракията.

2006-09-14 02:46

September 14th, 2006 by Vasil Kolev

Today we celebrated chervarium’s birthday (who has grown enough :) ).

We gathered in Krivoto at the normal IBB with a lot of drinking and celebrations… Half of the company showed up, we drank, chervarium was DJ-ing a bit, then I did that, then we danced/got crazy a bit (I haven’t done this since Boyan’s wedding, I got out of air (they haven’t given me the photos from last time too)) at “Neva ceng I harbe”, and it was extremely fun…
(my legs will hurt, let’s see about the other parts of the body)

I went home with Delian, with who I spoke for 3-4 hours on thousands of topics while staying near the block – I felt somewhat guilty for keeping him awake for so long (but was incredibly interesting).

Let’s see who’ll be able to get to work today/tomorrow…

2006-09-14 02:41

September 14th, 2006 by Vasil Kolev

Днес се празнува рождения ден на червото (стига е расъл :) ).

Събрахме се в Кривото на нормалното ИББ с много пиене и веселба… Появи се половината фирма, пихме, червото пуска разни работи, после аз малко бях DJ, после потанцувахме/куфяхме малко (не бях правил такова нещо от сватбата на Боян, свърши ми въздуха (и от тогава още не са ми дали записа)) на “Neva ceng i harbe” и изобщо беше бая весело…
(ще ме болят краката определено, да видим за други части на тялото)

Прибрах се с Делян, с който си говорихме около 3-4 часа по хиляди теми докато стояхме пред блока – направо ми беше съвестно, че го държах до толкова късно (но пък беше адски интересно).

Кой ще ходи днес/утре на работа – не се знае…

2006-09-10 20:15

September 10th, 2006 by Vasil Kolev

Sunday == laziness.

I tried cleaning up my ICQ contacts list… There was some progress, from 398 people it went to 300, but it’s starting to get weird where from have I found them :) Also it’s a bit bad, because the ICQ itself has a limit of 200 contacts – adding new is somewhat working, but for some reason the moving between groups is not. I wonder how can some more people be persuaded to switch to jabber…

Some whining – it’s a common mistake for most people to take one ntp server and use use it, without seeing it disappear later. I’ve seen ntp.fau.de, time.nist.gov (which still exists, but is far away) and in a cast at where I work – at.digsys.bg (which died recently) used. I have no idea why people don’t remember that there is pool.ntp.org, whose idea is not to drown one particular NTP server…
(which reminds me that I might enter marla or zver in pool.nto.org, because there still isn’t a Bulgarian server).

It’s also known that on the 20th I’m flying to L.A., on the 27th I’m flying back…

The reading of the Risks digest is going on slowly, but is full with fun pieces, one of which I just have to republish:

A comment on UNIX and C: Ken Thompson is one of the most brilliant designers and programmers ever to grace this earth. He developed UNIX and C primarily for his own pleasure. It is not HIS FAULT that UNIX is so widely used (e.g., because of its delightful facilities for program development and ease of adaptation), or — by extension — that it is used unwisely in hostile environments despite its not having addressed critical security concerns.

And Saturday on the anime meeting there was an interesting combination from a tape player on batteries, my laptop and one extremely weird converter from stereo jack to a tape – near the statue of the soviet army on the cubical thingy I was playing some interesting things, I even enlightened some people on what Tool is :)
(and the Piano tribute turned out to be horrible. The one playing it should be banned from touching a piano)

2006-09-10 20:06

September 10th, 2006 by Vasil Kolev

Неделя == мързел.

Хванах се да си почистя листа с контакти на ICQ-то… Има напредък, от 398 човека стана на 300, но започва да ми става странно откъде толкова много хора :) Също така е и малко неприятно, понеже самото ICQ има лимит на 200 човека – добавянето на нови хора се получава, ама по някаква причина местенето м/у групи – не. Чудя се как ли мога да убедя повече хора да минат на jabber …

Да измрънкам за нещо – редовно се случва хората да си харесат един ntp сървър и да го ползват, без да се усетят като изчезне. Така съм виждал да се ползва ntp.fau.de, time.nist.gov (който го има, ама е далече), и в един случай при нас – at.digsys.bg (което наскоро изпадна нейде). Не знам защо хората не се сещат, че има pool.ntp.org, чиято идея е точно да не се дави един определен NTP сървър…
(което ми напомня, че скоро може да включа marla или zver в pool.ntp.org, че май още няма български сървър).

Финално е и ясно, че на 20ти летя за L.A., на 27 летя наобратно…

Четенето на Risks digest върви бавно, но е пълно с бисери, един от които просто не мога да не спомена тук:

A comment on UNIX and C: Ken Thompson is one of the most brilliant designers and programmers ever to grace this earth. He developed UNIX and C primarily for his own pleasure. It is not HIS FAULT that UNIX is so widely used (e.g., because of its delightful facilities for program development and ease of adaptation), or — by extension — that it is used unwisely in hostile environments despite its not having addressed critical security concerns.

А в събота на anime срещата се направи интересна комбинация от един касетофон на батерии, моя лаптоп и един адски странен преходник от стерео jack до касетка – до паметника на съветската армия на кубчестото пусках разни интересни неща, та май просветих хората и какво е Tool :)
(а Piano tribute се оказа ужасен. Тоя, който го свири, трябва да му забранят да пипа пиано)

2006-09-07 21:16

September 7th, 2006 by Vasil Kolev

Life is good…

There’s something nice in that that most of the coups and in general politically significant events in Bulgaria have happened in the autumn (mostly September), so we can rest after the summer… Wednesday I had a nice rest and came back to my senses, today was the day of st. Moneypour Cashbringer, Tuesday I and the girlfriend separated (we’ve grown tired of each other), so the week was somewhat okay :) I’m now lying in the chair with the beer and listening to Irfan…

I’m looking for the Piano tribute to Tool, does someone know where can it be found? Also the normal tribute, if someone has it :)

Today Damyan gave me the Debian t-shirts, soon a photo will follow – they’re great :)

2006-09-07 21:11

September 7th, 2006 by Vasil Kolev

Животът е хубав…

Има нещо хубаво в това, че повечето преврати и въобще политически значими събития в България са се случвали есента (основно септември), да можем да си починем след лятото… В сряда си починах и поосвестих, днес пък беше деня на св. Паралей Кинтоносец, вторник се разделихме с жената (с която сме си поомръзнали), та седмицата се оказа приблизително поносима :) Лежа си в стола с биричката и си слушам Irfan…

Търся си Piano tribute to Tool, някой да знае откъде може да се открие? Също така и нормалния tribute, ако му се намира на някой:)

Днеска Дамян ми даде Debian-ските тениски, скоро очаквайте някоя снимка – страхотни са :)

2006-09-03 12:01

September 3rd, 2006 by Vasil Kolev

These are a few small tricks I use to gather stats and see how the data looks like…

(a note – this is mostly postgresql related, but is easily ported to another database)

Let’s say we have a table in the database, which looks like a log file, with two columns – timestamp and event_id, which is integer from 1 to 5. The tasks is to get in X minute intervals what type of event happened how much times and to draw them.

The first step is the following query:

SELECT  
	((EXTRACT(epoch FROM timestamp)::int/90)*90) AS period,
        SUM((event_id=1)::int) AS type_1,
	SUM((event_id=2)::int) AS type_2, 
	SUM((event_id=3 OR event_id=4 OR event_id=5)::int) AS type_rest,
	SUM(1) AS all
FROM
	log
WHERE 
	timestamp => '2006-08-28 00:00:00' AND timestamp < '2006-08-29 00:00:00'
GROUP BY
	period 
ORDER BY
	period ASC;

(thanks to Aqua for the testing ang the notes :) )

A short explanation - period is a timestamp rounded to 90 seconds (using integer division), which we use to do the grouping. For every such period we're counting how many of each event we have with the small trick with the typecast - true is 1, false is 0, which means that if the condition is satisfied, the sum will increase. This way we're counting what' in the table with one pass through it.

Some notes for the query:

1) date_trunc can be used instead of the EXTRACT trick, but it can't round to stuff different than a minute or hour.
2) In the older versions of postgresql (before 8) by default there's not typecast from boolean to integer, but in the documentation there's an example how to create one.
3) Instead of the trick with SUM() a grouping by event_id can be used, but to be able to combine a few event_ids again some boolean trick has to be used. Also getting the whole count and solving the problem for 0 count of some event_id for some period will be harder.
4) Instead of SUM(1) in the end COUNT(1) can be used, but I don't see a big difference.
5) BETWEEN can be used in the WHERE clause, but I like this more :)

To get the data in format, useful for drawing, we need the following line:

psql -A -q -t -F ' ' $DBNAME -c "$QUERY" > data

(what the options do, you can see in the man page :) DBNAME is the database, QUERY is the query from above)

We'll have one file with the following type of lines:

1156748310 23 12 6 41
1156748400 28 21 5 54
1156748490 32 15 2 49
....

Here gnuplot comes into the game, with the following commands to make a nice drawing:

set title "Events through the day, quantised at 90 sec. (fig. 1)"
set ylabel "number of events"
set xlabel "time through the day"
plot "data" using 5 with lines title  "all", "data" using 4 with lines title  "rest", \
	"data" using 3 with lines title  "type_1", "data" using 2 with lines title  "type_1"

And with putting these two lines in the beginning it will write the thing to file:

set terminal png font VeraSe 11 size 800,500
set output "test.png"

Of course, it would be great to write the hour underneath, but I still haven't thought up a way to do it :)

2006-09-03 11:23

September 3rd, 2006 by Vasil Kolev

Това са няколко дребни трика, които ползвам за вадене на статистики и да видя кое как изглежда…

(предварително да кажа – това се отнася за postgresql, но се пренася за каквато и да е база доста лесно).
Да кажем, че имаме една таблица в базата данни, която ни е като log файл, с две колони – timestamp и event_id, който е integer и е от 1 до 5. Задачката е да извадим в по X минутни интервали от кой тип event колко са се случили и да ги нарисуваме на една графика.

Първата стъпка е следната заявка:

SELECT  
	((EXTRACT(epoch FROM timestamp)::int/90)*90) AS period,
        SUM((event_id=1)::int) AS type_1,
	SUM((event_id=2)::int) AS type_2, 
	SUM((event_id=3 OR event_id=4 OR event_id=5)::int) AS type_rest,
	SUM(1) AS all
FROM
	log
WHERE 
	timestamp => '2006-08-28 00:00:00' AND timestamp < '2006-08-29 00:00:00'
GROUP BY
	period 
ORDER BY
	period ASC;

(благодарности на Aqua за тестването и забележките :) )

Кратко обяснение - period ни представлява timestamp, закръглен до 90 секунди (чрез целочисленото деление), по който групираме. За всеки такъв период броим от кой event_id колко имаме с дребния трик с typecast-а - true е 1, false е 0, което значи, че ако условието е изпълнено, самата сума ще се увеличи, ако не - няма. Така реално погледнато преброяваме какво се среща в таблицата с едно преминаване през нея.

Няколко забележки към заявката:
1) Може да се използва date_trunc вместо трика с EXTRACT, но не може да се закръгля на неща различни от минута или час.
2) В по-старите версии на postgresql (преди 8) няма по подразбиране typecast от boolean към integer, но в документацията има някъде един пример как може да се напише тоя typecast.
3) Вместо номера със SUM() може да се ползва и групиране по event_id, но за да се обединят няколко event_id-а пак трябва да се прибегне до някакъв boolean трик. Също така ще стане по-сложно взимането на общата бройка и решаването на проблема с 0 срещания на някой event_id за даден период.
4) Вместо SUM(1) накрая може да се ползва COUNT(1), но не вярвам да има особена разлика.
5) Може да се ползва BETWEEN в WHERE клаузата, но на мен така повече ми харесва :)

За да си докараме данните във вид, подходящ за рисуване, ни трябва следния ред:

psql -A -q -t -F ' ' $DBNAME -c "$QUERY" > data

(какво правят опциите може да видите в man-а:) DBNAME е базата, QUERY e заявката от по-горе)

Ще се озовем с един файл data, в който ще имаме следния тип редове:

1156748310 23 12 6 41
1156748400 28 21 5 54
1156748490 32 15 2 49
....

Тук влиза в действие gnuplot-а, който със следната команда ще ви направи една доста приятна рисунка:

set title "Events through the day, quantised at 90 sec. (fig. 1)"
set ylabel "number of events"
set xlabel "time through the day"
plot "data" using 5 with lines title  "all", "data" using 4 with lines title  "rest", \
	"data" using 3 with lines title  "type_1", "data" using 2 with lines title  "type_1"

А с добавката на тези два реда в началото ще ви напише графиката във файл:

set terminal png font VeraSe 11 size 800,500
set output "test.png"

Разбира се, би било хубаво да можеше да се напише и часът отдолу както си трябва, но още не съм измислил как :)