Things to do after install Linux Mint

I have changed my desktop environment to Linux, and after I tried Ubuntu and Debian, I finally choose the Linux Mint distribution. I think there are some reasons why this distribution take the first place in distrowatch. User-friendly desktop environment and convenient software package manager make me very comfortable. Cause it is based on the Debian and Ubuntu, most of the applications are familiar.

Install a theme

The simplest way to install a new Cinnamon theme is with the Themes manager in System settings.

Go to System Settings -> Themes -> Get More Online -> Refresh list. You can choose Most Popular or Latest. The theme will be installed to your hidden folder ~/.themes

Dark Blue Glass

I highly recommend my modified Dark Blue Glass theme link. It is a mix of Dark Glass and mint numix blue theme. Or you can find more themes on the following sites:


You can install a new icon set in two ways. One is by adding a PPA. You add the PPA, install the icon set. But you won’t find icon sets for all the icon themes. Therefore, the other way round is to download the compressed file and extract it to ~/.icons or ~/.local/share/icon . If this directory doesn’t exist, create one using the following command:

mkdir ~/.icons

The icons extracted in the above directory will be available for the current user only. If you want the icons to be available for all the users, you should extract the icons to /usr/share/icons .

Now, once you have installed the icon set, you can use a Unity Tweak Tool to change the icon theme. Use the following command to install Unity Tweak Tool:

sudo apt-get install unity-tweak-tool

Or in Linux mint you can just change icons under setting -> theme -> icons.

I highly recommend this one: papirus icons

sudo add-apt-repository ppa:varlesh-l/papirus-pack
sudo apt update
sudo apt install papirus-icons

Software Sources

You didn’t need to edit/etc/apt/sources.list and files under /etc/apt/sources.list.d/ mannually. All customs can be changed through UI. Just click “start menu” and choose the “Software Sources”. And this application can even custom the PPAs.

linux mint software sources managers

Necessary applications


First is web browser, and of course Chrome. I am crazy about Google, and all Google related things. I have used Chrome since year 2011, after I am tried of the Firefox’s slowness. Although Firefox become more and more light, faster this years, I get used to Chrome. And what Chrome done makes me really happy. First thing is the bookmark and extension etc sync. I can reach all of my staff and customizations, after I login into my account. I don’t even need to worry about anything. All my Apps, Extensions, Settings, Autofill informations, History, Themes, Bookmarks, Passwords, and even Open tabs always follow my account. I can reach my opening tab on desktop from my Android phone. I can reopen bookmarks on my home laptop, which I added in my laboratory computer. And I can open chrome://history page to check all current opening tags from signed-in devices, and even check the unread article in the opening tab on my phone and browser all my chrome history.

sogou input method

It is necessary to have an input method for typing Chinese which I speak. I choose the sogou input method, because it is easy to use and have a very Good word dictionary. Sogou input method is based on fcitx. In Linux mint setting panel, we have the Language setting, we can choose to install fcitx components.

More detail information can be found in this blog article.

Following can be done through user interface, no need to run. Pasting here only for reference.

sudo apt-get install fcitx fcitx-table-wubi-large fcitx-frontend-all fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt4 fcitx-config-gtk fcitx-ui-classic fcitx-module-kimpanel fcitx-module-dbus fcitx-libs-qt
sudo apt-get install fcitx fcitx-bin fcitx-config-common fcitx-config-gtk fcitx-data fcitx-frontend-all fcitx-module-cloudpinyin fcitx-module-dbus fcitx-module-kimpanel fcitx-module-x11 fcitx-modules fcitx-qimpanel-configtool

After installation, “start”, “Fcitx Configuration” can config the input method, just add “Sogou Pinyin” to the panel.


Use to cross China’s great firewall. Don’t need to talk more.

 pip install shadowsocks # install command line tool

If pip is missing, install pip first.

PPA is for Ubuntu >= 14.04.

sudo add-apt-repository ppa:hzwhuang/ss-qt5
sudo apt-get update
sudo apt-get install shadowsocks-qt5

To install Qt version of shadowsocks. From:GitHub.

Nvidia driver

“System settings” , “Driver Manager”, choose the right latest driver and install. After installation, you will find Nvidia icon at the right-bottom corner. Double click the icon to open the setting panel. In order to save the battery , you can use Intel(Power Saving Mode) for most time. And if choose NVIDIA(Performance Mode) for high performance need.

Nvidia driver


Install hardinfo tool to check hardware information through GUI

 sudo apt-get install hardinfo

System tools

If there is no special instruction, all of the following applications can be installed from the Software Manager in Linux Mint.

gnome do

As it official introduction said “Do things as quickly as possible (but no quicker) with your files, bookmarks, applications, music, contacts, and more!”. I set a shortcut Alt+Space to launch Gnome do. And you can just type several keys to start any application quickly.

install following package:

  • gnome-do
  • gnome-do-plugins


Use F12 to open a terminal. Dropdown terminal, you can right click the terminal after you press F12 to configure your guake.


“PlayOnLinux is a front-end for wine. It permits you to easily install Windows Games and software on Linux. It is advised to have a functional internet connection.” I use playonlinux to install Evernote and cloudmusic(网易云音乐). Although I met a lot of problems during installation of Evernote. But finally evernote 5.8.x can be installed on wine 1.7.x.

There are several packages you need to install to make PlayOnLinux work.

  • wine
  • wine mono
  • wine gecho
  • ttf-mscorefonts-installer


Most of the following can be installed from default Software Manager. Just type name of the application and search then click install.


cloud music client and my favourite music client. Here is the link to it’s official site, where you can found clients for all platforms include linux.


my favourite cloud notebook with a very clean Android client.


Linux mint 17 has a default screenshot software called Screenshot. It is a very simple screenshot software. Shutter is more powerful.


Sync all my files. When I installed Dropbox through it’s offical installer, there was a problem I cannot connect to Dropbox directly from China. Here is a solution to redirect connections to shadowsocks sock5 proxy. You should install proxychains.

sudo apt install proxychains
# config socks4 9050  To socks5 1080 which is the default of shadowsocks
vi /usr/local/etc/proxychains.conf
# then use proxychains to start dropbox
proxychains4 dropbox start -i

Then dropbox will start to start and install, then after installation you can set sock5 proxy in dropbox settings.


Baidu pan linux port. It is really a great work. Thank the author.

You can download here


Remote desktop connection client able to display and control a remote desktop seesion. It supports multiple network protocols in an integrated and consistant user interface. Currently RDP, VNC, NX, XDMCP and SSH protocols are supported.


linux firewall.


E-book manager, 电子书管理. It is very efficient when you plug in kindle using USB port Calibre is prepare to serve.


Evernote like cloud notebook client. Find more information here. You can install through PPA:

$ sudo add-apt-repository ppa:wiznote-team
$ sudo apt-get update
$ sudo apt-get install wiznote


one of the screenrecoders I use.


Best image and picture manager ever from Google.

audacity audio editor

record and edit audio files

kdenlive video editor

non-linear video editing suite.

WPS Office for Linux

Office software include writer, spreadsheets and presentation.


Password manager. But I prefer LastPass.

youdao dict

This client really make me impressed. It is faster and simple than any other platform client. Launch it with Gnome do, and use it to check English word is a very happy work. Someone used to recommand me the StarDict, but I think youdao dict is a better choice for me.


Elegant, powerful, clean dock.

Or there is another choice Cairo Dock.

ntfs configuration tool

Install this tool using this command:

 sudo apt-get install ntfs-config

and you can find NTFS Configuration Tool in the menu. It is a very efficient tool to auto mount windows NTFS partitions. You can setup to auto-mount when your Linux mint start up. It is really useful if you have a second hard drive installed and you want it to auto-mount each time you restart your system.

smplayer or vlc

video player always need one. Personally, I like smplayer more.

Nuvola Player 3

You can follow the instruction on it’s official site. It was great, espcially when you want to listen to music at Google Play Music, or other cloud stream music. It support a lot of services, like Amazon Cloud Player, Play Music, Plex Music, Spotify, Tuneln, etc.


Birdie is beautiful Twitter client for GNU/Linux.

PPA (14.04) Birdie can be installed from our PPA, which provides automatic updates whenever we improve the application.

$ sudo add-apt-repository ppa:birdie-team/stable
$ sudo apt-get update
$ sudo apt-get install birdie

from it official site:


all the detail information can be found at it’s official site.

$ sudo add-apt-repository ppa:mc3man/trusty-media
$ sudo apt-get update
$ sudo apt-get install ffmpeg


Remote control application. I need it to help to connect my mac in lab and other Windows machine. You can download here. And because it is cross-platform. You can install in other OS and connect it easily.

Programming tools


Use apt-get search vim to search related vim packages, you will find several packages,like vim-gtk, vim-gnome etc. Install vim and vim-gtk package to install vim and gvim. And config my vim with my dotfile,


best version control system. And I am using SmartGit.



Sublime Text

Text Editor. Later I found Atom which is also great.


markdown editor.

eclipse with jdt and cdt

sometime need java and c++ IDE for test.


install boost library from source using the following code:

 sudo apt-get install libboost-all-dev

all boost library is located at /usr/include/boost

Android Studio

Check official site for more information.


Python IDE

ZeroBrane Studio



Sqlite manager



You can have your local weather forecast in desktop.

Desktop Capture

Screenshot and screencasting tools which saves me a lot of time.

I have created a list in Youtube, you can check it for information.

2015-10-24 linux , linux mint , applications

Install fonts under Linux

Most of computer fonts people using are TrueTpye fonts. TrueType fonts end with .ttf , which stand for TrueType Font. This tutorial shows how to install TrueType fonts in Linux (Debian, Ubuntu, Linux Mint, etc).

General way to install TrueType fonts

All of the TrueType fonts are under /usr/share/fonts/truetype, simplest way is to copy ttf file to this directory and give it the right permission. For example, if you want to install Ubuntu font family manually. You can download the font file from official site.

In the terminal, download the package:


unzip the file into directory ubuntu-font-family-0.80


and then use copy command to copy all the files to /usr/share/fonts/truetype,/usr/share/fonts directory and sub directory need root to write, so you should add sudo before command. The -r paramater represent recursive, it means all the files under ubuntu-font-family-0.80 will be copied to the right place.

 sudo cp -r ubuntu-font-family-0.80/ /usr/share/fonts/truetype/

finally, you shoulde give this directory and all the ttf under this directory right permission. All the new fonts now can only be used by root. We need to change the permission to let all the users to use these fonts:

 sudo chmod 755 /usr/share/fonts/truetype/ubuntu-font-family-0.80/ -R

then, refresh the font cache to let system detect these fonts:

 fc-cache -f -v

Install new fonts only for current user

As I mentioned in the first part, if you copy the ttf file to /usr/share/fonts directory, all the users can use these new fonts. But if you only want to provide these fonts to specific user, like current login user , you can just copy the file to ~/.fonts directory. If there is no such directory, just create it. The ~ stand for current user’s home directory, full path is /home/<username>. So repeat the operation to install Ubuntu font family:

mkdir ~/.fonts
cp -r ubuntu-font-family-0.80/ ~/.fonts/
fc-cache -fv

Install microsoft core fonts

Microsoft Core Fonts include these fonts:

  • Andale Mono
  • Arial Black
  • Arial (Bold, Italic, Bold Italic)
  • Comic Sans MS (Bold)
  • Courier New (Bold, Italic, Bold Italic)
  • Georgia (Bold, Italic, Bold Italic)
  • Impact
  • Times New Roman (Bold, Italic, Bold Italic)
  • Trebuchet (Bold, Italic, Bold Italic)
  • Verdana (Bold, Italic, Bold Italic)
  • Webdings

Debian/Ubuntn/Linux Mint user just open terminal and run these command:

sudo apt-get install ttf-mscorefonts-installer

or Linux Mint user can find this package in the Software Manager, just search it and click install.

Install Chinese fonts

.ttf files are the English fonts, while .TTF files are Chinese fonts. If we check the C:\Windows\Fonts under Microsoft Windows, there are 3 kind of fonts. One is the .fon fonts, which is the DOS system font, and other two fonts are .ttf and .TTF. We can just make a copy of all .ttf and .TTF file and copy all the files to /usr/share/fonts/ directory under Linux. Although it is illegal under Microsoft’s TOC, but we can still do it. :)

If you dual boot your computer, mount the Windows and copy the files

sudo mkdir /usr/share/fonts/truetype/WindowsFonts
sudo cp -r /media/Windows/Fonts/*.ttf /usr/share/fonts/truetype/WindowsFonts/
sudo cp -r /media/Windows/Fonts/*.TTF /usr/share/fonts/truetype/WindowsFonts/

Install open source Chinese fonts, like文泉驿-微米黑 文泉驿-正黑

sudo apt-get install ttf-wqy-microhei ttf-wqy-zenhei

several Chinese font we can choose:

To check more about Chinese font visit Arch wiki


Install Software Manager under Linux Mint

Linux Mint user can find a font manager under Software Manager. It is really a cool tool to manager your fonts.

List all available fonts

fc-list is a quick and handy command to lists fonts and styles available on the system for applications using fontconfig. You can use fc-list to find out whether particular language font is installed or not.

To list all font faces:

$ fc-list

To lists font faces that cover Chinese language:

$ fc-list :lang=zh

Output will be all available Chinese fonts.

Fix WPS for Linux font missing error

After I installed WPS for Linux under Linux Mint 17.2, I met this problem, “系统缺失字体symbol、wingdings、wingdings 2、wingdings 3、wedding”. According to the copyright, WPS for Linux doesn’t contains these five fonts. You can only find these five fonts and install them in the right place like I said before. One way to find these fonts is to find them in Microsoft Windows system. And another way is to download these files from Internet and install.

Install Korean fonts

Use following command to search Korean font

apt-cache search korean font

and use this command to install Korean font to linux:

sudo apt-get install fonts-unfonts-core fonts-unfonts-extra

Common sense

Fonts type:

  • Sans-serif=无衬线体=黑体:并不是具体一款字体,而是一类字体,选择它其实等于选择这类字体中优先级最高的那款字体。
  • Serif=衬线体=白体:同上
  • Monospace=等宽字体,意思是字符宽度相同:同上
  • 点阵字体=位图字体



For more information check Debian page Arch wiki and Ubuntu wiki

2015-10-21 linux , linux mint , fonts

git presentation


What is Git

Git is a free and open source distributed version control system(VCS) designed to handle everything from small to very large projects with speed and efficiency.

Git是一个分散式版本控制软件,最初由林纳斯·托瓦兹(Linus Torvalds)创作,于2005年以GPL发布。最初目的是为更好地管理Linux内核开发而设计。Linus Torvalds 自嘲的取名“git”,该词源自英国俚语,意思大约是“混账1”。


Version Control Example

Microsoft Word 如果你用Microsoft Word写过长篇大论,那你一定有这样的经历:



Undo Windows: Ctrl+z Mac: Command+z


Version control has a very long histroy.

  • Source Code Control System (SCCS)
  • 1972, closed source, free with Unix
  • Revision Control System (RCS)
  • 1982, open source
  • Concurrent Versions System (CVS)
  • 1986-1990, open source
  • Apache Subversion (SVN)
  • 2000, open source

BitKeeper SCM

  • 2000, closed source, proprietary
  • distributed version control
  • “community version” was free
  • used for source code of the Linux kernel from 2002-2005
  • Controversial to use proprietary SCM for an open source project
  • April 2005: the “community version” not free anymore

Git is born

  • April 2005
  • created by Linus Torvalds
  • replacement for BitKeeper to manager Linux kernel source code
  • distributed version control
  • open source and free software
  • compatible with Unix-like systems (Linux, Mac OS X, and Solaris) and Windows
  • faster than other SCMs (100x in some cases)

Git become popular, GitHub launched in 2008 to host Git repositories:

  • 2009: over 50,000 repositories, over 100,000 users
  • 2011: over 2 million repositories, over 1 million users


Git 是一种分布式版本控制,不需要服务器端软件也可运行

  • 不同用户维护自己的版本库,而不是和核心版本库交换数据
  • 追踪 “change sets” 或者 ”patches”
  • 无需网络,随时随地进行版本控制
  • 分支的新建、合并非常方便、快速,没有任何成本,基本不耗时

Who use Git?

anyone wanting to track edits

  • review a histroy log of changes made
  • view differences between versions
  • retrieve old versions

anyone needing to share changes with collaborators

anyone not afraid of command-line tools


  1. 只能跟踪文本文件的改动,二进制文件不行,也就是说 如果使用 Git 追踪 Word ,版本控制系统并不知道改动了那些行,只能知道二进制变化了。


    • HTML, CSS, JavaScript
    • PHP, Ruby, Ruby on Rails, Perl, Python, ASP
    • Java, C, C++, C#, Objective-C
    • ActionScript, CoffeeScript, Haskell, Scala, Shell scripts

    not as useful for tracking non-text files

    • images, movies, music, fonts
    • word processing files, spreadsheets, PDFs
  2. 编码问题,如果在多平台使用请千万使用 UTF-8 编码

    使用Windows的童鞋要特别注意: 千万不要使用Windows自带的记事本编辑任何⽂文本⽂文件。原因是Microsoft开发记事本的团 队使⽤用了⼀一 个非常弱智的⾏行为来保存UTF-8编码的⽂文件,他们⾃自作聪明地在每个⽂文件开头添 加了0xefbbbf(⼗十六进制)的字符,你会遇到很多不可思议的问题,比 如,网页第一⾏行可 能会显⽰示⼀一个“?”,明明正确的程序⼀一编译就报语法错误,等等,都是由记事本的弱智⾏行 为带来的。建议你下载Notepad++代替记事本,不但功能强⼤大,而且免费!记得把 Notepad++的默认编码设置为UTF-8 without BOM即可


  • Linux

sudo apt-get install git or sudo yum install git

  • mac

brew install git

  • windows

Git basic

在开始使用 Git 之前有些配置

git config --global "John Doe"  # 配置提交用户名
git config --global  # 配置提交邮箱

git init  
git status  
git add filename  
git commit -m “"  
git log  

commit message best practices

  • short single-line summary ( less then 50 characters 或者 小于25个汉字)
  • optionally followed by a blank line and a more complete description
  • keep each line to less than 72 characters
  • write commit messages in present tense, not past tense
    • “fix bug” or “fixes bug”, not “fixed bug”


git branch <branchname>  
git checkout <branchname>  
git checkout -b <branchname>  

git push origin <branchname>

git push origin --delete <branchname>


git remote add origin  
git push -u origin master  
git remote show origin  


git tag     # list all tags  
git tag v0.9  
git tag -a v1.0 -m “my version 1.0"  
git show tag name #show tag details  
git push origin tag name  
git push origin --tags  

git GUI




git config –global status
git config –global checkout
git config –global commit
git config –global branch
git config –global alias.unstage ‘reset HEAD –’
git config –global alias.last ‘log -1 HEAD’

GitLab server



2015-10-12 git











2015-09-27 影评 , 韩国

Bash 学习笔记之基本使用


命令行编辑 Emacs mode vs Vi Mode

可以使用 set -o | egrep -w "(vi|emacs)" 命令查看,当前命令行编辑模式。

$ set -o vi
$ set -o|egrep -w "(vi|emacs)"
emacs           off
vi              on

All the above assume that bash is running in the default Emacs setting, if you prefer this can be switched to Vi shortcuts instead.

Set Vi Mode in bash:

$ set -o vi 

Set Emacs Mode in bash:

$ set -o emacs 

using set -o to check all the bash options.

Emacs 编辑模式

完整 Emacs编辑模式快捷键,文档link

Bash Keyboard Shortcuts 在绝大多数情况下一下快捷键可以直接使用

Moving the cursor:

Command Explain
Ctrl + a Go to the beginning of the line (Home)
Ctrl + e Go to the End of the line (End)
Ctrl + p Previous command (Up arrow)
Ctrl + n Next command (Down arrow)
Alt + b Back (left) one word
Alt + f Forward (right) one word
Ctrl + f Forward one character
Ctrl + b Backward one character
Ctrl + xx Toggle between the start of line and current cursor position


Command Explain
Ctrl + L Clear the Screen, similar to the clear command
Alt + Del Delete the Word before the cursor.
Alt + d Delete the Word after the cursor.
Ctrl + d Delete character under the cursor
Ctrl + h Delete character before the cursor (Backspace)
Ctrl + w Cut the Word before the cursor to the clipboard.
Ctrl + k Cut the Line after the cursor to the clipboard.
Ctrl + u Cut/delete the Line before the cursor to the clipboard.
Alt + t Swap current word with previous
Ctrl + t Swap the last two characters before the cursor (typo).
Esc + t Swap the last two words before the cursor.
ctrl + y Paste the last thing to be cut (yank)
Alt + u UPPER capitalize every character from the cursor to the end of the current word.
Alt + l Lower the case of every character from the cursor to the end of the current word.
Alt + c Capitalize the character under the cursor and move to the end of the word.
Alt + r Cancel the changes and put back the line as it was in the history (revert).
ctrl + _ Undo
TAB Tab completion for file/directory names

For example, to move to a directory ‘sample1’; Type cd sam ; then press TAB and ENTER. type just enough characters to uniquely identify the directory you wish to open.


Command Explain
Ctrl + r Recall the last command including the specified character(s)
searches the command history as you type.
Equivalent to : vim ~/.bash_history.
Ctrl + p Previous command in history (i.e. walk back through the command history)
Ctrl + n Next command in history (i.e. walk forward through the command history)
Ctrl + s Go back to the next most recent command.
(beware to not execute it from a terminal because this will also launch its XOFF).
Ctrl + o Execute the command found via Ctrl+r or Ctrl+s
Ctrl + g Escape from history searching mode
!! Repeat last command
!abc Run last command starting with abc
!abc:p Print last command starting with abc
!$ Last argument of previous command
ALT + . Last argument of previous command
!* All arguments of previous command
^abc­^­def Run previous command, replacing abc with def

Process control:

Command Explain
Ctrl + C Interrupt/Kill whatever you are running (SIGINT)
Ctrl + L Clear the screen
Ctrl + s Stop output to the screen (for long running verbose commands)
  Then use PgUp/PgDn for navigation
Ctrl + q Allow output to the screen (if previously stopped using command above)
Ctrl + D Send an EOF marker, unless disabled by an option, this will close the current shell (EXIT)
Ctrl + Z Send the signal SIGTSTP to the current task, which suspends it.
To return to it later enter fg ‘process name’ (foreground).

最常使用的应该还是 Ctrl-a, Ctrl-e, Ctrl-f, Ctrl-b, Ctrl-l, Ctrl-h, Ctrl-w, Ctrl-k, Ctrl-u, Ctrl-y, Ctrl-r.

命令 说明
Ctrl-B 后移一个字符
Ctrl-F 向前移动一个字符
DEL 向后删除一个字符
Ctrl-D 向前删除一个字符
Ctrl-A 移到行首
Ctrl-E 移到行尾
Ctrl-K 向前删除到行尾
Ctrl-P 移到前一行
Ctrl-N 移到后一行
Ctrl-R 向后搜索
Ctrl-J 等同于 RETURN
Ctrl-L 清除屏幕,将当前行放到屏幕最上面
Ctrl-M 等同于 RETURN
Ctrl-O 等同于 RETURN 随后在显示历史命令中下一行
Ctrl-T 颠倒光标左右两个字符,将光标向前移一个
Ctrl-U 从光标位置开始删除行 ,向后删除到行首
Ctrl-V 引用插入

Vi 编辑模式

通过设置 set -o vi 进入Vi编辑模式,正常环境为输入模式,对命令进行修改则按 Esc。完整命令参考.

命令包括 h, l, w, b 等等Vi中使用的命令,可参考另外一篇Vim学习笔记

  • 通过按键 Esc , Ctrl+l(L lower case) ,clear screen。
  • Ctrl-w
  • Ctrl-u
  • Ctrl-k
  • Ctrl-y
  • Ctrl-r



最重要的 Bash文件是 .bash_profile ,它在每次用户登陆系统时被读取 /etc/profile 。Bash 允许有 .bash_profile 两个同义文件, C Shell 的 .bash_login 以及 Bourne Shell 和 Korn Shell 的 .profile 。登录时三者中只有一个被读取,如果用户根目录下 .bash_profile 不存在,则 bash 依次查找 .bash_login , .profile.

.bash_profile 只被登录 shell 读取并执行,如果通过命令键入 Bash 启动一个新 Shell, 它就会读取 bashrc 中的命令。

.bash_logout 在每次 shell 退出时被读取并执行。

可以使用 source ~/.bashrc 来使配置文件立即生效。

修改 .bashrc 文件可以精确到对当前用户有效。修改 /etc/profile 对全局用户生效。



alias name=command

指定 name 是 command 的别名。在“=”两边没有空格,严格语法。




set -o optionname	-号 开启
set +o optionname	+号 关闭

检查bash所有可选项,使用 set -o 打印所有列表。

shopt 选项

选项 含义
-p 显示可选设置及其当前取值
-s 设置
-u 失效
-o 允许选项名取值通过 set 命令 -o 选项定义


allexport           off
braceexpand         on
emacs               off
errexit             off
errtrace            off
functrace           off
hashall             on
histexpand          on
history             on
ignoreeof           off
interactive-comments     on
keyword             off
monitor             on
noclobber           on
noexec              off
noglob              off
nolog               off
notify              off
nounset             off
onecmd              off
physical            off
pipefail            off
posix               off
privileged          off
verbose             off
vi                  on
xtrace              off
选项 解释
emacs emacs编辑模式
vi vi 编辑模式
ignoreeof 不允许单独使用 Ctrl-D 退出
noclobber 不允许输出重定向(>)覆盖已存在的文件
noglob 不允许扩展文件名通配符如*和?
nounset 试图使用未定义变量时给出错误





引用变量,使用符号 $ , 单引号内部的变量会直接使用而不需要转义,而双引号内部变量需要转义

echo $varname

bash 有很多内置变量分布在各个配置文件中。


PATH变量,帮助shell找到输入的命令。输入 echo $PATH 得到类似:

变量 含义
HOME 主目录
SECONDS 调用 shell 的秒数
BASH 正在运行的 shell 实例路径名
BASH_VERSION shell 版本号
BASH_VERSINFO shell 版本信息数组
PWD 当前目录
OLDPWD 最后一个 cd 命令前的目录

2015-09-26 Linux , bash , vim

Linux学习笔记 User and Group






  • 账户名称
  • 密码,已被移到 /etc/shadow 目录中
  • UID
    • 0 代表“系统管理员”
    • 1~499 保留系统使用,1~99保留系统默认帐号,另外100~499 则保留给服务使用
    • 500~65535 一般用户使用,Linux 2.6.x 已经可以支持 2 的32次方减1 UID
  • GID
  • 用户信息说明
  • home dir
  • shell




  • 帐号名称
  • 密码,加密过,如果为* 或 ! 则表示这个帐号并不会用来登陆
  • 最近更改密码日期,1970年1月1号作为1
  • 密码不可更改天数
  • 密码需要重新更改天数
  • 密码更改期限前的警告期限
  • 密码过期的宽限时间
  • 帐号失效日期
  • 保留


root@linux ~#  useradd username



GROUP=100 #默认用户组
HOME=/home #默认Home目录
INACTIVE=-1 # /etc/shadow 内第7栏
EXPIRE= # /etc/shadow 内第8栏
SHELL=/bin/bash #默认shell
SKEL=/etc/skel #home目录内容数据参考




设置密码,直接 passwd 则是修改自己密码

root@Linux ~# passwd username





root@linux /# userdel [-r] username

-r 连同home目录一起删除






  • 用户组名称
  • 用户组密码 /etc/gshadow
  • GID
  • 支持的帐号名称

####有效用户组 查看已einverne用户身份登录,支持的用户组命令:

pi@linux / $ groups
pi adm dialout cdrom sudo audio video plugdev games users netdev gpio i2c spi input

使用命令 newgrp groupname 切换有效用户





  • 用户组名称
  • 密码栏,以 ! 开头表示无法登陆
  • 用户组管理员帐号
  • 用户组所属帐号



root@linux ~# groupadd groupname


调整 group 相关参数

root@linux ~# groupmod -g 103 -n groupname groupothername



root@linux ~# groupdel groupname

su & sudo

/etc/sudoers 文件,建议使用 visudo 编辑该文件

格式:用户帐号 登录主机 = (可变换的身份) 可执行的命令

einverne ALL = (ALL) ALL
%groupname ALL = (ALL) ALL
%groupname ALL = (ALL) NOPASSWD: ALL


change file group

chgrp users dirname/filename [-R]

chown [-R]

chown change file owner

chown root:root filename


change file property, SUID

  • number


    chmod [-R] xyz filename/dir

  • 符号

+加入 -除去 =设置
u user g group o others a all

2015-09-24 linux , user , group

GitLab 学习笔记

Here is some config file paths and some commands I used to deal with GitLab. This is a learning note, not an instruction of installing GitLab on your server. For the detail of installation, please check the official site and playlist I create on Youtube.

gitlab icon

##config gitlab主要配置目录 /etc/gitlab/gitlab.rb


  • gitlab-ctl reconfigure always run this command after modifying the config file /etc/gitlab/gitlab.rb. All the config files are generated by this command and located under opt/gitlab/embedded/service/gitlab-rails/config.

  • gitlab-ctl start|stop|restart start stop and restart gitlab service

  • gitlab-ctl status 输出类似下面的格式:

      run: logrotate: (pid 744) 197s; run: log: (pid 737) 197s
      run: nginx: (pid 743) 197s; run: log: (pid 731) 197s
      run: postgresql: (pid 748) 197s; run: log: (pid 738) 197s
      run: redis: (pid 746) 197s; run: log: (pid 734) 197s
      run: sidekiq: (pid 747) 197s; run: log: (pid 736) 197s
      run: unicorn: (pid 745) 197s; run: log: (pid 735) 197s
  • gitlab-ctl tail trace the log, and check error

  • gitlab-ctl tail postgresql 单独查看 postgresql 日志

##file path

  • /opt/gitlab gitlab和依赖应用的代码

  • /var/opt/gitlab/bin gitlab-ctl reconfigure命令写入的地方,存放应用数据和配置文件 /etc/gitlab omnibus 版本 gitlab的配置文件,平常只需要修改这个配置文件就够了

  • /var/opt/gitlab/git-data/repositories all the repo are stored here.

  • /var/log/gitlab 包含 omnibus 版本 gitlab 所有组件的日志数据

  • /var/opt/gitlab/nginx/conf/ nginx.conf and gitlab-http.conf

GitLab SMTP setting

official document is here

Following is my setting to use 163 NetEase’s SMTP service. But after I test for a while, most of GitLab emails were blocked by the service. So I change my setting to use mailgun.

# If your SMTP server does not like the default 'From: gitlab@localhost' you 
# can change the 'From' with this setting.
# 网易服务器smtp机器要求身份验证帐号和发信帐号必须一致
# 如果用户在发送邮件时,身份验证帐号和发件人帐号是不同的,因此拒绝发送。
gitlab_rails['gitlab_email_from'] = ''
gitlab_rails['gitlab_email_reply_to'] = ''

#send gitlab notification via SMTP by
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = ""
gitlab_rails['smtp_port'] = 25
gitlab_rails['smtp_user_name'] = ""
gitlab_rails['smtp_password'] = "smtp password"
gitlab_rails['smtp_domain'] = ""
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true

This is my setting for mailgun

# Sending email via SMTP using mailgun, following is the config
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = ""
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = " created in the console of mailgun"
gitlab_rails['smtp_password'] = "password created in the console of mailgun"
gitlab_rails['smtp_domain'] = "your same as the"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true


2015-09-20 GitLab , Git











2015-09-17 影评 , 霍建起 , 野夫

Jekyll markdown syntax

h1 Heading

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

Horizontal Rules


This is bold text

This is bold text

This is italic text

This is italic text



Blockquotes with plain text

Blockquotes Text

Blockquotes with Lists

  • List one
    • List
    • List one.two
  • List two
  • List three

To end the Blockquotes just put an empty line under >



  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!


  1. Lorem ipsum dolor sit amet

    This is ordered List one content

  2. Consectetur adipiscing elit
  3. Integer molestie lorem at massa

This is another ordered list

  1. You can use sequential numbers…
  2. …or keep all the numbers as 1.

Start numbering with offset:

  1. foo
  2. bar


Inline code

Indented code

// Some comments
line 1 of code
line 2 of code
line 3 of code

Block code “fences”

Sample text here...This is code block...paste some code here to try


Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

Right aligned columns

Option Description
data path to data files to supply the data that will be passed into templates.
engine engine to be used for processing templates. Handlebars is the default.
ext extension to be used for dest files.

markdown syntax

[link text](


link text

Add “title text” (which shows up under the cursor)

[link with title]( "title text!")


link with title

Most URLs will automatically be turned into links. To be explicit, just write it like this:

Autoconverted link <>


Autoconverted link

You can also put the [link URL][1] below the current paragraph
like [this][2].

   [1]: http://url
   [2]: http://another.url "A funky title"


You can also put the link URL below the current paragraph like this.

Here the text “link URL” gets linked to “http://url”, and the lines showing “1: http://url” won’t show anything.

Or you can use a shortcut reference, which links the text “shortcut” to the link named “shortcut” on the next paragraph.

Or you can use a [shortcut][] reference, which links the text
"shortcut" to the link named "[shortcut]" on the next paragraph.

[shortcut]: http://goes/with/the/link/name/text


Or you can use a shortcut reference, which links the text “shortcut” to the link named “shortcut” on the next paragraph.


To include an image, just put a “!” in front of a text link:


output: Minion

The alternate text will show up if the brower can’t load the image. You can also use a title if you want, like this:

![Stormtroopocat]( "The Stormtroopocat")



Like links, Images also have a footnote style syntax

![Alt text][id]
[id]:  "The Dojocat"


Alt text

With a reference later in the document defining the URL location:


+1 :+1:
smile :smile:
laughing :laughing:
wink :wink:
grin :grin:
cry :cry:
confused :confused:
yum :yum:

You can find the Emoji from this link


Footnote 1 link1.

Footnote 2 link2.

Inline footnote^[Text of inline footnote] definition.

Duplicated footnote reference2.


This is HTML abbreviation example.

It converts “HTML”, but keep intact partial entries like “xxxHTMLyyy” and so on.

因为本 Jekyll 在 _config.yml 中配置使用 kramdown markdown解释器,所以更多的语法可以参考官方语法页面


使用 MathJax

使用行内模式 $x^2$ 显示为 $x^2$

使用块模式,用 $$ ... 公式内容 ... $$ 来格式:

这里提供在线 LeTex 公式编辑

  1. Footnote can have markup and multiple paragraphs.

    paragraph 2 this is some text。 

  2. Footnote text.  2

2015-09-10 intro , beginner , jekyll , tutorial






在古代,所有情况下“朴”的发音都是“普角切”。唯一的例外是作为姓氏。“朴”姓非汉族姓氏,三国时代有夷王“朴胡”。《文选》陈琳《檄吴将校部曲文》有“巴夷王朴胡、賨邑侯杜濩各帅种落,共举巴郡,以奉王职”。《三国志·魏志·武帝纪》有 “建安二十年(公元215年)“九月,巴七姓夷王朴胡举巴夷来附”。《集韵》注云:“披尤切。夷姓也。”可见在当时作为姓氏,“朴”的发音与一般情况下不同。但是第一,即使披尤切,中古拟音phiu,按演变规律今天普通话也应该读作pou;第二当时的朴姓与后来新罗的朴姓未必同源。因此piao音在音韵学上无可信依据。有一说法则认为是朝鲜语固有词“박”的意译“瓢”(piáo)。

我没有找到任何证据显示说“朴”字的发音应该念成piao,维基中也提到一句,“piao音在音韵学上无可信依据 ”。于是我继续寻找证据,说文解字中的解释





根据朝鲜半岛新罗的开国君主、朴姓的始祖赫居世的传说,相传赫居世是从天上飞来的白马生下的紫卵中出生的,卵形同瓢,所而取姓为朴。朴是朝鲜语“박”的音译。박意味瓢。 (按:”호박”이라는 “박”)







###主题:“朴”字的音(1) 版权所有:了了斋 原作

提交时间:08:52:37 08月07日

[按] 【我本来也是跟兄一样,想等方言的材料说明这几个音的关系。看来不容易。也许大家和你我一样,都是平时只用“朴素”的音,其它的音是从字典上查出来的。我是既没见过朴树,也没吃过厚朴。姓朴的也只知道是朝鲜族的大姓,可是说实话,我还没遇到过姓朴的呢。想兄暂时还一筹莫展,我就先走一步,试着回答一下。请兄海涵。


“朴(繁体)”在《广韵》里出现在 4个地方,分别是:

(2)屋韵,蒲木切:“《尔雅》云:漱(不是水旁,是木旁)朴,心。又音卜。” 折合今音是bu2。





###主题:“朴”字的音(2) 版权所有:了了斋 原作

提交时间:06:34:00 08月08日

(1) po1,朴刀。
(2) po4,朴树。朴硝。
(3) piao2,姓。
(4) pu3,朴厚,朴陋,朴茂,朴实,朴素,朴学,朴直。

###主题:“朴”字的音(3) 版权所有:了了斋 原作

提交时间:07:18:17 08月09日


(1) 树皮。《文选·王褒〈洞箫赋〉》:“秋蜩不食抱朴而长吟兮。”李善注引《仓颉篇》:“朴,木皮也。”
(2) 未经加工的木材。《论衡·量知》:“无刀斧之断者谓之朴。”
(3) 原价,本钱。《商君书·垦令》:“贵酒肉之价,重其租,令十倍其朴。”
(4) 敦厚;质朴。《孔子家语·王言解》:“民敦俗朴。”陆机《羽扇赋》:“创始者恒朴,而饰终者必妍。”
(5) 老子用语。指原始自然质朴的存在,即“道”。……


###主题:“朴”字的音(4) 版权所有:了了斋 原作

提交时间:19:55:57 08月10日


“朴”字以“噗(没有口)”得声。从前面引的《广韵》里就可以看出,四个字里有两个都是“屋”韵,而不是“觉”韵。翻开《广韵》更可以知道,这个声符的字在“屋”韵里的跟在“觉”韵里的完全不成比例,加上“沃”韵和“烛”韵的就更多了(今天可以同韵)。下面把字引在下面,不需要认识,可以有一个概略的印象(以下用 + 号代替这个声符):




###主题:“朴”字的音(5) 版权所有:了了斋 原作

提交时间:11:59:11 08月13日

有人说,语音的特点就是“习非成是”。这话不假。前一阶段大家都因“呆dai”“呆ai”二字语音合并而议论纷纷。这二字原来的意义是有差别的。ai是死板,死心眼的意思;dai是发愣,精神不正常的意思。一个人死板,不一定发愣;一个人是呆子,看问题可不一定死板(多数时候,他不看问题),有时候呆子还会突发奇想。可是“呆子”是书面上常见字,ai是口语字,现在的读书人又不常说这个词,最后dai 的音就战胜了ai 的音。(读书人也不见得不说ai,我有一回在课堂上听见周祖谟先生说,“看问题也不能太ai了。”而且周先生的发音前面还带有声母ng。不知道是北京话的底层还是周先生特有的地方口音。可惜一代鸿儒,转眼之间就不在了,求教无门。)dai、ai合一是最近刚刚发生的事,众情汹涌。有些是历史上的事,人们也就安之若素了。举个例子来说,“三分之一”现在大家都读“fen1”,其实这个字本念“fen4”,浊声母。吴语区的人大概还能分出来。意思是三份儿里的一份儿。现在大家按“分”理解,好像也讲得通,然而终究不能那么妥贴。不过硬要讲妥贴,也未免太ai了;可是全然不去动脑筋,不就成了“呆子”了?(我没有责怪的意思——难得糊涂,也许是一种大智。)




###主题:“朴”字的音(6) 版权所有:了了斋 原作

提交时间:10:42:51 09月04日








###主题:“朴”字的音(7) 版权所有:了了斋 原作

提交时间:07:38:41 09月05日






脚角骨铁血曲谷雪宿(xiu3)柏塔法色(shai3)室(shi3)…… 事实胜于闭着眼睛的方法。这个结果无疑是对的。(我一点也没有否定方法的意思,我否定的是闭着眼睛的方法。我在一篇文章中说过,方法是客观规律的对应物。如果你拿来一种方法,居然可以解决问题,那只是说,那个事物的规律还没有用这种方法解决过,不是说那个方法是万能的。)——不过,就我的看法,平山先生对形成原因的解释还不能令人首肯,至少未达一间,有一个结还没有解开。目前这个发现是2+1=1,还不是1+1=1,希望有志于此的能最后解开这个语言学领域里的哥德巴赫猜想之谜。



###主题:“朴”字的音(8) 版权所有:了了斋 原作

提交时间:07:16:38 09月06日





###主题:“朴”字的音(9) 版权所有:了了斋 原作

提交时间:07:17:46 09月06日



###主题:“朴”字的音(10) 版权所有:了了斋 原作

提交时间:07:19:16 09月06日



###主题:“朴”字的音(尾声) 版权所有:了了斋 原作

提交时间:07:08:48 09月07日






整段文字引用自《北京大学中国语言学研究中心》,很可惜,这个网站在我访问的时候已经无法访问,我不清楚为什么,最后只是简单的利用Google Cache找到了一些源头。




韓國姓“朴”讀作pak,是符合“普角切”在韓語中的演變規律的。那麽普通話也應該考慮“普角切”這個中古音節在普通話中是怎麽轉變的。還有個可能性是根據《集韻》“披尤切,音䬌。夷姓。” 用現代音,披pi2尤you2切出piou2,piou3不符合北京音系,就用近似的piao2。還是錯!

来自新一届普通话审音委员 北大中文论坛








  • 使用 pyenv 管理 Python 版本 记录一下使用过程,留备以后使用。
  • 电影网站评分机制 年前的时候喉舌媒体批评豆瓣,猫眼等评分太低影响了票房,而导致16年的年度票房目标没有达到,广电很生气,后果很严重。可是豆瓣存在了那么多年,那么多的电影,在院线上映的,还是不上映的,从来也没有听说过 IMDB 或者 烂番茄的评分会影响到总体的票房。虽然得分的多少或多或少的会对票房有所影响,可这难道是豆瓣,或者 IMDB 或 烂番茄这样的影评网站应该承担的责任吗? 制片公司,发行商,甚至细化到导演,演员,剧本,在国内甚至可以拉上审查来负责,动不动删掉个14分钟,谁还愿意花了冤枉钱去大荧幕看一个不完整的片子呢?真正的影迷 大概会愿意花个机票钱去看一个完整版吧。
  • Openwrt 平均负载 Openwrt 在 Luci 后台很显眼的位置有三个不断刷新的数字,其实这个数字是“平均负载”(Load Average)的意思,这是 Linux 操作系统衡量系统负载和稳定性的重要参数。
  • Openwrt 设置 在上一篇中讲了如何刷Openwrt,这一篇主要讲一些 Openwrt 的东西,以及配置相关的内容。我有一个主路由器,设置分配的局域网地址为 192.168.1.x,给内网中分配的地址也是 192.168.1.x 开头。
  • TP LINK MR12U 刷 openwrt 今天翻箱倒柜竟然找出了我的 TP-LINK MR12U,很早之前因为3G上网卡而买的便携式路由,突然脑袋一热,干嘛不试试刷个 Openwrt 呢。记得当时是没有支持的,但是一搜竟然发现了 Openwrt 有官方支持了。于是开始动手。