Skip to content

Instantly share code, notes, and snippets.

#!/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
@simonclausen
simonclausen / saltstack.sh
Created June 21, 2019 11:59 — forked from michaelkarrer81/saltstack.sh
[Saltstack Cheat Sheet] #saltstack
# ============
# COMMON TASKS
# ============
# Run state.sls file on minion(s)
salt -G 'os:Ubuntu' state.apply ubuntu1401 # Formula file name without .sls at the end
salt -G 'os:Ubuntu' state.apply ubuntu1401 test=True # Test only (dryrun)
salt -G "minion_roles:ONLINE" state.apply execute_script_example pillar='{"single_instance_update": "aiat"}'
# Webhook state.sls example
@simonclausen
simonclausen / gist:905dba3d0ba9de928b3d832fa92fd0a1
Created June 13, 2018 11:32 — forked from marvin/gist:1017480
syslog calculate facility and severity from PRI(priority)
example:
PRI = 191
To get the Facility
Divide the PRI number by 8.
191/8 = 23.875
The whole number part is the facility.
To get the Severity
# on port 9201
DELETE /index_es1
PUT /index_es1
{
"settings": {
"number_of_shards": 1
, "number_of_replicas": 0
}
@simonclausen
simonclausen / gist:a406aee272849171af44
Last active August 29, 2015 14:25 — forked from atcuno/gist:3425484ac5cce5298932
HowTo: Privacy & Security Conscious Browsing

The purpose of this "howto" is to document how browsing can be done in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the "How to Contribute" section for information on contributing your own knowledge.

Table of Contents