Skip to content

Instantly share code, notes, and snippets.

illustris

Block or report user

Report or block illustris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@illustris
illustris / freq.py
Created Mar 30, 2020
Quick script to count occurrences of terms in metrics
View freq.py
from collections import Counter
c = Counter()
for line in sys.stdin:
c.update(re.findall('.[^A-Z]*', line.split()[2].split('_')[2]))
print(c)
View kaprekar_base.c
#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 / emenu
Created Dec 16, 2019
dmenu + history
View emenu
#!/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
@illustris
illustris / corss.sh
Last active Dec 5, 2019
get memory utilization of corosync
View corss.sh
#!/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)"
View Drakvuf on arch.md
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 / gropen.sh
Last active Mar 27, 2019
Oneliner to open all grep -rIn matches in gedit one by one
View gropen.sh
egrep -o '^.*:[0-9]+' | sed -E 's/:([0-9]+)$/\n+\1/' | while read fname; do read lname; gedit "$fname" $lname; done
View warp.log
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
View nginx.log
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
View apache.log
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
@illustris
illustris / dram0.asm
Created Jun 14, 2018
DRAM0_BASE disassembly
View dram0.asm
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
You can’t perform that action at this time.