Skip to content

Instantly share code, notes, and snippets.

aws iam deactivate-mfa-device --user-name [email protected] --serial-number \
arn:aws:iam::12345:mfa/user\@example.com
aws iam delete-virtual-mfa-device --serial-number arn:aws:iam::12345:mfa/user\@example.com
version: '2.2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.6.1
container_name: elasticsearch
environment:
#- node.name=es01
- cluster.name=es-docker-cluster
- bootstrap.memory_lock=true
- discovery.type=single-node
const Express = require("express");
const BodyParser = require("body-parser");
var app = Express();
app.use(BodyParser.json());
app.use(BodyParser.urlencoded({ extended: true }));
app.listen(3000, () => {});
#!/bin/sh
STACK_NAME=$1
FILE=$2
(aws cloudformation deploy \
--template-file "$FILE" \
--capabilities CAPABILITY_IAM \
--stack-name "$STACK_NAME" > /dev/null & \
) && watch -n 0.5 "aws cloudformation describe-stack-events \
--stack-name $STACK_NAME | \
#!/bin/sh
ip_private=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)
dns_name="<YOUR_DNS>"
template='{"Comment": "UPSERT record machines ","Changes": [{"Action": "UPSERT","ResourceRecordSet": {"Name":"%s","Type": "A","TTL": 300,"ResourceRecords": [{"Value": "%s"}]}}]}'
json_string=$(printf "$template" "$dns_name" "$ip_private")
echo $json_string > change-batch.json
aws route53 change-resource-record-sets --hosted-zone-id <ID_ZONE> --change-batch file://change-batch.json
rm -rf change-batch.json
for SRC in `find . -maxdepth 1`
do
DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
if [ "${SRC}" != "${DST}" ]
then
[ ! -e "${DST}" ] && mv -T "${SRC}" "${DST}" || echo "${SRC} was not renamed"
fi
done
strace -e trace=write -s1000 -fp <PID> 2>&1 | grep --line-buffered -o '".\+[^"]"' | grep --line-buffered -o '[^"]\+[^"]' | while read -r line; do printf "%b" $line; done
du --max-depth=1 /home/ | sort -n -r
# cd /etc/systemd/system
# cat << EOF > vbox.service
[Unit]
Description= Virtual Box Init System With Service
After=network.target
[Service]
Type=simple
ExecStart=/etc/init.d/vboxdrv setup