Páginas

quarta-feira, 11 de janeiro de 2017

Expanding the Coding Dojo Brno!

I believe that learning computer programming is a continuous process that involves deliberate practice and gradually pushing yourself into mastering new skills.

There are also important social skills involved, like team work and communication.

In a coding dojo meeting, we work as a self-organized group to learn and share knowledge by following certain principles and practices. We practice:
  • collective problem solving 
  • Test-Driven Development 
  • pair programming 
  • baby steps 
  • code refactoring 
  • and others... 
We also keep everybody in the loop, making the environment inclusive and welcoming for people with all sorts of background. It is a collaborative community, not a competition.

All that happens while we solve computer programming exercises (called "katas") in a programming language of our choice.

A bit of history

Coding dojos started to appear around the globe throughout the boom of Agile development. The ParisDojo was founded back in December 2004, and then, four years later in December 2008, with the help of an awesome community of developers, I've founded the Coding Dojo Rio. The community is so amazing that it has grown non-stop and holds regular meetings every week for over 8 years now.

Last January, with two colleagues, I started the Coding Dojo Brno group here in Brno. We held over 40 meetings in the Red Hat office in the year 2016, and, though we've always been an open-to-all group, we've had limited participation from the external community. This year we're finally expanding, and we'll be holding meetings in a new venue, a room in the Masaryk University's Faculty of Informatics, starting next week.

We're also trying to gain more visibility through a Facebook group: facebook.com/groups/CodingDojoBrno.

If you are interested in programming, knowledge sharing, agile, TDD, etc, get in touch and come to one of our next events!

Go workshop and coding dojo in Brno

Later this month the Golang-Brno community starts its activities in 2017 with an introductory workshop and coding dojo, followed by a regular meetup with talks:

More info:


I'll facilitate the workshop. The idea is to help people understand the basics of Go by following the official tour, and then put everyone to code in a randori coding dojo, where we'll use the testing package and the go tool to write automated tests and small programs.

sexta-feira, 6 de janeiro de 2017

Configuring keyboard repeat rate on Gnome 3

It's been some years that I use a rather fast keyboard repeat interval. With a well tuned delay, it just seems to make a lot more sense to the programmer in me.

It allows me to focus on navigating the screen in more effective ways, like word-by-word instead of char-by-char, and also makes it quick to repeat keys when you intend to do so, like typing:

--------------------------------------------------------------

Can you type that without feeling like watching a slow motion movie?!

I don't really know when I started doing it, nor the original motivation. I think when I met Tim Ottinger in a coding dojo in Beijing he mentioned how frustrated he got whenever he touched somebody else's slow keyboard on a workshop or some other event, and would immediately suggest and show how to change the key repeat rate settings.
So it might have been Tim, or might have been someone else in that story, but the story is true :P

Last year, doing coding dojos in Brno, I've noticed the opposite feeling in people touching my "fast" keyboard... they often get so scared when they unintentionally seeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee

Phew!

If you think fast key repeat rate is for you, here is how to set in in Gnome 3 (for reference, works on Fedora 25).

First, inspect your current settings:

$ gsettings list-recursively org.gnome.desktop.peripherals.keyboard                                        
org.gnome.desktop.peripherals.keyboard repeat-interval uint32 0
org.gnome.desktop.peripherals.keyboard delay uint32 500
org.gnome.desktop.peripherals.keyboard repeat true

I've set the repeat-interval to the fastest value, 0. And the delay is just the default, 500ms. The repeat value controls whether keys repeat or never repeat.

Set each key to your preferred value with the command:

$ gsettings set org.gnome.desktop.peripherals.keyboard KEY VALUE

Replace KEY and VALUE with the appropriate key and value.


Note: the same configuration is available in a graphical interface in Gnome Settings > Universal Access > Typing > Repeat Keys. Unfortunately, with that interface you only have dials, and no way to enter precise values or to inspect the current values.
If you want to do it with a graphical interface and have precise values, you can install and use the package dconf-editor.

Update: after a reboot I realized that the minimum usable value for repeat-interval is 1. It was apparently okay to set it to zero, but after a reboot I could not login on a Wayland session (crash caused by a division by zero...), while Xorg would let me login, but with the keyboard settings silently defaulted (though gsetttings and Universal Settings would still display the values I've configured).
https://bugzilla.redhat.com/show_bug.cgi?id=1413305

segunda-feira, 2 de janeiro de 2017

Backing up entire disks and making .img files smaller

As part of migrating to a new laptop and backing up an entire disk partition, here I document what I have done.

Creating full disk images

Work from a Live USB with Fedora 25 or any other modern distro, so that the partitions that will be backed up are not in use.
Use the Disks utility to create a disk image of some partition, e.g., the original /home.

This will create a .img file as big as the partition size, independent of how much data is actually stored. Next, we shrink the image to a minimal size to fit the data it contains, potentially saving some backup space.

Shrink disk image to its minimal size

If all you have is a single partition image, as created in the step above, we can use a loop device and the resize2fs utility to make the image smaller.

First, we'll find an available loop device with:

sudo losetup -f

Note down the name of the loop device, e.g., /dev/loop1, and use it in the next steps.

Mount the image:

sudo losetup /dev/loop1 'Disk Image of ... .img'

And resize it to its minimum size:

sudo resize2fs -Mp /dev/loop1

The -M flag resizes the image to the minimum size; while -p prints progress information.
Be patient, resize2fs may take some time depending on the partition size, disk speed, etc.

Note: if you get an error from the command above, it might be needed to run this before running resize2fs again (the error message will tell):

sudo e2fsck -f /dev/loop1

When resize2fs finishes, unload the loop device:

sudo losetup -d /dev/loop1

Finally, run resize2fs on the .img file to resize it:

resize2fs -Mp 'Disk Image of ... .img'

This should be relatively fast.
We're done! Check the new image size.

domingo, 1 de janeiro de 2017

Get a list of all RPM packages installed

New year, time to start with a fresh install of Fedora 25...
While dnf has worked really well for in-place upgrades, this time I went with a migration into a clean install on new hardware.

This is what I used to get a list of all RPM packages installed, so that I can reinstall on the new system:

sudo dnf --disableexcludes=all repoquery --qf '%{name}' --installed | sort