Fix boot record after moving linux mint partitions to another disk

Copying partition is straightforward. Made using gparted. Create bootable USB stick (Startup disk creator in Linux mint), boot from it. Assume we have following partitions: boot /sdb1 (don't really know how it works) root /sdb2 home /sdb3 Do sudo mount /dev/sda2 /mnt ## if you have boot partition: # sudo mount /dev/sda1 /mnt/boot sudo grub-install --root-directory=/mnt /dev/sda Source of GRUB instructions

July 16, 2016 · SergeM

Autocomplete from the history in terminal

create a file .inputrc in your home directory and put there "\e[A": history-search-backward "\e[B": history-search-forward set show-all-if-ambiguous on set completion-ignore-case on # display possible completions using different colors to indicate their file types set colored-stats On TAB: menu-complete Restart your terminal. Now you can autocomplete from history using Up and Down keys. Source

June 2, 2016 · SergeM

Keyboard layout switching. Toggle between 2 of 3 languages.

Let’s say you have 3 languages on your linux machine: English, Russian and Belarusian. You frequently switch between EN and RU. Sometimes you write something in EN and BY. So you don’t want to press Alt+Shift three times constantly, only when writting something in Belarusian. 1 2 3 4 5 6 7 8 9 10 11 #!/bin/bash current=`setxkbmap -query | grep layout|cut -d ',' -f 2` echo $current if [ "$current" == "by" ] then notify-send -t 500 -i keyboard "Keyboard layouts: US/RU" setxkbmap -model pc105 -layout us,ru -variant altgr-intl, -option grp:alt_shift_toggle else notify-send -t 500 -i keyboard "Keyboard layouts: US/BY" setxkbmap -model pc105 -layout us,by -variant altgr-intl, -option grp:alt_shift_toggle fi Here I assume that Alt+Shift switches languages inside a group....

October 18, 2015 · SergeM

Take screenshot in linux mint

Ctrl+PrintScreen -> whole screen Ctrl+Alt+PrintScreen -> Current window

April 26, 2015 · SergeM

Joint clipboard for Ctrl+Ins and Select+Middle click

Install clipit application: sudo apt-get install clipit Run clipit. Go to Preferences->Settings. Enable “Synchronize clipboards”

April 26, 2015 · SergeM

Suspend and hibernate in Linux

After installing ubuntu 14.04 I found hibernation was disabled. It was deleted from system menu at all. Only Suspend option was there. Suspend didn’t work either. Computer couldn’t wake up. It actually woke up, but stayed freezed displaying wallpaper. Some googling and testing with other hibernation modules (tuxonice), swap settings gave no result. I decided to install mint Linux as it has hibernation option by default. In mint Linux the situation was the same except I hadn’t to enable hibernate option myself....

February 4, 2015 · SergeM