Thursday 9 December 2010

Back after the operation

As I said more than a week ago I was about to undergo an operation.

Now, 10 days after the operation I must say I am still not 100% recovered and I experience a weird sensation as if the nose is way too empty, especially the left nostril. During this period since the operation I have been experiencing head aches, and an almost continuous sensation of an empty left maxilar sinus, the side on which the cyst was before. This sensation is amplified after a nose blow or after the regular nose post-op cleanings.

I hope this is not Empty Nose Syndrome.

Tuesday 23 November 2010

This was a ton of fun

This past saturday I passed by this man in the park. He was calling and feeding some squirrels.



He was kind enough to give me some walnuts to call the squirrels myself. He did this without even me asking.



It was such a wonderful experience for me, especially since the last squirrel gently touched my index finger while trying to get the walnut from my hand. Its paw was so cold and it felt very smooth and gentile.

I don't know when, but I will definitely go with a bag of walnuts of my own and spend some time there.

Tuesday 16 November 2010

An operation is due

I have been experiencing pains and discomfort for some time now due to a cyst inside one of my left sinuses. Next week I am scheduled for an operation to remove it. After that I will have another operation in order to reduce (but hopefully eliminate snoring).

I am a little scared. I am especially scared about the possibility the anestesic would numb me but not turn me unconcious of the pain.

Sunday 31 October 2010

HP All-in-one models - the way to extort money

Dear HP,

I bought a HP Photosmart C5380 All-inOne multifunctional unit. It is supposed to be a printer, a scanner and a copier, being able to print on paper, CDs, DVDs and photopaper.

First of all I dislike the way you force me to buy new ink cartridges even if there is still ink in the current cartride. I hope somebody reverse-engineers as soon as possible your 364/364XL cartridge chips so I can use my printer at a price lower than that necessary for a tank fill for my car!

Second, even if one of my cartridges is „missing or defective”, the previous one, the empty one which the current one replaced, is definetly OK, so fuck you and your money extrosion schemes.

Third, and the reason for this rant, is that even if ALL the cartridges are empty, I should be able TO USE THE FUCKING SCANNER FUNCTION, since it doesn't depend on the fucking supposedly missing ink! But I can't because you decided that scanning probably needs ink, otherwise I don't understand why would you block the functioning of the whole unit because of some presumed missing ink issue.

I should probably return this device and ask my money back because of this and when they deny this to make a huge scandal about it.

So, HP, FUCK YOU, you well dressed money extortionists!

Thursday 7 October 2010

Under the weather...

I've been having a cold for a week now. Horrible. My plans of jogging regularly have been messed with by this inconvenience. I hate caughing.

Monday 13 September 2010

Fixing a bookmark corruption in Iceweasel/Firefox

At some point in the past my bookmarks broke in such a way that I wasn't able anymore to alter in any way the bookmarks, deletions, additions, reorganisation, nothing worked.

Way before this event I set up a git repo in my .mozilla directory and committed everything in the directory (except obvious cache files and such) in the repo. I didn't make a cronjob with this since I didn't thought of a proper way to make sure the browser wasn't started (the data might have been inconsistent at commit time), and, since most of the time I have the browser started, it seemed rather useless to try to automate for a very, very small window of time when the browser data would be in a consistent state. As a consequence, I did occasional manual commits in the git repo.

When the bookmarks issue appeared I realised that my last git commit was so old that it didn't made any sense to try to restore since I would have had lost bookmarks, passwords and plugins. So I made a checkpoint commit os the broken profile and resorted to all sorts of manual attempts at fixing the issue, but all my efforts of playing with the bookmarks.* files proved to be useless.

I concluded that icewesel/firefox 3.5.x was using some other mechanism and decided to dig into the issue at some latter time when time allowed me to analyse and fix it. Today was that day.

I began by creating a backup for the bookmarks via the Bookmarks Manager export function. After a hickup, it managed to save a proper bookmarks.html file. I tried to import that file, but the breakage remained.

Then I decided I should prepare for the worst, installed an addon which allowed me to save all stored passwords and created a new account (started firefox from the command line with 'firefox -ProfileManager') with the intention to transplant files from the old files into the new one. Short after that I realised that it would be smarter to commit the new profile, too, import the bookmarks from the backup file and replace the touched files back into the old profile.

After the import and closing the browser, git informed me that the modified files were:
XPC.mfasl
XUL.mfasl
cookies.sqlite
localstore.rdf
places.sqlite
pluginreg.dat
urlclassifier3.sqlite


At this point the modification of the binary .mfasl files looked very ugly to me, but I had a hunch that the only relevant file to my problem was the places.sqlite file and I went on to check the contents of the file with sqlitebrowser. After inspecting also the urlclassifier3.sqlite file (whose contents were unreadable), I decided to give it a try at simply placing the places.sqlite file in the old profile and see if the problem would be fixed that way. After all, I had the whole profile's state in git so any breakage could have been undone easily.

I started firefox using the old profile and the problem was fixed. Yay!

Now I have my bookmarks back and a suggestion for the mozilla people: please don't keep useless files like bookmarks.html in the profile once they become outdated, they are misleading.

P.S.: I still have to think of a way to make automated sane commits. Maybe I'll try to make an iceweasel/firefox addon. This could be a nice idea since I could learn something new, too.

Wednesday 25 August 2010

[content:lang:ro] I wrote to my representative

This post concerns Romanian politics, internal affairs and improper direction of public funding for new hideous churches in spite of education, culture, health, technic development and old monuments. Thus I will write this in Romanian. Curious foreigners can try to read the text via Google's translation.




Din cauză că suntem în secolul XXI și consider că e o prostie imensă să băgăm bani în biserici în detrimentul educației, culturii, sănătății, dezvoltării tehnice și a vechilor monumente, iar politicul din România pare dornic să dea bani cultelor, am ajuns la concluzia că este cazul să-i scriu reprezntantului meu (teoretic) în Parlament, Deputatul Florin Iordache. Am aflat de ce colegiu aparțin uitându-mă aici și apoi în lista oficială cu deputații.




I-am trimis textul de mai jos:

Mă numesc Petrișor Eddy și sunt unul dintre cei pe care îi reprezentați în Parlamentul României. Este pentru prima dată când scriu unui parlamentar care mă reprezintă în conducerea statului român și o fac pentru a-mi exprima în mod clar și răspicat ideile și opinia în ceea ce privește subiectul pe care îl voi discuta mai jos. Am 30 de ani, sunt programator, am muncit și mi-am plătit taxele de când am fost angajat, din anul 4 de facultate până în prezent, adică de vreo 6-7 ani. Nu, acest mesaj nu este un strigăt de ajutor, nu aștept pomeni, nu am milogit niciodată, mereu am muncit deși văd că pentru unii parazitismul fiscal a devenit un mod de viață. Din acest motiv sunt revoltat.

Sunt revoltat pentru că:
- deși plătesc taxe și impozite care ajung la peste 60% din venitul brut, nu primesc în schimb nici un fel de servicii, nici un fel de infrastructură, nici un fel de respect, nici un fel de eficiență
- deși lucrez de ceva timp, am observat că pe unde am lucrat competența și performața erau o necesitate; în aparatul de stat nu este cazul
- deși sunt destui ca mine care plătesc taxe și impozite, vocile noastre sunt ignorate și banii noștri sunt aruncați pe fereastră de cei ce administrează fondurile colectate.

Domnule deputat sunt revoltat că de 15 ani de zile dispar în medie aproximativ 4 școli zilnic și apare, tot în medie, o biserică la fiecare 2 zile, iar asta se întâmplă cu accepțiunea aparatului politic. Spitalul din Caracal, ca orice alt spital din România, e prost dotat, nu există personal suficient, nu are fonduri pentru medicație pentru pacienți, pe scurt, este un dezastru care e pe cale să se întâmple. Și cu toate astea, banii se duc spre biserici. Se fac donații de școli și terenuri către biserică, în mod ilegal și abuziv chiar în județul Olt.

Ultima perioadă în care religia a condus lumea s-a numit Evul Mediu și cred că orice om care a trăit măcar 5 ani în secolul XXI poate să observe că nu religia ne-a adus mari beneficii, ci știința și tehnologia. În Evul Mediu „tratamentul” se făcea prin „sângerări”, „tăieri sub limbă”, „scoaterea argintului viu” și tot felul de alte superstiții fără nici un efect pozitiv sau chair cu efecte negative.

Între timp umanitatea a progresat și am descoperit medicina, curentul electric, am explorat universul, am aterizat pe Lună, am pus zeci de sateliți artificiali pe orbită, am aflat foarte multe despre univers și lumea care ne înconjoară, am inventat noi materiale (plasticul, pânzele impermeabile, kevlarul), am investigat lumea fără idei preconcepute după metoda științifică, iar lucrul acesta ne-a îmbunătățit viața în toate aspectele ei. Sperantă de viață a crescut de la aproximativ 30-40 de ani în Evul Mediu, la 70-80 de ani în prezent, totul datorită științei aplicate. Datorită tehnologiei și științei pot să vă scriu aceste cuvinte și știu că vor ajunge la dumneavoastră, nu datorită unor incantații sau ritualuri, nu datorită telepatiei, deși mediul ăsta de transmisie se apropie foarte mult de ceea ce definește ca fiind telepatie :-) . Cu toate astea, unii consideră că religia trebuie finanțată pentru că e religie, nici măcar pentru că ar avea programe sociale, contribuții cuantificabile reale, nu, doar pentru că este religie.


Am citit foarte multe articole din presă, articole bine documentate, și am senzația că trăiesc într-o lume inconștientă când văd cum banii care ar trebui să ajungă în drumuri, școli, spitale, cercetare, medicamente, programe sociale cu real impact, ajung în noi și noi biserici de beton în timp ce monumentele istorice, bisericile din lemn, mănăstirile cu adevărat valoroase sunt lăsate în paragină. Asist cu o senzație de dezgust continuu la felul în care ne batem joc de cei ce ne salvează viețile, medicii, de cei ce ar trebui să ne facă educația, profesorii, de cei ce ne sting casele dacă iau foc, pompierii, și, de felul în care ridicăm misticismul religios la rang de virtute. Este de-a dreptul jignitor și aberant ca alfabetizarea științifică în secolul XXI să fie atât de joasă încât să avem 42% din populație care cred că Terra este centrul universului, să avem oameni care cred că astrologia este științifică, să NU avem nici măcar o universitate în top 500 în lume, este jignitor să fim în permanență în coada tuturor clasamentelor pozitive și în fruntea tuturor celor negative.

Recent money.ro a publicat un articol în care esitma foarte conservator că averea Bisericii Ortodoxe Române se învârte la peste 3 miliarde de euro, are scutiri de impozite, are zeci de afaceri și cu toate acestea, statul continuă să scutească cultele de impozite, ba chiar le oferă bani într-una. La o asemenea avere nu cred că mai poate fi vorba de necesitatea finanțării de către stat. Oamenii pot decide să doneze direct către bisericile lor bani și nici nu mai implică pierderile inerente ce apar datorită administrării fondurilor de către stat.


Statul nu este un organ aparte, statul trebuie să muncească pentru mine, cetățeanul, iar eu sunt împotriva acestui tip de batjocorire și înapoiere voluntară a noastră îndreptată împotriva noastră. Alexandru Ioan Cuza a secularizat averile mănăstirilor închinate celor de la muntele Athos, deci unor terți extreni țării, așa cum aflăm din scrierile istoricului A.D. Xenopol, deci nu există nici o obligație a statului să finanțeze o instituție anacronistică:

A.D. Xenopol „Domnia lui Cuza Vodă Vol.I”, „CAP. VIII. AI doile minister Cogalniceanu Secularizarea”, pagina 291:
«Nu vom atinge de cît împrejurările care au condus la redobîndirea averilor, ajunse în stăpânirea călugărilor străini, atingînd chestiunea închinărei mănăstirilor pănîntene către acele din Răsărit, numai întru cît va fi de nevoie, spre a înțalege măsura secularizărei însuși.»


Din aceste motive și multe altele, deoarece sunteți și reprezentantul meu în Parlamentul României, vă cer ca să votați pentru proiectul de lege inițiat de domnul Prigoană în ceea ce privește tăierea finanțării personalui clerical de către stat și cât și a altor legi care ar putea duce la eliminarea privilegiilor pe care le au cultele, în condițiile în care singurul motiv real și corect pentru care o entitate ar putea beneficia de scutiri de taxe sau privilegii fiscale sunt doar cele ce nu urmăresc interesul financiar și, totodată, au un impact social cuantificabil în mod clar.


Dacă doriți, aș fi bucuros să vă răspund la eventualele întrebări sau neclarități în ceea ce am scris, dacă este nevoie.

Vă mulțumesc anticipat!


L-am trimis joi, încă n-am primit răspuns de nici un fel. Pasul doi e să sun. Măcar să înnebunească dacă tot sunt nesimțiți. Așa că, puteți afla de ce colegiu aparțineți și apoi puteți identifica pe cel/cea ce vă reprezintă în Parlament. Scrieți-le, sunați-i, a venit momentul măcar să se enerveze, dacă nu să-și facă măcar o poleială de datorie.

Thursday 19 August 2010

OpenLDAP and Active Directory - authentication issues

At some point I had to debug an issue with some code I worked on in the past. It was using OpenLDAP to connect to an Active Directory server to get some information. At some point I got a report that the authentication failed with an ugly error.

Username is stored. Authenticating as domain\user.
Enter password:
ldap_search_ext: Operations error (1)
additional info: 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece

I looked for the meaning of that error and after some staring at different possible explanations, I ended up on a page dealing with some python-ldap code. My code was in C, but it was clear it was the underlying library issuing the error message, so I looked at what it said:
Normally, this error indicates that you're attempting to bind anonymously, which Active Directory (sensibly) doesn't allow by default. We were supplying credentials to bind, though, and changing the base DN on the search to a sub-OU was all that was necessary to get the search to work. It turns out that python-ldap was binding anonymously, so the error was only sort of a red herring.
This was really strange because the authentication was actually done, as it was obvious from the messages and the traffic (analyzed with wireshark). Later in that post there were some hints that indicated that parts of the data might be stored on another server and the suggested fix was to instruct the library not to try chase referrals.
ldap.set_option(ldap.OPT_REFERRALS, 0)
I tried to see what was going on with our server using a ldapsearch command and at the end of the output there were some referrals specified.

[..]
# search reference
# refldap://ForestDnsZones.domeniu.ro/DC=ForestDnsZones,DC=domeniu,DC=ro

# search reference
# refldap://DomainDnsZones.domeniu.ro/DC=DomainDnsZones,DC=domeniu,DC=ro

# search reference
# refldap://domeniu.ro/CN=Configuration,DC=domeniu,DC=ro

# search result

# numResponses: 5
# numEntries: 1
# numReferences: 3
Bingo! So, after looking at the man page, I added this bit of code:

+ /* do not chase referrals */
+ if (ldap_set_option (ld,LDAP_OPT_REFERRALS,LDAP_OPT_OFF)!=LDAP_SUCCESS) {
+ ldap_perror(ld,"ldap_set_option");
+ return NULL;
+ }
+

And then it worked. I hope this helps others that might be in the same situation as I was.

Friday 26 February 2010

How to: git push via ssh; alternative users on the same host

Let's assume you're part of a project X that uses git for version control on a server host.it. Due to historical reasons your login on machine host.it is 'eddyp'. You're also part of another project Y which is hosted on server host.me. In this project you have always used 'eddy' as your ssh login for the git push.

Now, project Y decides to change hosting and moves the repo on server host.it. Since the logins were also migrated, now you have login 'eddyp' for project X and login 'eddy' for project B.

You changed the URI in remote.origin.url, but you are faced with this error when pushing from project Y to server host.it:

Counting objects: 7, done.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 476 bytes, done.
Total 4 (delta 2), reused 0 (delta 0)
error: unable to create temporary sha1 filename ./objects/56: Permission denied

fatal: failed to write object
error: unpack failed: unpacker exited with error code


The problem is that you are probably trying to login with 'eddyp' on server host.it from project Y since you ~/.ssh/config contains a 'user eddyp' clause for host host.it.


You can avoid this problem and identify to server host.it with different logins depending on the project via a small nice trick using fake hostnames in ~/.ssh/config:


Host eddyp.host.com
User eddyp
Hostname host.it

Host eddy.host.com
User eddy
Hostname host.it


And setting the remote.origin.url setting accordingly in the repo for project Y and project X:


eddy@projx $ git config remote.origin.url ssh://eddyp.host.it/srv/git/projx.git

eddy@projy $ git config remote.origin.url ssh://eddy.host.it/srv/git/projy.git

Friday 15 January 2010

Busy, busy, busy and lazy me

It has been quite some time since my last post. I have been involved in quite a few things and the last part of 2009 which left no time for anything else. At the begining of 2010, just to set things on a good tone from the new year, I went on a snowboarding vacation to Austria to Kitzbühel.

Presidential campaign and pure irrationality in Romania

I got involved in Remus Cernea's presidential campaign, which was quite a success, considering the media blockade he was subject to. Unfortunately, Romanians seem to more and more indoctrinated, idiotic and gullible, probably thanks to newer generations that come through public schools after 12 years of religious indctrination and media promoting stupidity, non-values, ignorance and so on.

The more I live in this country, the more I realize how I don't feel like fitting in, because I refuse to be a mindless sheep, a moron, listening to anything the news at 5 say (those living in Romania know what I mean). I obstinately form my own ideas and question everything.

Significant event in my life

In September 2009 a life-turning event took place in my life - don't worry, is nothing bad, is pure good - and my eyes opened entirely. I have bacame a sponge trying to know more and more and this has helped me see the world with new eyes, from a new perspective, without lies or preconceptions.

Now I am thingking freely.


I am sorry for not going into details, but I have my reasons. Those who have the eyes and brains to understand what I am talking about, surely have understood by now what has happened to me ;-) .

Snowboarding vacation

At the begining of this year I went with my wife and some friends to Austria for a vacation. Kitzbühel's slopes and conditions were very good (bad points were only due to a couple of areas where snowboarders had to open at least one binding).


View Larger Map

Weather was good and snow was icy only late in the afternoon. I was quite suprised to see stores close at 6pm, but overall, it was a well deserved vacation and I enjoyed it very much. My wife's skills on the board got better, although the third day some beginner skyer broke one of the bindings of my wife's snowboard and she had to use a rental instead. The rental was a quite new Burton board and Otilia got used to it and liked to the extent that we decided the next board we buy (for either of us) will be a Burton.

Did it worth it to drive 1500 km (roughly 1000 miles for the metric system challenged people :-P) for this vacation? Definitely! Did I enjoy the drive? Well, let's just say that the 950km from Kitzbühel to the Romanian border were made in approximately the same time it took us to make the last 550km to Bucharest, while 110km of those last were on the A1 "highway".

I'll probably put some photos from my vacation somewhere on the intenets, but don't hold your breath :-P .

Instead of conclusions

I know I promissed a lot of people to take care of some things like Wormux and some kernel bug debugging and I didn't kept my promise. I appologise, yet I don't expect anyone to accept my appologies. I am still unsure when I'll get back to that. I still care for Debian, yet the day has only 24 hours and I have to use at least 7 of those on sleep.