Skip to content

Instantly share code, notes, and snippets.

View ethercflow's full-sized avatar
🎯
Focusing

Wenbo Zhang ethercflow

🎯
Focusing
  • SmartX
  • China
View GitHub Profile
@HenningTimm
HenningTimm / rust_mem_profiling.md
Last active May 4, 2024 03:48
Memory profiling Rust code with heaptrack in 2019
@siddontang
siddontang / cpu_tenancy.py
Last active July 24, 2018 13:49
A tool to show how the thread runs on different CPUs
#!/usr/bin/python
import sys
import re
# perf record -F 99 -p $1 -e "sched:sched_stat_runtime" -a -- sleep 20
# perf script -F comm,pid,tid,cpu,time | python cpu_tenancy.py
#
# time-monitor-wo 79618/79634 [007] 11994704.695317:
# grpc-server-1 79618/79954 [006] 11994704.717969:
@franciscbalint
franciscbalint / restart_bluetooth.sh
Last active July 19, 2018 12:00 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X/macOS Sierra without restarting
#!/bin/bash
# To run this script you need to give execute permission.
# $chmod +x restart_bluetooth.sh;
# If you want only to restart:
# $ ./restart_bluetooth.sh;
# If you want to turn bluetooth on;
# $ ./restart_bluetooth.sh 1;
# If you want to turn bluetooth off;
# $ ./restart_bluetooth.sh 0;
@digilist
digilist / delay.sh
Created June 2, 2015 14:29
Delaying network traffic to a specific IP
#!/bin/bash
interface=lo
ip=10.0.0.1
delay=100ms
tc qdisc add dev $interface root handle 1: prio
tc filter add dev $interface parent 1:0 protocol ip prio 1 u32 match ip dst $ip flowid 2:1
tc qdisc add dev $interface parent 1:1 handle 2: netem delay $delay
@kwk
kwk / Makefile
Last active March 17, 2024 22:54
Compiling with Address Sanitizer (ASAN) with CLANG and with GCC-4.8
.PHONY: using-gcc using-gcc-static using-clang
using-gcc:
g++-4.8 -o main-gcc -lasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc
using-gcc-static:
g++-4.8 -o main-gcc-static -static-libstdc++ -static-libasan -O -g -fsanitize=address -fno-omit-frame-pointer main.cpp && \
ASAN_OPTIONS=symbolize=1 ASAN_SYMBOLIZER_PATH=$(shell which llvm-symbolizer) ./main-gcc-static
#!/usr/bin/env bash
set -x
target=$1
for i in /usr/src/linux/fs/ext4/ext4.ko /usr/src/linux/vmlinux; do
scp -P2204 root@localhost:$i ./
done
@apurvam
apurvam / graphdb-simulator.cpp
Last active December 16, 2020 19:55
A program which simulates the read and write behavior of LinkedIn's GraphDB
/* Instructions on compilation and execution
* =========================================
*
* Compile this program with pthreads:
*
* g++ -Wall -lpthread -o graphdb-simulator graphdb-simulator.cpp
*
* Before you run this program, you need to create the following
* directories:
*