Skip to content

Instantly share code, notes, and snippets.

Avatar
Fail Fast, Move On

Lukáš Mešťan arzzen

Fail Fast, Move On
View GitHub Profile
@arzzen
arzzen / fingerprint.js
Created Oct 30, 2020
simple javascript fingerprint
View fingerprint.js
var fingerprint = (function(window, screen, navigator) {
function checksum(str) {
var hash = 5381,
i = str.length;
while (i--) hash = (hash * 33) ^ str.charCodeAt(i);
return hash >>> 0;
}
@arzzen
arzzen / mysql_create_newuser_newdb.sh
Created Jul 19, 2020
mysql_create_newuser_newdb.sh
View mysql_create_newuser_newdb.sh
#! /bin/bash
newUser='testuser'
newDbPassword='testpwd'
newDb='testdb'
host=localhost
#host='%'
commands="CREATE DATABASE \`${newDb}\`;CREATE USER '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT USAGE ON *.* TO '${newUser}'@'${host}' IDENTIFIED BY '${newDbPassword}';GRANT ALL privileges ON \`${newDb}\`.*
TO '${newUser}'@'${host}';FLUSH PRIVILEGES;"
View mysql_variables.sh
#!/bin/sh#
mysql -e "show variables; show status" | awk '
{
VAR[$1]=$2
}
END {
MAX_CONN = VAR["max_connections"]
MAX_USED_CONN = VAR["Max_used_connections"]
BASE_MEM=VAR["key_buffer_size"] + VAR["query_cache_size"] + VAR["innodb_buffer_pool_size"] + VAR["innodb_additional_mem_pool_size"] + VAR["innodb_log_buffer_size"]
View mailmap.sh
#! /bin/sh
paster() {
while read email; do
[ -z "$email" ] || echo "$1" "$email"
done
}
grouper() {
IFS="<"
@arzzen
arzzen / commitsByWeekday.sh
Last active Feb 14, 2020
draft_fnc_commitsByWeekday
View commitsByWeekday.sh
function commitsByWeekday() {
optionPicked "Git commits by weekday:"
echo -e "\tday\tsum"
local counter=1
for i in Mon Tue Wed Thu Fri Sat Sun
do
echo -en "\t$counter\t$i\t"
git -c log.showSignature=false shortlog -n $_merges --format='%ad %s' \
$_since $_until | grep "$i " | wc -l
counter=$((counter+1))
@arzzen
arzzen / accesslog.sh
Last active Oct 4, 2019
accesslog.sh
View accesslog.sh
#!/bin/bash
LOGFILE="access.log"
LIMIT=10
while getopts l:f: option
do
case "${option}"
in
l) LIMIT=${OPTARG};;
@arzzen
arzzen / redis_simple_key_stats.sh
Created Aug 27, 2019
Redis simple key stats (total size, average size, count keys)
View redis_simple_key_stats.sh
#!/usr/bin/env bash
human_size() {
awk -v sum="$1" 'BEGIN {
hum[1024^3]="Gb";
hum[1024^2]="Mb";
hum[1024]="Kb";
for (x=1024^3; x>=1024; x/=1024) {
if (sum>=x) {
@arzzen
arzzen / mongodb_find_and_kill_slow_query.js
Created Aug 22, 2018
Find and (safely) kill long running MongoDB queries
View mongodb_find_and_kill_slow_query.js
var maxSecsRunning = 600;
var dryRun = true;
var currOp = db.currentOp();
for (var oper in currOp.inprog) {
var op = currOp.inprog[oper-0];
if (op.secs_running > maxSecsRunning && op.op == "command" ) {
print("Killing opId: " + op.opid
+ " running for over secs: "
+ op.secs_running
@arzzen
arzzen / GoogleHackMasterList.txt
Created Jan 13, 2018 — forked from cmartinbaughman/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
View GoogleHackMasterList.txt
admin account info" filetype:log
!Host=*.* intext:enc_UserPassword=* ext:pcf
"# -FrontPage-" ext:pwd inurl:(service | authors | administrators | users) "# -FrontPage-" inurl:service.pwd
"AutoCreate=TRUE password=*"
"http://*:*@www&#8221; domainname
"index of/" "ws_ftp.ini" "parent directory"
"liveice configuration file" ext:cfg -site:sourceforge.net
"parent directory" +proftpdpasswd
Duclassified" -site:duware.com "DUware All Rights reserved"
duclassmate" -site:duware.com
View install-php7.2-mcrypt.sh
##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#
You can’t perform that action at this time.