Keyboard control

The keyboard configuration file is located at /etc/default/keyboard (in Debian). The next lines are an example of settings which can be set there: # Consult the keyboard(5) manual page. XKBMODEL="thinkpadx220" # XKBLAYOUT="us" XKBLAYOUT="us,es,fi" XKBVARIANT="euro" # XKBOPTIONS="lv3:ralt_switch,compose:lwin,terminate:ctrl_alt_bksp" XKBOPTIONS="grp:alt_shift_toggle,lv3:ralt_switch,terminate:ctrl_alt_bksp,ctrl:swapcaps,altwin:left_meta_win" BACKSPACE="guess" Alternatively, one can use: setxkbmap -layout us,es,fi -option grp:ctrl_shift_toggle -option ctrl:swapcaps -option terminate:ctrl_alt_bk sp-option altwin:left_meta_win

August 8, 2020 · Alberto Casado

Sytemd networkd

From Arch forums. Aslo follow this great instructions Okay, so I’ll walk you through this since there is really not a whole lot of documentation on the subject. This assumes that your NIC is wlan0, your SSID is MyNetwork, and the password is SuperSecretPassphrase. You need to create a wpa_supplicant-wlan0.conf. So use wpa_passphrase to generate one: wpa_passphrase MyNetwork SuperSecretPassphrase > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf Enable it so that it runs on boot: systemctl enable wpa_supplicant@wlan0.service Get the IP Wired and wireless adapters on the same machine This setup will enable a DHCP IP for both a wired and wireless connection making use of the metric directive to allow the kernel to decide on-the-fly which one to use. This way, no connection downtime is observed when the wired connection is unplugged. ...

August 6, 2020 · Alberto Casado

How to fix a corrupted HDD

When it looks like your / partition can’t be mounted, it could be due to a corruption or a failing hard drive. Boot from a UNIX live CD or live USB and see if you can even mount the main root partition on your hard drive. If you can unmount it. (More below.) Now install GSmartControl on the live CD/live USB. Start up GSmartControl after install and look at the S.M.A.R.T. attributes of your hard drive. Anything highlighted in pink? If so - what? ...

August 4, 2020 · Alberto Casado

How to move the root partition

You’ll need to boot from a live cd. Add partitions for them to disk 1, copy all the contents over (with rsync, see rsync clone partition), and then use sudo blkid to get the UUID of each partition. On disk 1’s new /, edit the /etc/fstab to use the new UUIDs you just looked up. Updating GRUB depends on whether it’s GRUB1 or GRUB2. If GRUB1, you need to edit /boot/grub/device.map ...

August 4, 2020 · Alberto Casado

Useful shell commands

Replace commas with tabs sed "s/,/\\t/g" in.dat >> out.dat List directories recursively ls -RAlph Remove files with and extension from multiple directories rm -Rvf /some/dir*/*.ext Move files only if they are newer, and backup if they already exist mv -vubi -v: verbose -u: update only -b: backup -i: interactive, ask for confirmation to overwrite From here: Quickly Find a PID with pgrep pgrep ssh Execute The Last Executed Command !! The !! command is very useful when you forget to start a command with sudo : ...

July 25, 2020 · Alberto Casado