Skip to content

Instantly share code, notes, and snippets.

@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active November 9, 2024 08:57
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

##Find everything enclosed in tags <primaryAddress>[\s\S]*?<\/primaryAddress>

Use i Modifier for finding across lines!

@marc1706
marc1706 / merge_32x_pr.sh
Last active June 17, 2019 08:04
Bash scripts for merging and pushing GitHub pull requests for phpBB
#!/bin/bash
set -e
PR=$1
git checkout 3.2.x && git fetch upstream && git fetch origin && git reset --hard upstream/3.2.x && hub merge $1 && git push origin 3.2.x
git checkout 3.3.x && git reset --hard upstream/3.3.x && git merge --no-ff --no-edit 3.2.x && git push origin 3.3.x
git checkout master && git reset --hard upstream/master && git merge --no-ff --no-edit 3.3.x && git push origin master