Skip to content

Instantly share code, notes, and snippets.

@menski
menski / servload.man
Created July 22, 2012 22:22
servload man page
.TH SERVLOAD 1 servload\-VERSION
.SH NAME
servload \- service benchmark for HTTP and DNS performance evaluation
.SH SYNOPSIS
.B servload
.I url file
.RI [ method
.RI [ factor ]]
.SH DESCRIPTION
.B servload
@menski
menski / wub_theme
Created July 28, 2012 20:57
moc theme
#
# Theme: wub
# Author: Sebastian Menski <[email protected]>
# vim: et:ts=2:st=2:sw=2
background = white black
frame = white black
window_title = yellow black
directory = white black
selected_directory = white black blink
@menski
menski / gtkfont.vim
Created November 17, 2012 23:13
Increase and decrease gtk gui font size in vim
if &cp || exists("g:loaded_gtkfont") || !has("gui_gtk2") || !has("gui_running")
finish
endif
let g:loaded_gtkfont = 1
let s:save_cpo = &cpo
set cpo&vim
" keep default gui font size
let s:current_font = &guifont
@menski
menski / whereami.sh
Last active December 11, 2015 04:39
whereami bash function - prints external ip and geoip location
function whereami {
local apifile="$HOME/.ipinfodb"
if [ -f $apifile ]; then
curl -s --connect-timeout 1 --retry 5 "http://api.ipinfodb.com/v3/ip-city/?format=raw&key=$(cat $apifile)" | awk -F\; '
$1=="OK" {
$0 = tolower($0)
printf "IP: %s\nCountry: %s (%s)\nCity: %s (%s)\nPosition: %s %s\n", $3, $5, toupper($4), $7, $6, $9, $10
}
' | sed 's/\<./\u&/g'
else
@menski
menski / 95-monitor_hotplug.rules
Created May 22, 2013 13:58
udev montior hot-pluging
ACTION=="change", SUBSYSTEM=="drm", RUN+="/usr/local/bin/hotplug_monitor.sh"
@menski
menski / metric.py
Created May 30, 2013 06:59
salbnet soft and hard credits metric test
import sys
import random
from multiprocessing import Pool
def metric(maximal, backlog):
current = backlog[-1]
backlog = sorted(backlog)
count = len(backlog)
if count % 2 == 0:
@menski
menski / cyclemon.c
Created May 30, 2013 07:02
monitor unhalted cycles
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <sched.h>
#include <unistd.h>
#include <err.h>
#include <sysexits.h>
#include <time.h>
@menski
menski / download.log
Created July 13, 2013 19:21
servload multipart/byteranges patch and log file for www.salbnet.org
www.salbnet.org - - [11/Oct/2010:16:55:16 +0200] "GET /download/servload-0.7.1.tar.gz HTTP/1.1" 206 -
@menski
menski / PKGBUILD
Created August 9, 2013 19:29
archlinux brother dcp165c driver patch
pkgname=dcp165c
pkgver=1.1.2
pkgrel=2
pkgdesc="CUPS driver for Brother DCP-165 printer"
arch=('any')
license=('custom:Brother Industries')
depends=('cups')
makedepends=('libarchive' 'patch')
url="http://solutions.brother.com/linux/en_us/index.html"
source=(brother-dcp165c.patch http://www.brother.com/pub/bsc/linux/dlf/dcp165ccupswrapper-1.1.2-2.i386.rpm http://www.brother.com/pub/bsc/linux/dlf/dcp165clpr-1.1.2-2.i386.rpm)
@menski
menski / gist:9834978
Created March 28, 2014 15:08
test.txt
test