This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, () => {}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stat -c %a [filename] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
du --max-depth=1 /home/ | sort -n -r |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
NewerOlder