iBus binds ctrl + alt + e to enter emoji, but it is quite annoying actually. I did not enter emoji on Ubuntu. More importantly, it collides with the vscode shortcut.
So, how to disable it.
Method 1
In terminal type ibus-setup, go to the emoji tab, and delete the keybindings.
#!/bin/bash
for i in "$@"
do
case $i in
-n=*|--name=*)
NAME="${i#*=}"
;;
-p=*|--phone=*)
PHONE="${i#*=}"
;;
esac
done
echo NAME = $NAME
echo POST = $PHONE
Get positional arguments
Save below script to test.sh and run it as
#!/bin/bash
echo $0 $1 $2
>> test.sh a bb cc
result:
test.sh a bb
Go to column 20 Move cursor 25 characters ahead move cursor 25 character after
/keyword ?keyword n N
Search keyword from beginning of file Search keyword from the end of file Go to next find result Go to previous find result
$ 9 :1 G
Go to beginning of current line Go to the end of current line Go to line 1 Go to the end of file
ctrl + d ctrl + u
Move half of the view downwards Move half of the view upwards
i a r
Insert: start editing at the current cursor position Append: start editing after the current cursor position Replace: replace the character at the current cursor position
u Ctrl + r
Undo Redo
h j k l
Move the cursor to left Move the cursor to down Move the cursor to up Move the cursor to right
e E
w W
Go to the end of a word separated by special character Go to the end of a word separated by space
Go to the start of a word separated by special character Go to the start of a word separated by space
Display and not display line number:
:set number
:set nonumber
marco
// record a marco and named it "a"
// in view mode, enter "q" then the name of the marco, a-z
ie: qa
// then vim will enter recording mode. You may see "recording @a" in bottom left corner
// To play the marco once
// in view mode enter "@" followed by the name of the marco, in my case, a
ie: @a
// To play the marco several times
// in view mode, enter the number of times followed by "@" and the name of the marco
ie: 10@a
usermod -aG <group name> <username>
# eg1: add user to sudo group
usermod -aG sudo <username>
Remove user from a group
gpasswd -d <user name> <group name>
# show the group of the user
groups <user name>
Creating symbolic link
ln -s <source folder> <new shortcut>
Show current memory usage
> free -h
total used free shared buff/cache available
Mem: 875M 141M 155M 80M 579M 592M
Swap: 99M 0B 99M
or
> free -m
total used free shared buff/cache available
Mem: 875 141 155 80 579 592
Swap: 99 0 99
Remove password requirement
sudo vim /etc/pam.d/common-password
remove obscure to disable complexity check
add minlen=3 to add min password length
Service control
# Start a service
sudo service nginx start
# check the status of a service
sudo service nginx statua
# stop a service
sudo service nginx stop
# list all service
service --status-all
service --status-all | more
service --status-all | grep ntpd
service --status-all | less