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
tar cvzf - dir/ | split -b 200m - sda1.backup.tar.gz |
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
# apache2.conf | |
ServerSignature Off | |
ServerTokens Prod | |
# ssl.conf | |
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4 | |
SSLProtocol -all +TLSv1.2 |
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
openssl x509 -enddate -noout -in certificato.pem |
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
import string | |
import itertools | |
combinations_generator = itertools.product(string.ascii_uppercase + string.digits, repeat=2) | |
combinations = list(map(''.join, combinations_generator)) | |
print(len(combinations)) |
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
DOW=$(date +%u) | |
(time aws s3 sync /var/www s3://BUCKET/$DOW/ \ | |
--no-follow-symlinks \ | |
--exclude 'DIR-ESCLUDED/*' \ | |
) 2> LastBackup.txt |
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
# remote | |
ssh-keygen -b 4096 -C "My RSA Key" | |
# local | |
ssh-copy-id -p [PORT] [user@][ip] | |
---- | |
# more secure | |
ssh-keygen -t ed25519 -C "My Ed25519 key" | |
#local | |
ssh-copy-id -i .ssh/id_ed25519.pub 192.168.1.100 | |
ssh 192.168.1.100 -i .ssh/id_ed25519 |
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
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-Forwarded-For}i\"" combined+x-forwarded-for |
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
RewriteCond %{HTTP_USER_AGENT} (serpstatbot|mj12bot|brightedge|Ahrefsbot|Testomatobot|PetalBot|YandexBot|SemrushBot-BA|trendictionbot|EvilBot|ScumSucker|FakeAgent) [NC] | |
RewriteRule (.*) - [F,L] |
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
import os | |
with open("listcache.txt", "w") as file1: | |
for currentpath, folders, files in os.walk('.'): | |
for file in files: | |
if file.split(".")[-1] in ['css']: | |
filename = os.path.join(currentpath, file).replace("./", "https://www.website.web/") | |
print(filename) | |
file1.write(f"{filename}\n") | |
if file.split(".")[-1] in ['js'] and file.startswith('main'): |
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 | |
/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m onPremise -s -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json --region eu-south-1 --profile AmazonCloudWatchAgent | |
sudo systemctl restart amazon-cloudwatch-agent.service | |
#/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a start -m onPremise -s -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json |
NewerOlder