2020年12月4日 星期五

The default way to take screenshot in Linux #print screen #prtscr

The default way to take screenshot in Linux


Almost all Linux distributions and desktop environments support these keyboard shortcuts.

Let’s take a look at the list of keyboard shortcuts you can utilize:

PrtSc – Save a screenshot of the entire screen to the “Pictures” directory.
Shift + PrtSc – Save a screenshot of a specific region to Pictures.
Alt + PrtSc  – Save a screenshot of the current window to Pictures.


Ctrl + PrtSc – Copy the screenshot of the entire screen to the clipboard.
Ctrl + Shift + PrtSc – Copy the screenshot of a specific region to the clipboard.

Ctrl + Alt + PrtSc – Copy the screenshot of the current window to the clipboard.

Big5 txt files became unreadable under Linux

command line (convert big5 encoding text.txt to utf8 encoding test-utf8.txt)

iconv -f big5 -t utf8 test.txt > test-utf8.txt

Refer to:  

https://www.itread01.com/p/160400.html

2020年11月5日 星期四

My Favorite Git Setting (for Ubunut)


1. Add the following in ~/.bash_profile


#! /bin/bash
#-----------------------------------------------------------------
# Bash autocompletion for Git

if [ -f ~/.git-completion.sh ]; then
   source ~/.git-completion.sh
fi

if [ -f ~/.git-prompt.sh ]; then
   source ~/.git-prompt.sh
fi

# PS1 may be replaced
 PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\][\w]\[\033[0m\]\[\033[1;36m\]$(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ '
#PS1='\[\033[01;32m\]\u@\h\[\033[00m\]: \[\033[01;34m\]\w \[\033[0m\]\[\033[1;36m\] $(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ '
#PS1='[\u@\h \W$(__git_ps1 " (%s)")]\$ '
#PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;36m\]\$(git_branch)\[\033[0;33m\]\$(git_since_last_commit)\[\033[0m\]$ "
#PS1="[\[\033[1;32m\]\w\[\033[0m\]] \[\033[0m\]\[\033[1;33m\]\$(__git_ps1)\[\033[0;33m\]\[\033[0m\]$ "


2. Download  https://github.com/git/git/blob/master/contrib/completion/git-completion.bash 

and rename by git-completion.sh

3. download https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh

$ mv git-completion.sh ~/.git-completion.sh
$ mv git-prompt.sh ~/.git-prompt.sh
$ chmod 775 .git-completion.sh
$ chmod 775 .git-prompt.sh


4. 

$ source ~/.bashrc

or


$ source ~/.bash_profile

Reference result