Serialization choices

I’ve been recently looking into different serialization options. While there are plenty of writeups (even in C#) already available, I wanted to: Have one about C# Learn something new 😉 Look into my particular data distribution / characteristics Understand not only performance, but also size impact I’d say that there are very few summaries that you should ...

Programming Atmega 328P-PU using Raspberry Pi (B+)

Programming Atmega 328P-PU using Raspberry Pi (B+)
[I am new to microcontrollers – whatever I’ve written worked for me, but proceed at your own risk] I wanted to start playing with a little bit of home automation. I recently got RaspberryPi. I also got a few Atmegas 328P-PU (much cheaper than complete arduino! $1.7 each). However… I am still waiting for my ...

A few words about (unit) testing

Purpose of testing I think every developer knows something about different types of testing (unit, integration, functional / acceptance, regression, etc.). Add to this performance testing, black-box testing and you get sizable family of possible tests to write. If you start differentiating UI testing as a separate functional testing, the family grows even more. First ...

Reasons to avoid Try/catch/swallow block

Reasons to avoid Try/catch/swallow block
This question has been asked multiple times before: why is “try { … } catch {}” a bad practice? ([0], [1], [2]). All of those answers are good, but I would like to address this issue from slightly different points. By no means I am trying to say to avoid throwing exceptions when invalid state occured. ...

cn=admin,cn=config password and bdb_equality_candidates: not indexed 1

So you want to modify your config of ldap, you might want to use ldapvi, such as below: ldapvi -h ldap://localhost -D cn=admin,cn=config -b cn=config --- Login Type M-h for help on key bindings. Filter or DN: cn=admin,cn=config Password: ldap_bind: Invalid credentials (49) and it asks you for password. You have no clue what the ...

Ruby – Regex – Special characters

“There ain’t no such thing as plain text”. Joel Spolsky (what every developer must know about unicode). This text is based on the assumption, that current locale uses UTF-8 encoding. Behavior might differ for other encodings. I use Ruby 2.0 for evaluation. I was recently doing some text parsing in my native language (which is ...

find & chmod & xargs – changing uid of files

Because of the system reinstallation & user ids remapping, I wanted to update all of the files from given UID to new UID. One of the ways to do this is to find all files with given UID and perform chown on these files. You could do this one by one, by find . -uid ...

RSnapshot – migrate to other drive

Once you start using rsnapshot and you haven’t thought about increasing hard drive requirements, you didn’t setup LVM, you might want to migrate yours rsnasphot directory to bigger drive, preferably under LVM. You might see how to setup LVM here When it comes to migrate your current rsnapshot backup to other drive, you have two ...

Obtaining UUID of partition

To get UUID of the partition /dev/sdc3, run: blkid /dev/sdxx You might use it to create /etc/fstab entry for this drive, if you can expect that it might get different letters of drive (for example it is USB drive)

BadBlocks checking

Want to be sure new drive is fine (has no badblocks?) Run badblocks -wvs /dev/sdx (might take ~50 hours on 3TB HDD). It will write down specific patterns on HDD, verifying them (four different patterns for whole drive). It will wipe out your data on sdX