Skip to content

Instantly share code, notes, and snippets.

@reintakura
reintakura / bash.generate.random.alphanumeric.string.sh
Last active June 29, 2021 23:00 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@reintakura
reintakura / .. MediaCreationTool.bat ..md
Created June 6, 2021 03:14 — forked from AveYo/.. MediaCreationTool.bat ..md
Universal MediaCreationTool wrapper for all MCT Windows 10 versions from 1507 to 21H1 with business (Enterprise) edition support

use download ZIP button or pastebin link to get the script, as saving the Raw file breaks line endings

Preview

Dialogs to pick version, then to pick Default (vanilla MCT) and Auto-Upgrade or Create-Media (enhanced)

Enhanced script name args parsing - just rename the script with:
auto MediaCreationTool.bat to auto upgrade 21H1 - unattended, usually straight to desktop
auto update 1909 MediaCreationTool.bat to auto upgrade 1909 with Dynamic Update (latest LCU)
pro auto 20H2 MediaCreationTool.bat to auto upgrade 20H2 and force Professional edition

@reintakura
reintakura / gist:5c52877b0b2c804c1865acec1554f440
Created April 22, 2020 15:28 — forked from mwinters0/gist:c70d195c5c5670d1625f
Shell one-liner to parse apache access logs and extract a unique URL list with hit count, querystring excluded.
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sed 's/\?.*//g' | sort | uniq -c | sort -rn > url_hits.txt
@reintakura
reintakura / Content Security Policy - Permissive Mode
Created April 10, 2020 03:44
allow all content, just add CSP header
default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval' 'unsafe-dynamic';
script-src * data: blob: 'unsafe-inline' 'unsafe-eval';
connect-src * data: blob: 'unsafe-inline';
img-src * data: blob: 'unsafe-inline';
frame-src * data: blob: ;
style-src * data: blob: 'unsafe-inline';
font-src * data: blob: 'unsafe-inline';
@reintakura
reintakura / nginx.conf
Created April 9, 2020 15:05 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
cat aaa.txt | python3 -c "import sys; from urllib.parse import unquote; print(unquote(sys.stdin.read()));"
for s in 192.168.1.{1..254}; do ssh ubuntu@${s} 'uname -a && hostname' ; done
for s in 192.168.1.{1..254}; do scp -i key.pem ubuntu@${s}:/remote/dir/foobar.txt /local/dir ; done
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
#OpenSSL encrypt
openssl enc -[algoritma] -in plain.txt -out encrypted.txt
openssl enc -d -[algoritma] -in encrypted.txt -out plain.txt
#Example
openssl enc -aes-256-cbc -in plain.txt -out encrypted.txt
openssl enc -d -aes-256-cbc -in encrypted.txt -out encrypted.txt
@reintakura
reintakura / Install MobSF Ubuntu 18.04
Created January 15, 2020 02:34
Installing MobSF on Ubuntu 18.04
Update Repo
$ sudo apt get update
Install git
$ sudo apt install git
Install python package
$ sudo apt install python3-pip python3-venv python3-pip python3-dev build-essential libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev zlib1g-dev
Install jdk