Páginas

Friday, January 6, 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

Monday, January 2, 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.

Sunday, January 1, 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

Monday, March 14, 2016

PyCon SK 2016

This is a brief report of my weekend in Bratislava, at PyCon SK, the first [inter]national Python conference in Slovakia!


On Saturday I gave a talk about OpenShift -- Docker and S2I builds, and deployment automation with our PaaS.




Thanks to my new Turkish friend Büşra for tweeting my photo!

Personally I always feel like there's something to improve, but the feedback I got was positive ;)
People were interested, asked several questions after the talk and I kept meeting people interested in OpenShift and Red Hat in the corridors throughout the day and on Sunday as well.

Thanks everybody for the conversations, it was a perfect weekend!

There was a live stream on YouTube, I imagine the recording should be out sometime soon.


Shadowman made an appearance in my arm during the conference:


And, actually, it's still with me today, Monday ;)


Also on Saturday I gave a lighting talk with Tatiana to promote the Coding Dojo we did on Sunday.
Tatiana was fantastic at improvising with me in the stage! We had a spontaneous conversation talking about Coding Dojos that drove the attention of many people.

Thanks to that we learned that Nick is organizing the London Dojo, and perhaps will partner with Tatiana in the near future to keep moving their dojo forward, bringing in some Brazilian taste to the mix!


Sunday was awesome, or, to put it in the words of the feedback I got: it was INCREDIBLE FUN.

That day was left open by the organizers for spontaneous activities... and guess what gathered the most people together? The Coding Dojo!


It was definitely a chance to inspire and be inspired! Gather together about 50 people in a Sunday morning? Not trivial.
We ran three sessions with a retrospective in the morning and in the afternoon.



Even after what I call "self selection", we got down to about ~20 people who actively participated and engaged in coding, expressing their ideas, overcoming their fears and difficulties.

That's the power of building communities. I'm looking forward to hearing that the Slovaks in Bratislava will start their own meetings :)
I met a fantastic group from the Python community of Viena, and I'd definitely love to join them in the near future.


That's about it, a lot of informal conversations about Red Hat, how we develop OpenShift, open source, coding dojos, Brno, Turkey, Brazil, Functional Programming, etc etc.

What a great conference!

Friday, April 17, 2015

Let's open source



This has been a fantastic week for me. Last Wednesday I joined the OpenShift Developer Experience team in Red Hat.
New life in Brno, Czech Republic, comes packed with a myriad of new opportunities to learn and share. I'm amazed by the people I've met so far. In a two-week time span it's been BrnoJS, Docker Brno, Foreigners.cz Brno, and other opportunities, and more coming day after day.

One great thing about working with opensource is that I'll be able to share everything with the community. OpenShift is a big piece of software, and my first task to get started is to prepare a demo of how an end user can deploy and scale a project with OpenShift. In particular, it will be a Python application, powered by Django and Postgres.

And by the end of May I'll be talking about deployments with OpenShift in PyWAW Summit in Warsaw! I'm looking forward to meeting friends again in Poland and talking about the things that I'm working on these days :-)