Skip to content

Instantly share code, notes, and snippets.

@etaf
etaf / zshrc.local
Created May 7, 2019 01:42
customized zshrc local
function update_tags () {
rm -f tags GTAGS GRTAGS GPATH
ctags -R
gtags
}
#Force python not generate __pycache__
export PYTHONDONTWRITEBYTECODE=1
alias grepp="grep -nIR"
@etaf
etaf / clang_install.sh
Last active March 31, 2019 05:10
clang_install.sh
# Download:
git clone https://github.com/llvm/llvm-project.git
cd llvm-project/
# Configure
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=${HOME}/.local -DLLVM_ENABLE_PROJECTS=clang -G "Unix Makefiles" ../llvm
# Make and install
make -j$(nproc)
@etaf
etaf / llvm-install.sh
Last active January 9, 2024 18:56
llvm build and install and uninstall
# Download:
git clone https://github.com/llvm/llvm-project.git
cd llvm-project/llvm
# Configure
mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release
# build:
cmake --build . -j $(nproc)
https://github.com/vishaltelangre/ff
@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
@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 / 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 / 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 / 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 / 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