Skip to content

Instantly share code, notes, and snippets.

@kay21s
kay21s / Install_tmux
Created December 19, 2013 21:18 — forked from simme/Install_tmux
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
CPU_CLK_UNHALTED LLC_MISSES misalign_mem_ref
sudo opcontrol --event=CPU_CLK_UNHALTED:100000 --event=LLC_MISSES:100000 --event=misalign_mem_ref:3000000
sudo opcontrol --session-dir=/var/lib/oprofile/samples
sudo opcontrol --no-vmlinux
sudo opcontrol --session-dir=/var/lib/oprofile/samples --event=CPU_CLK_UNHALTED:100000 --event=LLC_MISSES:100000 --event=misalign_mem_ref:3000000 --no-vmlinux
1) debug forked process
set follow-fork-mode child/parent
2) catch signal by the program, not gdb
handle SIGINT nostop noprint pass
@kay21s
kay21s / gist:dd897a14691bf36e516e
Created May 30, 2014 16:27
git cancel last commit
git reset HEAD^
PS: HEAD^ is equal to HEAD~1
@kay21s
kay21s / gist:ed56c9c30dc5ea2a7cb6
Created July 6, 2014 21:02
reinstall nvidia driver in ubuntu
sudo apt-get --purge remove nvidia-*
sudo add-apt-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update
sudo apt-get install nvidia-current nvidia-settings
python -m pdb myscript.py arg1 arg2 ...
@kay21s
kay21s / dpdk
Last active August 29, 2015 14:04
dpdk
export RTE_SDK=~/dpdk-1.7.1
export RTE_TARGET=x86_64-native-linuxapp-gcc
sudo ./build/l2fwd -c f -n 1 -- -q 1 -p 1
sudo ./build/rx -c f -n 1 -- -q 1 -p 1
sudo ./build/tx -c f -n 1 -- -q 1 -p 1
sudo ./build/rt -c f -n 1 -- -q 1 -p 1
sudo ./build/tx -c 0x2 -n 1 --file-prefix p2 -m 64 -- -q 1 -p 1
sudo ./build/rx -c 0x1 -n 1 --file-prefix p1 -m 64 -- -q 1 -p 1
ethtool -C eth1 rx-usecs 0
++ Check which node the device belongs to ++
cat /sys/class/net/xge1/device/numa_node
cat /sys/class/net/xge1/device/local_cpus
/usr/src/linux-headers-3.13.0-30-generic/include
sudo ln -s /usr/src/linux-headers-3.13.0-30/arch/x86/include/asm ./asm
sudo ln -s /usr/src/linux-headers-3.13.0-30/arch/x86/include/uapi ./uapi
/usr/src/linux-headers-3.13.0-30/arch/x86/include/uapi
@kay21s
kay21s / gist:711962198f0fc15d0e3a
Last active August 29, 2015 14:04
power_saving
1) Disable Logical Processor in the BIOS
2) unload the acpi_pad module by running “rmmod acpi_pad”
3) Use a kernel parameter at boot time to prevent acpi_pad module from loading on server boot up. Append “acpi_pad.disable=1” to the kernel line
For Ubuntu:
http://askubuntu.com/questions/160036/how-do-i-disable-acpi-when-booting