Force update ttf-dejavu posted on 09 November 2016

On archlinux, ttf-dejavu 2.37 requires a forced upgrade. If you don’t, you will be greeted with this error:

[email protected]:~$ sudo pacman -S ttf-dejavu
[sudo] password for michel: 
resolving dependencies...
looking for conflicting packages...

Packages (1) ttf-dejavu-2.37-1

Total Installed Size:  9.75 MiB
Net Upgrade Size:      0.57 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                                              [########] 100%
(1/1) checking package integrity                                                            [########] 100%
(1/1) loading package files                                                                 [########] 100%
(1/1) checking for file conflicts                                                           [########] 100%
error: failed to commit transaction (conflicting files)
ttf-dejavu: /etc/fonts/conf.d/20-unhint-small-dejavu-sans-mono.conf exists in filesystem
ttf-dejavu: /etc/fonts/conf.d/20-unhint-small-dejavu-sans.conf exists in filesystem
ttf-dejavu: /etc/fonts/conf.d/20-unhint-small-dejavu-serif.conf exists in filesystem
ttf-dejavu: /etc/fonts/conf.d/57-dejavu-sans-mono.conf exists in filesystem
ttf-dejavu: /etc/fonts/conf.d/57-dejavu-sans.conf exists in filesystem
ttf-dejavu: /etc/fonts/conf.d/57-dejavu-serif.conf exists in filesystem
Errors occurred, no packages were upgraded.

Make sure to run pacman -f for this package.

[email protected]:~$ sudo pacman -S --force ttf-dejavu


Incomplete kernel update posted on 30 October 2016

These are quick notes about fixing my system after an incomplete kernel update.

During a system update, my workstation suddenly shut down (hardware failure). I was working on something else during the update, so I had no idea when the update was aborted. When I tried to boot again, I was greeted with this error:

Warning: /lib/modules/4.8.4-1-ARCH/modules.devname not found - ignoring.
starting version 231
ERROR: device 'UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' not found, Skipping fsck.
ERROR: Unable to find root device 'UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.
You are being dropped to a recovery shell
    Type 'exit' to try and continue booting
sh: can't access tty: job control turned off
[rootfs ]#

At that time I thought that one of my harddrive died. Digging a bit into it, the partition that couldn’t be found was an encrypted one. So I thought that maybe my fstab got somehow corrupted. I didn’t have access to a shell after booting as the keyboard was not working, so I just booted with a live usb key. My disks are all encrypted, so the first step was to decrypt them:

Confirm that they are indeed crypted:

blkid | grep crypto

Decrypt/mount the partition:

cryptsetup luksOpen /dev/sdc2/ crypt

You then can’t just mount /dev/mapper/crypt. If you try, you’ll get:

mount /dev/mapper/crypthome /mnt/crypt
mount: unknown filesystem type 'LVM2_member'

Find the group of your volume (mine was main):

vgscan

Find the name of the volume (mine was root):

lvs

Mount it:

mount /dev/main/root /mnt

In my case, /boot is not encrypted, so I also had to mount it to be able to look at my kernel.

mount /dev/sdc1 /mnt/boot

Then I just used chrooted:

arch-chroot /mnt

I thought that the issue might have been in the initial ramdisk environment, so I just ran:

mkinitcpio -p linux

I was greeted with quite a few warnings that some modules were not found. But all the modules for encryption was present, so I decided to just reboot. Some progress were made: I could decrypt my disk, but was then greeted with:

mount: unknown filesystem type 'ext4'

I booted on the usb key again, and looked a bit at my modules. That’s when I found that uname -r was giving me an old kernel version. Trying to reinstall the linux package was returning an error because the desc file was missing. I guess my update was interrupted during the kernel update.

Removing the package and re-installing it did the trick. Note that pacman -S --force was not enougth to prevent pacman from complaining about the missing files.

pacman -R linux
pacman -Sy linux
mkinitcpio -p linux

My RethinkDB story posted on 08 October 2016

RethinkDB recently announced that the company behind the database is shutting down. In the last few days, many people have started to write about RethinkDB; the article about open source companies from William Stein, author of SageCloud, is probably the most interesting. Today, I would like to share a different story - my personal one with RethinkDB.

After graduating from Tsinghua (Beijing), I was looking for a new country to live in and eventually settled on moving to California. I sent a plethora of emails and eventually participated in a HackerRank competition where I ranked 17th (or was it 13th?). I then got the opportunity to interview at RethinkDB. After a few calls, I got a job offer from RethinkDB; this was my first job.

My first days at RethinkDB were wonderful. We were developing on a local/shared server because building RethinkDB is quite CPU intensive. This is how I really learned how to quit vim. One of my most vivid memory of that time is the day Slava asked me if we should just fork CoffeeScript (CS) after getting bitten by another bug - This was in CS early-ish days, version 1.3.x. While we eventually did not end up forking CS, Slava’s suggestions felt like an easy thing to do and made me realize that while I was a good programmer, I had much more to learn.

Thosee early days were also great because RethinkDB, as a NosQL database, was not yet public. We were moving extremely fast without doing code review, while maintaining a high code quality, thanks to a strong sense of ownership. The web interface became more polished and the data explorer turned out amazing once we added suggestions and auto completion.

Launch day was incredible. We spent the whole day just answering questions. The feedback on the web interface was extremely positive. To this day, I still sometime wonder if the web interface was too shiny; people did not realize how great the database engine under the hood was. The tremendous amount of positive feedback just fueled our passion even more. We kept working hard on it, polishing edges, adding new features etc.

We had great discussions about ReQL. One of the most interesting one I can remember was about the group command that replaced groupedMapReduce. We all had different opinions on what would be best for our users - I wanted the scope of chained command to be always the same as the parent. The sheer amount of thoughts poured into ReQL made it the best query language available. Nowadays, a little part of me cries every time I have to write a SQL query for work.

Jessie started to work at RethinkDB about 2 years after I joined. We had a lot of fun. I couldn’t help but be amused when I learned that she ate a box full of bacon for breakfast. We started to date after a few months and got engaged a few weeks ago!

After about 2 years and a half, I made the hard decision to leave the team for another company. Even though I was not employed by RethinkDB (technically Hexagram 49 Inc), I always kept RethinkDB in my heart. I kept maintaining rethinkdbdash and thinky, refactored reqlite to support r.http which involved making all the internal operation asynchronous etc.

Horizon then came out, and boy, that was a really good project. I couldn’t help but notice that it wasn’t gaining traction fast enough, and the sad news that RethinkDB was shutting down eventually came out. While the company is gone, I am convinced that the database will live beyond. This is nothing more than a new chapter for RethinkDB and I am excited to see what will happen next.

Slava, Michael, all the team, I took pride in crafting part of RethinkDB, in supporting our users, and I enjoyed every bit of sailing with all of you. My time at RethinkDB was amazing; I have nothing but great memories from working with all of you.

Lock with XSecureLock after suspend posted on 22 May 2016

To lock your computer with XSecureLock after suspend, create a new systemd service at /usr/lib/systemd/system/xsecurelock@.service

[Unit]
Description=Lock X session using xsecurelock
After=suspend.target

[Service]
Type=simple
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/%i/.Xauthority
ExecStart=/usr/bin/xsecurelock auth_pam_x11 saver_blank

[Install]
WantedBy=suspend.target

Enable it with sudo systemctl enable xsecurelock@<user>.service.

Then make sure you suspend your computer with systemctl (sudo systemctl suspend) and not directly with sudo pm-suspend. If you don’t systemd won’t trigger your service after suspend.