Xiaopei's DokuWiki

These are the good times in your life,
so put on a smile and it'll be alright

User Tools

Site Tools


it:linux:config

新系统配置

软件 softwares

terminator

可分屏的 terminal, shortcuts below

  • Ctrl+Shift+X - Toggle between showing all terminals and only showing the current one.
  • Ctrl+Shift+O - Split terminals Horizontally.
  • Ctrl+Shift+E - Split terminals Vertically.
  • Ctrl+Shift+Right - Move parent dragbar Right.
  • Ctrl+Shift+Left - Move parent dragbar Left.
  • Ctrl+Shift+Up - Move parent dragbar Up.
  • Ctrl+Shift+Down - Move parent dragbar Down.
  • Ctrl+Shift+W - Close the current terminal.
  • Ctrl+Shift+T - Open new tab
  • Ctrl+Plus (+) - Increase font size. Note: this may require you to press shift, depending on your keyboard
  • Ctrl+Minus (-) - Decrease font size. Note: this may require you to press shift, depending on your keyboard
  • Ctrl+Zero (0) - Restore font size to original setting.
~/.config/terminator/config
[global_config]
  title_transmit_bg_color = "#d30102"
  focus = system
 
[keybindings]
  # 类似 iterm 的 shortcuts
  new_tab = <Alt>T
 
  zoom_in = <Alt>equal
  zoom_out = <Alt>minus
  zoom_normal = <Alt>0
  toggle_zoom = <Alt>Return
 
  # paren cannot use ?! []
  cycle_next = <Alt>N
  cycle_prev = <Alt>P
  next_tab = <Alt><Shift>N
  prev_tab = <Alt><Shift>P
 
  split_vert = <Alt>D
  split_horiz = <Alt><Shift>D
  close_term = <Alt>W
 
  search = <Alt>F
 
  new_window = <Ctrl>N
 
  # xiaopei.li@2014/07/08
 
[profiles]
  [[default]]
    palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
    background_color = "#eee8d5"
    foreground_color = "#002b36"
    cursor_color = "#002b36"
    use_system_font = false
    font = Monospace 12
    show_titlebar = false
 
  [[solarized-dark]]
    palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
    foreground_color = "#eee8d5"
    background_color = "#002b36"
    cursor_color = "#eee8d5"
    use_system_font = false
    font = Monospace 12
    show_titlebar = false
 
  [[solarized-light]]
    palette = "#073642:#dc322f:#859900:#b58900:#268bd2:#d33682:#2aa198:#eee8d5:#002b36:#cb4b16:#586e75:#657b83:#839496:#6c71c4:#93a1a1:#fdf6e3"
    background_color = "#eee8d5"
    foreground_color = "#002b36"
    cursor_color = "#002b36"
    use_system_font = false
    font = Monospace 12
    show_titlebar = false

为什么 keybindings 中的 - 要用 minus,回车要用 Return,这些 key 的名字怎么定义?

查了 terminator 源码用了 gtk.gdk 这些好像都是与 GIMP 那个图像处理软件相关的

key 键名称列表见: https://git.gnome.org/browse/gtk+/tree/gdk/gdkkeysyms.h

  • GIMP - The GNU Image Manipulation Program
  • GTK+ - the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces
  • GDK - GIMP Drawing Kit, is a computer graphics library that acts as a wrapper around the low-level drawing and windowing functions provided by the underlying graphics system.

home 加密

检查 home 是否被加密: Ask Ubuntu

用户 foo 的 home 取消加密:

  1. 备份 ~foo 到其他目录
  2. 新建管理员用户登陆或单用户模式 root 登陆
  3. 删除 ~foo
  4. apt-get remove ecryptfs-utils libecryptfs0
  5. 从备份还原

在安装后加密 home: How to Encrypt Your Home Folder After Installing Ubuntu

中文

locale

$ dpkg-reconfigure locales
$ locale -a 

fonts

wqy

input method

ibus, ibus-sunpinyin

配置:/usr/lib/ibus-sunpinyin/ibus-setup-sunpinyin ( 需要先安装 python-glade2 )

auto

cannot autocomplete?

~/.bashrc
if [ -f /etc/bash_completion ]; then
  . /etc/bash_completion
fi 

sudo command cannot autocomplete?

~/.bashrc
if [ "$PS1" ]; then
  complete -cf sudo
fi

bash_alias

alias ll="ls -l"
alias psgrep="ps -A | grep"
alias killkill="kill -9"

terminal 的快捷键

bash 的快捷键默认与 emacs 相同(set -o emacs),但 terminal 也许会阻截 Alt-f 之类的 emacs 快捷键为打开File menu,then you can go to Edit→Keyboard Shortcuts and deselect Enable menu access keys 来解决这个问题。

DNS 不行?

# 设置
vi /etc/resolv.conf
 
search somedns.com
nameserver 4.2.1.1
nameserver 4.2.1.2
nameserver 4.2.1.3
 
# 检查
$ host baidu.com
$ host -t ns baidu.com

.bash_rc

  1. login shell:主要读取 /etc/profile 及 ~/.bash_profile
  2. non-logni shell:主要读取 ~/.bashrc 而已。
.bashalias
alias ifconfig.me='curl ifconfig.me'
alias killkill="kill -9"
alias hisgrep="history | grep"
 
my_http_proxy_port=8080
my_http_proxy_server=hehe.hehe
off_the_wall() {
	if $(ps aux |grep "my_http_proxy_port my_http_proxy_server" | grep -vq grep); then
		echo "already on the wall"
	else
		ssh -f -ND my_http_proxy_port my_http_proxy_server
		echo "ladder setted"
	fi
}
 
 
lh() {
       /bin/ls -lt $@ | head 
}
 
 
# safe rm(xiaopei.li@2012-12-13)
rm() {
	RMDIR=/home/xiaopei.li/.recycle/`date +%s`/
	mkdir -p $RMDIR
	for var in "$@"; do
		is_arg=`echo $var | grep '^\-'`
		if [[ ! $is_arg ]]; then
			mv "$var" $RMDIR
		fi			   
	done
}
 
mkcd() {
	mkdir -p "$1" && cd "$1"
}
alias mkcdtoday="mkcd `date +%m%d`"
 
alias sudo="sudo "
 
alias python-http-server='python -m SimpleHTTPServer'
alias regxp_debug='perl -Mre=debug -e '
alias my_jshint='echo jshint; jshint *.js config/* lib/*'
 
alias diff='colordiff'
 
alias l='ls -l'
alias sl='ls'
alias LS='ls'
alias SL='ls'
 
alias hisgrep='history | grep '
alias psgrep='ps aux | grep -v grep | grep '
 
alias qgit='git'
alias gitpull='git pull'
alias gitpush='git push'
alias gitstatus='git status'
alias gitdiff='git diff'
 
alias 长度=cd
 
alias rss_update='heroku run  --app xiaopei-rss rake fetch_feeds'
 
 
ssh-add ~/.ssh/id_dsa
.gitconfig
[user]
    name = Xiaopei Li
    email = toksea@gmail.com
[color]
    ui = always
    diff = true
[alias]
    idff = diff
    staged = diff --staged
    today = log --author=xiaopei --oneline --since="6am"
    amend = commit --amend
    cm = commit -m 
    unstage = reset HEAD

rm/unrm

mysql

mysql='mysql –default-character-set=utf8'

参考

it/linux/config.txt · Last modified: 2014/07/08 10:45 by admin