Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / gdbinit
Created July 23, 2018 01:51
gdb configuration
set history save
set history size 100000
set history filename ~/.gdb_history
set confirm off
set verbose off
set print pretty on
set print array off
set print array-indexes on
set trace-commands on
set logging on
@etaf
etaf / gdbcmd
Created July 23, 2018 01:52
gdb remote
set solib-search-path ./symbols/usr/lib/
file ./symbols/usr/bin/node
dir vm/v8/out
target remote :1234
b main
c
@etaf
etaf / install_cmake.sh
Created October 22, 2018 04:07
install cmake to local
wget from cmake official site
tar ...
./bootstrap --prefix=${HOME}/.local
make -j$(nproc) && make install
@etaf
etaf / fix.sh
Created October 25, 2018 12:02
mac externel displayer
https://www.jianshu.com/p/6274253b78d8
defaults write -g CGFontRenderingFontSmoothingDisabled -bool NO
@etaf
etaf / compile_linux_kernel.sh
Created October 31, 2018 10:04
compile linux kernel
find the corresponding source, eg 4.15
apt search linux-source
sudo apt-get install linux-source-4.15.0
cd /usr/src/linux-source-4.15.0/linux-source-4.15.0/
cp /boot/config-`uname -r` .config && make olddefconfig
#now we can modify the config
make -j `getconf _NPROCESSORS_ONLN` deb-pkg
dpkg -i linux-*.deb
@etaf
etaf / proxy_via_ssh.sh
Created November 7, 2018 06:47
proxy via ssh
# server: ss and polipo installed.
# polipo_port:8123, polipo config proxy type as socks5, and set corresponding ss_port
# then ssh to the machine which need proxy from server. assume your ss_port is 1080:
# ssh -R <port_on_target_machine>:<proxy_machine_address>:<correspon bindding port>
ssh -R 8123:localhost:8123 -R 1080:localhost:1080 target_machine_ip
# at target_machine:
if [[ "$1" == "off" ]]; then
unset http_proxy
unset https_proxy