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": "2012-10-17", | |
"Id": "S3PolicyId1", | |
"Statement": [ | |
{ | |
"Sid": "IPAllow", | |
"Effect": "Allow", | |
"Principal": "*", | |
"Action": "s3:GetObject", | |
"Resource": "arn:aws:s3:::example.bucket/*", |
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
# | |
# Varnish AWS S3 Gateway VCL | |
# | |
# Allows global read (GET, HEAD) and ACL protected writes (POST, PUT, DELETE). | |
# When writing, pass in Content-Type and Content-MD5, both are optional. | |
# | |
# Params: | |
# | |
# %BUCKET% - S3 bucket name, S3 host may be regional | |
# %ACCESS_ID% - IAM access ID for bucket |
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
host-intel:~# stress-ng --cpu 4 --vm 2 --hdd 1 --fork 8 --switch 4 --timeout 5m --metrics-brief | |
stress-ng: info: [17795] dispatching hogs: 4 cpu, 2 vm, 1 hdd, 8 fork, 4 switch | |
stress-ng: info: [17800] stress-ng-switch: 1114.57 nanoseconds per context switch (based on parent run time) | |
stress-ng: info: [17807] stress-ng-switch: 890.93 nanoseconds per context switch (based on parent run time) | |
stress-ng: info: [17813] stress-ng-switch: 946.57 nanoseconds per context switch (based on parent run time) | |
stress-ng: info: [17820] stress-ng-switch: 949.06 nanoseconds per context switch (based on parent run time) | |
stress-ng: info: [17795] successful run completed in 300.74s (5 mins, 0.74 secs) | |
stress-ng: info: [17795] stressor bogo ops real time usr time sys time bogo ops/s bogo ops/s | |
stress-ng: info: [17795] (secs) (secs) (secs) (real time) (usr+sys time) | |
stress-ng: info: [17795] cpu 281111 300.01 1194.81 0.03 937.00 235.27 |
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 | |
pct stop <id> | |
vzdump <id> -storage <storage> -compress lzo | |
pct destroy <id> | |
pct restore <id> /path/to/storeage/vzdump-lxc-<id>....tar.lzo --rootfs local:<newsize> |
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
# Optimized my.cnf configuration for MySQL/MariaSQL | |
# | |
# by Fotis Evangelou, developer of Engintron (engintron.com) | |
# | |
# === Updated December 2018 === | |
# | |
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores. | |
# If you have less or more resources available you should adjust accordingly to save CPU, | |
# RAM and disk I/O usage. | |
# The settings marked with a specific comment or the word "UPD" after the value |
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
# | |
# https://blog.knoldus.com/easiest-way-to-setup-ssl-on-nginx-using-pfx-files/ | |
# | |
We’ll start by extracting the CRT file using openssl with the following command | |
openssl pkcs12 -in ./YOUR-PFX-FILE.pfx -clcerts -nokeys -out domain.crt | |
Followed by extracting the private key with the following command |
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 | |
LATESTNGINX="1.11.10" | |
BUILDROOT="/tmp/boring-nginx" | |
# Pre-req | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
# Install deps |
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
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/ | |
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]` | |
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file. | |
Now let’s extract the certificate: | |
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]` |
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
check process hhvm with pidfile /var/run/hhvm/pid | |
group hhvm | |
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds | |
stop program = "/usr/sbin/service hhvm stop" | |
if failed unixsocket /var/run/hhvm/hhvm.sock then restart | |
if mem > 400.0 MB for 1 cycles then restart | |
if 5 restarts with 5 cycles then timeout |
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
# make sure you have these installed | |
yum install -y make gcc perl pcre-devel zlib-devel |
NewerOlder