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
export YourSSLDomain=mail.yourdomain.com | |
# Renew or generate cert | |
certbot renew | |
# Copy cert | |
cp /etc/letsencrypt/live/$YourSSLDomain/* /opt/zimbra/ssl/letsencrypt | |
chown zimbra:zimbra /opt/zimbra/ssl/letsencrypt/* | |
# if first time copy the key to the right place | |
cp /etc/letsencrypt/live/$YourSSLDomain/privkey.pem /opt/zimbra/ssl/zimbra/commercial/commercial.key | |
# fix permissions |
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
# Linode token | |
dns_linode_key = YOUR_ACCESS_TOKEN |
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 | |
CLOUDFRONT_DISTRIBUTION_ID=E2C3RNL2F4MRMQ | |
NEW_ORIGIN="origin2-zaid.s3.us-west-2.amazonaws.com" | |
ETAG=`aws cloudfront get-distribution --id $CLOUDFRONT_DISTRIBUTION_ID | jq -r .ETag` | |
aws cloudfront get-distribution --id $CLOUDFRONT_DISTRIBUTION_ID | \ | |
jq --arg NEW_ORIGIN "$NEW_ORIGIN" '.Distribution.DistributionConfig.Origins.Items[0].Id=$NEW_ORIGIN' | \ | |
jq --arg NEW_ORIGIN "$NEW_ORIGIN" '.Distribution.DistributionConfig.Origins.Items[0].DomainName=$NEW_ORIGIN' | \ | |
jq --arg NEW_ORIGIN "$NEW_ORIGIN" '.Distribution.DistributionConfig.DefaultCacheBehavior.TargetOriginId=$NEW_ORIGIN' | \ | |
jq .Distribution.DistributionConfig > config.json | |
aws cloudfront update-distribution --id $CLOUDFRONT_DISTRIBUTION_ID --distribution-config "file://config.json" --if-match $ETAG > /dev/null |
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
RewriteEngine On | |
RewriteRule ^$ http://127.0.0.1:3020/ [P,L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
#RewriteRule ^(.*)$ http://127.0.0.1:3020/$1 [P,L] | |
RewriteRule ^/?resources/(.*)$ http://127.0.0.1:3020/resources/$1 [L,P] |
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
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'the-password'; | |
SELECT user,authentication_string,plugin,host FROM mysql.user; | |
FLUSH PRIVILEGES; |
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
<!doctype html> | |
<html ng-app="app"> | |
<head> | |
</head> | |
<body> | |
<div ng-controller="LayoutViewController as $ctrl" class="container"> | |
<div class="row"> |
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
import multiprocessing.pool | |
import time | |
def theout(i): | |
print(i) | |
time.sleep(1) | |
pool = multiprocessing.pool.Pool(processes=10) | |
pool.map(theout, range(100)) |
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/sh | |
IPT="/sbin/iptables" | |
# Set default policies for all three default chains | |
$IPT -P INPUT ACCEPT | |
$IPT -P FORWARD ACCEPT | |
$IPT -P OUTPUT ACCEPT | |
# Flush old rules, old custom tables |
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
import os | |
if not os.path.exists('escaped'): | |
os.makedirs('escaped') | |
def escape(file): | |
with open(file, 'r') as f: | |
a_string = ''.join(f) | |
escaped = a_string.replace('"', '\\"') | |
escaped = escaped.replace('><', '>\\r\\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
from __future__ import print_function # Python 2/3 compatibility | |
import json | |
import boto3 | |
# AWS_ACCESS = "" | |
# AWS_SECRET = "" | |
AWS_REGION = "eu-west-3" | |
TABLE_NAME = "users" | |
client = boto3.client( |
NewerOlder