Skip to content

Instantly share code, notes, and snippets.

View omega8cc's full-sized avatar

BOA Dev Team omega8cc

View GitHub Profile
#######################################################
### nginx compact basic configuration start
#######################################################
###
### deny crawlers and bots without 403 response
###
if ($http_user_agent ~* (HTTrack|HTMLParser|libwww|wget|AutomaticSiteMap|bot) ) {
return 444;
}
check_update_le_ssl() {
if [[ "${Dom}" =~ ^(a|b|c|d|e) ]]; then
runDay="1"
elif [[ "${Dom}" =~ ^(f|g|h|i) ]]; then
runDay="2"
elif [[ "${Dom}" =~ ^(j|k|l|m) ]]; then
runDay="3"
elif [[ "${Dom}" =~ ^(n|o|p|q) ]]; then
runDay="4"
elif [[ "${Dom}" =~ ^(r|s|t|u) ]]; then
@omega8cc
omega8cc / README.md
Created August 17, 2016 12:45 — forked from skwashd/README.md
Drupal git pre-commit hook

This pre-commit hook is designed to be used for Drupal 7 and 8 sites.

Download the pre-commit file. Save it as .git/hook/pre-commit in your git repo. You need to ensure that the file is executable.

If you want this to be added to all new projects automatically, add it to your git init templates.

To install and PHP CodeSniffer for Drupal, please read the official documentation.

To see this working checking out this short YouTube video.

@omega8cc
omega8cc / nginx.conf
Created July 22, 2016 21:07 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
su -s /bin/bash - o1
drush @hm sqlq "UPDATE hosting_ssl_site SET ssl_enabled='0' WHERE nid='10'"
drush @hm provision-verify
@omega8cc
omega8cc / DigitalOcean.log
Last active May 24, 2016 19:53
@linode 4G/4C/$40 is 30% or 17 min faster than @digitalocean 8G/4C/$80 in parallel #BOA build test: 39 min vs 56 min
< 56 min
root@debian-8gb-fra1-01:~# boa in-head public server.ocean.o8.io omega8cc@gmail.com o1 mini php-5.6
BOA [14:46:10] ==> Skynet Agent v.BOA-3.1.0-dev welcomes you aboard!
BOA [14:46:13] ==> INFO: NORMAL INIT
BOA [14:46:13] ==> INFO: Public Setup Mode Active
BOA [14:46:13] ==> INFO: Creating your /root/.barracuda.cnf config file
root@debian-2gb-nyc2-01:~# boa in-stable public server.ocean.o8.io omega8cc@gmail.com o1 mini php-5.6
BOA [19:14:09] ==> Skynet Agent v.BOA-3.0.2 welcomes you aboard!
BOA [19:14:12] ==> INFO: NORMAL INIT
BOA [19:14:13] ==> INFO: Public Setup Mode Active
BOA [19:14:13] ==> INFO: Creating your /root/.barracuda.cnf config file
BOA [19:14:18] ==> Aegir on debian-2gb-nyc2-01 Debian/jessie x86_64 PHP 5.6
quad:~# boa in-octopus omega8cc@gmail.com ot13 mini stable M 1
BOA [22:56:58] ==> Skynet Agent v.BOA-3.0.2 welcomes you aboard!
BOA [22:57:01] ==> INFO: Creating your /root/.ot13.octopus.cnf config file
BOA [22:57:02] ==> New Octopus Setup on quad.tt.o8.io in progress...
* Your e-mail address is noc@omega8.cc
* Your client e-mail address is omega8cc@gmail.com
* Your Aegir control panel for this instance will be available at:
m3:/data/disk/o8/aegir/distro/001/sites/o8.m3.s9.ams.boa.io# drush8 status
Drupal version : 7.43
Site URI : http://o8.m3.s9.ams.boa.io
Database driver : mysql
Database hostname : localhost
Database port : 3306
Database username : o8m3s9amsboaio
Database name : o8m3s9amsboaio
PHP executable : /usr/bin/php-cli
PHP configuration : /opt/php56/lib/php.ini
@omega8cc
omega8cc / Howto convert a PFX to a seperate .key & .crt file
Created April 19, 2016 12:16 — forked from TemporaryJam/Howto convert a PFX to a seperate .key & .crt file
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
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]`