This file contains 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/bash | |
# in this script I assume you got elasticdump installed. https://github.com/taskrabbit/elasticsearch-dump | |
# if not, either run | |
# npm i -g elasticdump | |
# or use npx. | |
export SOURCE_HOST=http://localhost:9200 | |
export DEST_HOST=http://localhost:9201 |
This file contains 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: "3.7" | |
services: | |
elastic: | |
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0 | |
environment: | |
- discovery.type=single-node | |
kibana: | |
image: docker.elastic.co/kibana/kibana:7.4.0 | |
ports: | |
- 5601:5601 |
This file contains 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
<p>SAD EMOJI ANIMATION</p> | |
<div class='container'> | |
<div class='tear'></div> | |
<div class='tear2'></div> | |
<div class='face'> | |
<div class='eyebrow'>︶</div> | |
<div class='eyebrow'>︶</div> | |
<div class='eye'></div> | |
<div class='eye'></div> |
This file contains 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
<div class="head"> | |
<div class="face face__happy"> | |
<div class="eye-left"></div> | |
<div class="eye-right"></div> | |
<div class="mouth"></div> | |
</div> | |
</div> | |
<div class="head"> | |
<div class="face face__standard"> | |
<div class="eye-left"></div> |
This file contains 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 s3 ls s3://<bucket_name> --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}' |
This file contains 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/bash | |
#enter input encoding here | |
FROM_ENCODING="WINDOWS-1255" | |
#output encoding(UTF-8) | |
TO_ENCODING="UTF-8" | |
#convert | |
CONVERT=" iconv -f $FROM_ENCODING -t $TO_ENCODING" | |
#loop to convert multiple files | |
for file in $(find $1 -type f -name "*.php"); do | |
$CONVERT "$file" > "${file}.encoded" && mv "${file}.encoded" $file |
This file contains 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
# listen on port 25 and notify on slack if the program tries to send mail through | |
msg2slack() { | |
read MESSAGE | |
echo "PID: $$" | |
echo "$MESSAGE" | |
msg="connection attempt to port 25 on $(cat /etc/hostname):\n$MESSAGE" | |
$DETECTMAIL_SLACK_URL && curl -X POST -H 'Content-type: application/json' --data "{\"text\":\"$msg\"}" $DETECTMAIL_SLACK_URL | |
} |
This file contains 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
curl -s http://checkip.dyndns.org/ | cut -d ' ' -f 6 | sed s/"body\|html\|<\|>\|\/"//g |
This file contains 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
git branch -r > branch.txt | |
# delete master branch and "/origin" from branch.txt, and then: | |
for i in $(cat branch.txt); do sleep 1 && git push origin --delete $i & done |
This file contains 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/bash | |
KEY=dr.newadmin | |
VALUE=a88dd1213cf1811e9803406c5e12f321-536496363.eu-west-1.elb.amazonaws.com | |
HOSTED_ZONE_ID=Z2JG04O2LDY5NZ | |
# Creates route 53 records based on KEY name | |
aws route53 change-resource-record-sets --hosted-zone-id $HOSTED_ZONE_ID --change-batch '{ "Comment": "Testing creating a record set", "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "'"$KEY"'.hosted.zone.com", "Type": "CNAME", "TTL": 120, "ResourceRecords": [ { "Value": "'"$VALUE"'" } ] } } ] }' |
OlderNewer