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
tail -f /tmp/log.log | egrep --line-buffered 'string' | ./slacktee.sh -n |
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
openssl req -new -newkey rsa:2048 -nodes -keyout some-domain.key -out some-domain.csr |
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 | |
# gsplit for OSX - brew install coreutils | |
# usage | |
# ./script_name aws-live prod-core-web | |
# will create files prod-core-web.00..x with 9 prod-core-web hosts in each. Then can feed to i2cssh or what ever cluster ssh tool you use | |
env=$1 | |
name_prefix=$2 |
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
## kv | |
# POST key | |
curl -X PUT -d @- localhost:8500/v1/kv/some/key/ <<< key_value | |
# GET key | |
curl -s localhost:8500/v1/kv/some/key | |
# GET raw value | |
curl -s localhost:8500/v1/kv/some/key?raw | |
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
"${compact(split(",", var.asg_elb_names))}" # returns 0 array if var.asg_elb_names is an empty string |
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
# size, method, url | |
cut -d ' ' -f 11,12,13 elb.log | sort -rn |
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
control + z | |
disown -h %1 | |
bg 1 |
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
some_string_with_newlines="..." | |
while read -r line ; do | |
echo " xxx $line" | |
done <<< "$some_string_with_newlines" |
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
brew install bash | |
sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells" | |
chsh -s /usr/local/bin/bash |
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
use mysql; | |
update user set password=PASSWORD('$new_password') where User='$user_name'; | |
flush privileges; | |
# to change current user grants | |
revoke all privileges on *.* from 'user'@'%'; | |
GRANT SELECT ON *.* TO 'user'@'%'; | |
flush privileges; |