Skip to content

Instantly share code, notes, and snippets.

View painfull30's full-sized avatar

Petrunin Alex painfull30

View GitHub Profile
@painfull30
painfull30 / load-test.sh
Last active May 1, 2020 07:44 — forked from bigomega/load-test.sh
A simple bash script to do load (performance) testing of a web service
max="$1"
date
echo "url: $2
rate: $max calls / second"
START=$(date +%s);
get () {
nice curl -s -insecure -v "$1" 2>&1 | tr '\r\n' '\\n' | awk -v date="$(date +'%r')" '{print $0"\n-----", date}' >> /tmp/perf-test.log
}
@painfull30
painfull30 / string-utils.js
Created September 5, 2018 12:09 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str){
return str.toLowerCase();
@painfull30
painfull30 / tccs.pl
Created December 31, 2017 10:27 — forked from jdeblese/tccs.pl
Modified version of tccs (http://tccs.sourceforge.net/) to add support for hfsc classes
#!/usr/bin/perl -w
# copyright 2005-2008 Tomasz Pala <gotar@pld-linux.org>
# Contributions by Jan-willem De Bleser, 2013
# license: GPL
# usage:
# watch -d -n1 'tc -s c ls dev imq1 | tccs -f 10 2>/dev/null'
# tccs.rc file format:
@painfull30
painfull30 / openwrt_guest_wifi.sh
Last active September 23, 2017 08:19 — forked from ruzickap/openwrt_guest_wifi.sh
OpenWrt - Guest WiFi configuration (2+5ghz)
uci set network.wifi_open=interface
uci set network.wifi_open.type=bridge
uci set network.wifi_open.proto=static
uci set network.wifi_open.ipaddr=10.0.0.1
uci set network.wifi_open.netmask=255.255.255.0
uci add wireless wifi-iface
uci set wireless.@wifi-iface[-1].device=radio0
uci set wireless.@wifi-iface[-1].mode=ap
uci set wireless.@wifi-iface[-1].ssid=Open-WiFi