Skip to content

Instantly share code, notes, and snippets.

@illustris
illustris / dram0.asm
Created June 14, 2018 12:55
DRAM0_BASE disassembly
POP {R4, R5, R6, R7, R8, PC}
BL #0xFFFB7C0C
TST R4, #0x20
BNE #0xFFFFFFC0
B #0xFFFFFFC8
MOV R0, R5
BL #0xFFFB1698
CMP R0, #0
BNE #0xFFFFFFC0
B #0xFFFFFFD0
time ab -k -c 1000 -n 2000000 http://127.0.0.1:80/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 200000 requests
Completed 400000 requests
Completed 600000 requests
Completed 800000 requests
time ab -k -c 1000 -n 2000000 http://127.0.0.1:8080/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 200000 requests
Completed 400000 requests
Completed 600000 requests
Completed 800000 requests
time ab -k -c 1000 -n 2000000 http://127.0.0.1:3000/
This is ApacheBench, Version 2.3 <$Revision: 1807734 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 127.0.0.1 (be patient)
Completed 200000 requests
Completed 400000 requests
Completed 600000 requests
Completed 800000 requests
@illustris
illustris / gropen.sh
Last active March 27, 2019 04:25
Oneliner to open all grep -rIn matches in gedit one by one
egrep -o '^.*:[0-9]+' | sed -E 's/:([0-9]+)$/\n+\1/' | while read fname; do read lname; gedit "$fname" $lname; done
pacman -S wget git gawk bridge-utils iproute2 bzip2 make gcc clang patch ocaml bison flex gettext autoconf automake libtool python pciutils glibc python3 libvncserver libx11 libaio python zlib ncurses openssl sdl2 bzip2 e2fsprogs git xz yajl pixman dtc glib2 json-c fuse2 xz multipath-tools bin86 iasl

Install from aur

libcurl-openssl-1.0 uuid checkpolicy

Install bcc

@illustris
illustris / corss.sh
Last active December 5, 2019 06:30
get memory utilization of corosync
#!/bin/bash
print_usage() {
echo "$0 - Get memory utilization of corosync"
echo ""
echo "$0 [options]"
echo "Options:"
echo "-h, --help show help"
echo "-b, --byte print rss in bytes (could get printed in scientific notation)"
echo "-k, --kbyte print rss in bytes (could get printed in scientific notation)"
@illustris
illustris / emenu
Created December 16, 2019 14:15
dmenu + history
#!/bin/sh
cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
histsize=50
if [ -d "$cachedir" ]; then
cache=$cachedir/emenu
hist=$cachedir/emenu_hist
else
cache=$HOME/.emenu_cache # if no xdg dir, fall back to dotfile in ~
hist=$HOME/.emenu_cache_hist # if no xdg dir, fall back to dotfile in ~
fi
#define N 4
int *sort(int *arr, int len)
{
for(int i=0;i<len;i++)
{
for(int j=i+1;j<len;j++)
{
if(arr[i]>arr[j])
{
@illustris
illustris / freq.py
Created March 30, 2020 13:27
Quick script to count occurrences of terms in metrics
from collections import Counter
c = Counter()
for line in sys.stdin:
c.update(re.findall('.[^A-Z]*', line.split()[2].split('_')[2]))
print(c)