Skip to content

Instantly share code, notes, and snippets.

@etaf
etaf / tmux.conf
Created July 23, 2018 01:50
tmux config
set-option -g allow-rename off
set-option -g history-limit 10000
set-option -g mouse on
@etaf
etaf / pip configuration
Created July 22, 2018 07:18
pip configuration
sudo easy_install pip
cat ~/.pip/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
[install]
trusted-host=mirrors.aliyun.com
@etaf
etaf / mac build tmux
Created July 22, 2018 07:07
mac build tmux
```bash
brew install automake pkg-config libevent
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure --prefix=$HOME/.local
make -j8 && make install
```
@etaf
etaf / build tmux
Created July 22, 2018 07:07
build tmux
```bash
brew install automake pkg-config libevent
git clone https://github.com/tmux/tmux.git
cd tmux
sh autogen.sh
./configure --prefix=$HOME/.local
make -j8 && make install
```
@etaf
etaf / gtags with python support
Last active May 16, 2019 05:20
gtags with python support
# 1 install universal ctags first.
# if mac:
# brew install libxml2
# ln -s /usr/local/Cellar/libxml2/2.9.9_2/include/libxml2/libxml /usr/local/include/libxml
git clone https://github.com/universal-ctags/ctags.git
cd ctags
./autogen.sh
./configure --prefix=${HOME}/.local
make -j$(nproc) && make install
@etaf
etaf / yum_download_only.sh
Last active August 5, 2017 08:53
yum download only
yum install yum-utils
# use --resolve to download dependencies.
yumdownloader --destdir ./rpms --resolve <package>
# on other machine
cd rpms
yum --disablerepo=* localinstall *.rpm -y
@etaf
etaf / auto_passwd.exp
Created January 19, 2017 13:56
auto_passwd
#!/usr/bin/expect
set timeout 20
set cmd [lrange $argv 1 end]
set password [lindex $argv 0]
eval spawn $cmd
expect "assword:"
send "$password\r";
spinner() {
local spin="\\|/-"
local i=0
tput civis
while kill -0 "$1" 2>/dev/null; do
i=$(( (i+1) %4 ))
printf "\b%s" "${spin:$i:1}"
sleep 0.07
done
tput cnorm
@etaf
etaf / vimrclocal
Created January 24, 2016 07:40
vimrclocal
" set F5 for compile and run c/cpp/python
"map <C-F5> : call CompileRunC()<CR>
map <F5> : call CompileRunCpp()<CR>
"map <F5>: call DebugCpp()<CR>
"map <F6> : call RunPython()<CR>
map <F6> : call RunShell()<CR>
func! CompileRunC()
exec "w"
exec "!gcc -std=c++11 -g -lboost_program_options -lpthread -lboost_system -lboost_filesystem % -o %<"
@etaf
etaf / gdbinit
Created January 24, 2016 07:24
gdbinit
#
# STL GDB evaluators/views/utilities - 1.03
#
# The new GDB commands:
# are entirely non instrumental
# do not depend on any "inline"(s) - e.g. size(), [], etc
# are extremely tolerant to debugger settings
#
# This file should be "included" in .gdbinit as following:
# source stl-views.gdb or just paste it into your .gdbinit file