Text file with hard line-breaks:
# vim:ts=4:sw=4:tw=79:wm=2
Golang source files with proper tab and spacing:
// vim:noet:noai:ts=4:sw=4
Text file with hard line-breaks:
# vim:ts=4:sw=4:tw=79:wm=2
Golang source files with proper tab and spacing:
// vim:noet:noai:ts=4:sw=4
#!/bin/bash | |
# | |
# hugepages_settings.sh | |
# | |
# Linux bash script to compute values for the | |
# recommended HugePages/HugeTLB configuration | |
# | |
# Note: This script does calculation for all shared memory | |
# segments available when the script is run, no matter it | |
# is an Oracle RDBMS shared memory segment or not. |
#!/bin/sh | |
set -u | |
NUMA_BEFORE=`numactl -H | grep free:` | |
SLAB_BEFORE=`grep Normal /proc/buddyinfo` | |
printf "Dropping page cache..." | |
sysctl -qw vm.drop_caches=1 | |
echo |
AGENT_SCRIPT=${HOME}/load-agent.sh | |
while true; do | |
[ -r ${AGENT_SCRIPT} ] && source ${AGENT_SCRIPT} | |
if [ -n "$SSH_AGENT_PID" ]; then | |
# ensure the variable actually reflects a running ssh-agent process | |
ps -p $SSH_AGENT_PID | grep -q ssh-agent$ && break | |
fi | |
# SSH_AGENT_PID is either not set or has stale PID | |
echo "Running ssh-agent" |
build/update database:
cd $PROJ_DIR
find . -path .git -path .svn -prune -o -name "*.[ch]" > cscope.files
cscope -bqk
browse code:
cscope -d
grep -A1 Normal /proc/zoneinfo ; echo "--"; sysctl vm.min_free_kbytes ; echo "--"; numactl -H | grep free
In order to avoid FreeBSD ntpd listen on wildcard interface,
add following lines to /etc/ntp.conf
:
interface ignore wildcard
interface listen 10.0.0.1
If you need to debug a panic on a remote FreeBSD system, but don't want to transfer large coredumps, and can't afford the downtime caused by KDB interrupting the boot process, a text dump may be the answer. textdump(4) is the kernel dump facility, which allows you to see the crash information in a text format. It also allows for configuration of exactly what information is captured, by scripting input as if you were at the KDB prompt on the console.
Textdump has certain requirements. First, you must be running FreeBSD 7.1 or higher, and your kernel config must include the following options.
options DDB
options KDB
options KDB_UNATTENDED
options KDB_TRACE
To build without debug symbols:
go build -ldflags="-s -w"
#!/bin/sh | |
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true | |
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true | |
defaults read com.apple.desktopservices |