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
| # usefull when parse output frow aws cli | |
| # from https://github.com/stedolan/jq/issues/370 | |
| jq '.Attributes[] | select (.Name == "public_ip") | .Value' | |
| # json to bash-style env | |
| jq -r 'to_entries | .[] | .key + "=\"" + .value + "\""' | grep -P '^AWS_(REGION|ACCESS_KEY|SECRET|SESSION)' | |
| # parse CloudTail logs (from http://flaws2.cloud/defender3.htm ) | |
| jq -cr '.Records[]|[.eventTime, .sourceIPAddress, .userIdentity.arn, .userIdentity.accountId, .userIdentity.type, .eventName]|@tsv' | sort |
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
| [root@bigben audit]# iptables --line-numbers -n -L -t nat | |
| Chain PREROUTING (policy ACCEPT) | |
| num target prot opt source destination | |
| 1 DOCKER all -- 0.0.0.0/0 0.0.0.0/0 ADDRTYPE match dst-type LOCAL | |
| Chain INPUT (policy ACCEPT) | |
| num target prot opt source destination | |
| Chain OUTPUT (policy ACCEPT) | |
| num target prot opt source destination |
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 i in {1..83} ; do echo $i ; pdftoppm file.pdf page-$i -png -f $i -singlefile ; 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
| nvm install 11.9.0 --reinstall-packages-from=11.8.0 | |
| nvm ls-remote | |
| du -sh ~/.nvm/versions/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
| #!/bin/bash -xe | |
| VGNAME=eph | |
| # now we need to check that we use ephemeral disk as /dev/xvdb | |
| # its very naive check but better then nothing because operations above can be dangerous | |
| if ! lsblk | grep '^xvdb' | grep 75G > /dev/null ; then | |
| echo "Problems with expectations for /dev/xvdb" | |
| exit 1 | |
| fi |
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
| hhvm.conf: | |
| check program check-hhvm with path "/etc/monit/bin/check-hhvm.sh" | |
| if status != 0 then alert | |
| if status != 0 | |
| then exec "/usr/sbin/service hhvm restart" | |
| /etc/monit/bin/check-hhvm.sh: | |
| #!/bin/bash |
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
| # rename files with complex names | |
| j=1 | |
| for f in *.jpg ; do | |
| echo "mv '$f' p${j}.jpg" | |
| j=$((j+1)) | |
| 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
| lvextend -L +90G /dev/exhdd/backup | |
| btrfs: btrfs filesystem resize max /mnt/backup/ |
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 Lambda + Node Modules, no Docker required : https://medium.com/@haydnjmorris/aws-lambda-node-modules-no-docker-required-76443a0f6c4e | |
| Automate Custom EC2 AMIs: (python, terraform, docker): https://medium.com/devopslinks/automate-custom-ec2-amis-155af71fae7d | |
| NEWS about JAVA + Docker: | |
| https://blog.softwaremill.com/docker-support-in-new-java-8-finally-fd595df0ca54?gi=53e209ef5a04 | |
| https://blog.docker.com/2018/04/improved-docker-container-integration-with-java-10/ |
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/bash | |
| rm -rf /var/run/nginx-cache/* | |
| rm -rf /home/shop_production/htdocs/var/cache/* | |
| rm -rf /cache/catalog-cache/* | |
| rm -rf /cache/shop-cache/* | |
| rm -rf /cache/nginx-cache/* | |
| # clean redis |