Jason Meridth's Blog Learn, Converse, Share

Lenovo Thinkpad - Swap ctrl and fn keys

I just got a new laptop. It is a Lenovo Thinkpad X1 Carbon 5th Gen.

Ubuntu 17.10 16 GB RAM 1 TB SSD 64-bit i7 Pentium USB-C power

I’m in love.

lenovo thinkpad box

lenovo thinkpad

lenovo thinkpad fn ctrl keys

My only gripe is that the Fn key is on the far left bottom of the keyboard. I prefer that to be the Ctrl key due to copy/paste and other keyboard commands I use often. I also have very big hands and my pinky isn’t made to “find” the Ctrl key to the right of the Fn key.

I currently use Dconf for mapping of keys in Ubuntu (currently using 17.10). I learned today that the fn key on keyboards is not managed by the operating system, which makes sense. Lenovo in all of its glorious-ness has a BIOS option to swap the Fn and Ctrl keys.

lenovo bios fn ctrl swap

Thank you Lenovo.

Cheers.

Ubuntu - set caps lock to escape

I just got a new laptop and had to google again on how to set caps lock key to escape (I’m a Vim user).

sudo apt-get install dconf-tools
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:escape']"

To know your options, use the following command:

man xkeyboard-config

(MAN pages are your friend; man is short for manual)

You can also now use the Dconf GUI editor if you must (SHAME! ;) )

Type Dconf in Unity or Gnome app opener and go to the following location:

`org` →- `gnome` → `desktop` →  `input-sources` →  `xkb-options`

Add ['caps:escape'] to Custom Value textbox.

dconf caps lock to escape

Cheers.

Cleanup Docker

Cleanup Docker

I keep having friends who have experienced the no space left on device when trying to build images.

I have aliases for most of my container/image/volume cleanup:

lias dka='dkc;dki;dkv'
alias dkc='docker ps -aq | xargs docker rm -f'
alias dki='docker images -aq | xargs docker rmi -f'
alias dkv='docker volume ls -qf dangling=true | xargs docker volume rm'

I use dka all the time.

There is also the docker system prune -a command that works.

I’ve also had to unmount my local aufs volume on my ubuntu laptop via:

sudo umount -l /var/lib/docker/aufs && sudo rm -rf /var/lib/docker/aufs

and all things are cleaned up. Hope this helps someone else.

Cheers.

OnePlus 5

OnePlus 5

I’ve had a Nexus 6 for the last 2 years and was finally due for a phone upgrade. I went through a pretty good fiasco with Google store trying to purchase a Google Pixel XL earlier this year so I decided to wait for the One Plus 5 (release late June). I ordered it the first hour it was announced.

Features that I’m loving:

  • 8 GB RAM
  • 128 GB hard drive
  • dash charge
  • USB C
  • OxygenOS (Android fork)
  • headphone jack
  • fingerprint authentication
  • dual camera (allows for portrait mode) 16 MP
  • front camera 16 MP
  • Dual SIM support

More detailed specs can be found here

Features I’m adjusting to:

  • no Google Phone app install allowed
  • no Google Contacts app install allowed

I’ll adjust to those over time.

I did entertain the iPhone 7 for a bit also but am not a fan of iTunes. The iPhone integration with Google apps has gotten much better since the last time I looked though.

Cheers.

Mapping Caps Lock to Esc Is Native to OSX Now

I have been using Seil for a few years now on OSX to map Caps Lock to Esc. I use Vim for my development and letting my left pinky tap the Caps Lock key instead of Esc allows me to keep my hands on the home row and move much quicker. I also can’t remember the last time I actually needed the Caps Lock key. Well as of 10.12.1 (macOS Sierra Update) you can do this mapping in System Preferences.

Thank you to my co-worker Dedi for letting me know about this.

Go to System Preferences from the Apple menu:

system preferences

Go to keyboard: Keyboard

Go to “Modifier Keys” button on bottom right: Modifier Keys Button

Change Caps Lock Key to Escape: Change Caps Lock Key to Esc