Misc tips - xZixz/TDIL GitHub Wiki

Google Translate on the shell

Intsall

Install gawk

sudo apt-get install gawk

Install from github

$ git clone https://github.com/soimort/translate-shell
$ cd translate-shell/
$ make
$ [sudo] make install

Usage

Translate a word into Vietnamese

$ trans :vi word

Go back to previous foler in shell

$ cd -

Use ack - nice alternative for grep

Install

sudo apt-get install ack

Mapping keys in Windows 10

Scancode syntax in a .reg file:

0000 0000 0000 0000 0300 0000 1de0 5de0 0100 3a00 0000 0000
Value Interpretation
0x00000000 Header: Version. Set to all zeroes
0x00000000 Header: Flags. Set to all zeroes
0x00000003 Three entries in the map (number of mappings including null entry)
0xe05de01d Context Key(Menu Key) --> Right CTRL Key (e05d --> e01d)
0x003a0001 Caps Key --> Esc Key (003a --> 0001)
0x00000000 Null terminator

Insert scancode into .reg file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layout]
"Scancode Map"=hex:00,00,00,00,00,00,00,00,03,00,00,00,1d,e0,5d,e0,01,00,3a,00,00,00,00,00

Run the file.

Restart the machine.

Preference for keycodes: Keyboard Scancodes

More Hot keys in shell

Ctrl+P = Up which auto fill the command line with the last command Ctrl+O = Enter which clearly is an alternative for Enter key

Recall the last command in shell

!! + Enter will execute the last command or !-1 + Enter will also do

Magic space: by adding bind Space:magic-space to ~/.bashrc then pressing Space after the command !! will auto-expand the command for you, so you can inspect before the execution. !{command} will pull the last command run starting with {command}