ubuntu 使用小技巧
一、terminal使用
- 使用tmux,让你一个窗口分割
- 修改窗口标题:
修改文件~/.bash.rc添加# Update gnome terminal title
function termtitle() {
# take argument
PS1="\u@\h:\w$ "
TITLE=$1
shift
# update title
PROMPT_COMMAND=‘echo -ne “\033]0; $TITLE \007”’
}
```
在终端输入```termtitle "new title"```即可把窗口名称改为"new title"
- 缩短命令行的前缀xxx@xxxx,修改~/.bashrc文件的PS1变量
if [ "
c
o
l
o
r
p
r
o
m
p
t
"
=
y
e
s
]
;
t
h
e
n
P
S
1
=
′
color_prompt" = yes ]; then PS1='
colorprompt"=yes];thenPS1=′{debian_chroot:+($debian_chroot)}[\033[01;32m]\u@\h[\033[00m]:[\033[01;34m]\w[\033[00m]$ ’
else
PS1='KaTeX parse error: Expected '}', got 'EOF' at end of input: …ebian_chroot:+(debian_chroot)}\u@\h:\w$ ’
fi
```
SSL 证书创建问题
根据官方方法:
https://www.akadia.com/services/ssh_test_certificate.html
在步骤
dl@dl:~/my_github/my_room/libevent_https$ openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
Signature ok
subject=/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd
Getting Private key
unable to write 'random state'
解决办法:
sudo rm ~/.rnd