Skip to content

Instantly share code, notes, and snippets.

View omega8cc's full-sized avatar

BOA Dev Team omega8cc

View GitHub Profile
@omega8cc
omega8cc / drupal-PSA-003-check.sh
Created April 25, 2018 16:13 — forked from jerbob92/drupal-PSA-003-check.sh
Check whether Drupal 7.59 and 8.5.3 are released
#!/bin/sh
url="https://ftp.drupal.org/files/projects/drupal-7.59.zip";
if curl --output /dev/null --silent --head --fail "$url"; then
echo "URL exists: $url";
else
echo "URL does not exist: $url";
fi;
url="https://ftp.drupal.org/files/projects/drupal-8.5.3.zip";
@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
@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]`

Install multiple PHP instances on Linux

Install prerequisites for building PHP

Install the packages needed to build packages

apt-get install build-essential

Install PHP build dependencies

require 'net/http'
require 'net/https'
require 'uri'
PINGDOM_API_HOSTNAME = "api.pingdom.com"
PINGDOM_API_KEY = "your_api_key_here"
PINGDOM_API_VERSION = "2.0"
PINGDOM_CHECK_ID = "######"
PINGDOM_USERNAME = "user@domain.com"
PINGDOM_PASSWORD = "password"
@omega8cc
omega8cc / nginx.conf
Last active August 29, 2015 14:13 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {
@omega8cc
omega8cc / hhvminfo.php
Last active August 29, 2015 14:12 — forked from ck-on/hhvminfo.php
<?php
/*
HHVMinfo - phpinfo page for HHVM HipHop Virtual Machine
Author: _ck_
License: WTFPL, free for any kind of use or modification, I am not responsible for anything, please share your improvements
Version: 0.0.6
* revision history
0.0.6 2014-08-02 display fix for empty vs zero
0.0.5 2014-07-31 try to determine config file from process command line (may not always work), style improvements
#!/bin/bash
# Backs up the database and filesystem for a webapp
# Dumps a current db snapshot and moves it to within the
# webapp's directory structure, so that Duplicity can
# back it up to Amazon's S3 service
# Based on instructions by Randy Sesser:
# http://www.randys.org/2007/11/16/how-to-automated-backups-to-amazon-s-s3-with-duplicity/
@omega8cc
omega8cc / ocp.php
Created December 24, 2013 03:45 — forked from n1xim/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok,n1xim)
Version: 0.1.7
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.7 2013-08-29 changed scaling of "hits" to base 10 (n1xim)
0.1.6 2013-04-12 moved meta to footer so graphs can be higher and reduce clutter