Skip to content

Instantly share code, notes, and snippets.

View svelleweetakealot's full-sized avatar

Stephan van Ellewee svelleweetakealot

View GitHub Profile
#!/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-zA-Z0-9' | fold -w 32 | head -n 1
@svelleweetakealot
svelleweetakealot / extract_image.sh
Created October 11, 2018 11:33 — forked from orodley/extract_image.sh
Extract base64-encoded images from an HTML file.
for image in `grep --color=never -Po 'data:image/[^;]*;base64,\K[a-zA-Z0-9+/]*' foo.html`; do echo -n "$image" | base64 -di > `mktemp image_XXXX`; done