Skip to content

Instantly share code, notes, and snippets.

View tuxology's full-sized avatar
💭
Nothing

Suchakra Sharma tuxology

💭
Nothing
View GitHub Profile
[suchakra@moria tracing]$ sudo ./open2ctf.py
trace path: /tmp/tmp26ga140x
^C[suchakra@moria tracing]$ babeltrace /tmp/tmp26ga140x
[00:24:50.796162597] (+?.?????????) 0 do_sys_open: { }, { pid = 909, comm = "iio-sensor-prox", filename = "/dev/iio:device2" }
[00:24:50.796399646] (+0.000237049) 0 do_sys_open: { }, { pid = 909, comm = "iio-sensor-prox", filename = "/dev/iio:device4" }
[00:24:50.801229686] (+0.004830040) 0 do_sys_open: { }, { pid = 1206, comm = "gnome-shell", filename = "/proc/self/stat" }
[00:24:50.801430938] (+0.000201252) 0 do_sys_open: { }, { pid = 1734, comm = "gnome-shell", filename = "/proc/self/stat" }
[00:24:50.807656245] (+0.006225307) 0 do_sys_open: { }, { pid = 18399, comm = "gnome-settings-", filename = "/proc/self/fd" }
[00:24:50.808197672] (+0.000541427) 0 do_sys_open: { }, { pid = 18399, comm = "gnome-settings-", filename = "" }
[00:24:50.816850646] (+0.008652974) 0 do_sys_open: { }, { pid = 18399, comm = "gsd-backlight-h", filename = "/etc/ld.so.cache" }
#!/bin/bash
indent -nbad -bap -nbc -bbo -hnl -br -brs -c33 -cd33 -ncdb -ce -ci4 \
-cli0 -d0 -di1 -nfc1 -i8 -ip0 -l80 -lp -npcs -nprs -npsl -sai \
-saf -saw -ncs -nsc -sob -nfca -cp33 -ss -ts8 -il1 \
$1
@tuxology
tuxology / disCPUscaling.sh
Last active December 8, 2016 22:53
Disable CPU Scaling
#!/bin/bash
# For more info : https://wiki.archlinux.org/index.php/CPU_frequency_scaling
set_scaling_gov() {
gov=${1-performance}
for i in $(ls -1 /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
echo ${gov} | sudo tee $i > /dev/null
done
}
#!/bin/bash
set -e -x
numcpu=$(grep -c ^processor /proc/cpuinfo)
git clone https://github.com/llvm-mirror/llvm.git
git clone https://github.com/llvm-mirror/clang.git llvm/tools/clang
mkdir llvm/build/
cd llvm/build/
cmake .. \
-- JUDY --
-- Based on demo by Shane Riley's : https://gist.github.com/shaneriley/cae98eac6136e7293b28 --
player = {}
player.x = 20
player.y = 20
player.sprite = 0
player.speed = 3
function move()
player.moving = true
# IMAP server Login
set spoolfile=imaps://yourdomain.com/INBOX
set imap_user=your.email.id@yourdomain.com
mailboxes = imaps://yourdomain.com/INBOX
set imap_check_subscribed
# Useful if you use the sidebar-patched mutt
set sidebar_width= 30
set sidebar_visible= yes
@tuxology
tuxology / Makefile
Last active December 20, 2015 07:09
Gives address of a given symbol in the binary and size of the first instruction at that symbol address. depends on libbfd and libdistorm3. Distorm64 may work too
sym2addr:sym2addr.c
gcc -Wall -ggdb sym2addr.c -o sym2addr -lbfd -ldistorm3
clean:
rm -f sym2addr
@tuxology
tuxology / Makefile
Created May 17, 2013 21:16
Tracepoint to get integer values from mutatee + modifications for x86_64 libs
all: dyntp.so mutator mutatee
dyntp.so: dyntp.o
gcc -shared -fPIC -DPIC $^ -ldl -llttng-ust -O0 -o $@
dyntp.o: dyntp.c ust_test.h
gcc -I. -fno-strict-aliasing -Wall -g -O0 -c $< -fPIC -DPIC -o $@
mutator: mutator.o
g++ $^ -L/usr/lib64/dyninst -ldyninstAPI -o $@
#!/bin/bash
set_scaling_gov() {
gov=${1-performance}
for i in $(ls -1 /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor); do
echo ${gov} | sudo tee $i > /dev/null
done
}
set_scaling_gov
[root@linus tracing]# cat trace
# tracer: irqsoff
#
# irqsoff latency trace v1.1.5 on 4.3.0-rc3+
# --------------------------------------------------------------------
# latency: 9994 us, #14/14, CPU#1 | (M:desktop VP:0, KP:0, SP:0 HP:0 #P:4)
# -----------------
# | task: insmod-29922 (uid:0 nice:0 policy:0 rt_prio:0)
# -----------------
# => started at: do_one_initcall