Skip to content

Instantly share code, notes, and snippets.

View arzzen's full-sized avatar
🤖
I'm borg...

arzzen

🤖
I'm borg...
  • ::1
  • 19:15 (UTC)
View GitHub Profile
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
@arzzen
arzzen / fingerprint.js
Created October 30, 2020 08:59
simple javascript fingerprint
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 July 19, 2020 08:16
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;"
@arzzen
arzzen / mysql_variables.sh
Created April 12, 2020 15:37
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"]
@arzzen
arzzen / mailmap.sh
Created February 25, 2020 07:36
mailmap.sh
#! /bin/sh
paster() {
while read email; do
[ -z "$email" ] || echo "$1" "$email"
done
}
grouper() {
IFS="<"
@arzzen
arzzen / commitsByWeekday.sh
Last active February 14, 2020 08:29
draft_fnc_commitsByWeekday
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 October 4, 2019 08:33
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 August 27, 2019 11:43
Redis simple key stats (total size, average size, count keys)
#!/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 August 22, 2018 06:45
Find and (safely) kill long running MongoDB queries
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 January 13, 2018 15:29 — forked from cmartinbaughman/GoogleHackMasterList.txt
The definitive super list for "Google Hacking".
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