This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:
main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
delete from t1, t2 | |
using wp_options t1 | |
join wp_options t2 on t2.option_name = replace(t1.option_name, '_expires', '') | |
where (t1.option_name like '\_wc\_session\_expires\_%') | |
and t1.option_value < UNIX_TIMESTAMP(NOW()) |
This script will pull down an S3 remote configuration before running any terraform actions. Assumes the following structure:
main.tf
terraform.cfg
env/dev/vars
env/staging/vars
env/whatever/vars
env/whatever/somefile.tf
I wrote these scripts to help faciliate batch import of our CloudFormation templates into Terraform Configuration.
This script is a light wrapper around batch.sh
. It simply iterates over the list of regions provided, exports expected variables, creates required directories, and calls batch.sh
.
BASE_DIR=/path/to/dir EXCLUDE_REGEX="(some-stack-production|some-stack-staging)" ./region-batch.sh us-east-1 us-west-1
Adapted from http://blog.herecura.eu/blog/2015/09/13/self-signed-multi-domain-certificate/
Create a file named cert.conf
:
[ local_san ]
nsCertType = server
keyUsage = digitalSignature,nonRepudiation,keyEncipherment
extendedKeyUsage = serverAuth
subjectKeyIdentifier = hash
<?php | |
// Props to goddva: http://stackoverflow.com/questions/1361169/possible-to-add-data-to-the-body-of-a-http-request-using-curl-in-php | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "http://site.dev/webhooks.php?type=stripe"); | |
curl_setopt($ch, CURLOPT_USERAGENT, "My user agent"); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_HEADER, 1); | |
curl_setopt($ch, CURLOPT_POST, 1); |
<?php | |
/** | |
* Get other templates (e.g. product attributes) passing attributes and including the file. | |
* | |
* @access public | |
* @param mixed $template_name | |
* @param array $args (default: array()) | |
* @param string $template_path (default: '') | |
* @param string $default_path (default: '') | |
* @return void */ |
Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
<?php | |
class WP_Admin_Notice { | |
public $class = ''; | |
public $message = ''; | |
function __construct( $message, $class = 'updated' ){ | |
$this->class = $class; | |
$this->message = $message; | |
add_action( 'admin_notices', array( $this, 'output' ) ); |
# /etc/init/personal-vnc.conf | |
# Use the service command: | |
# sudo service personal-vnc {start,stop,restart,status} | |
# | |
description "Manages VNC connection. Runs on boot" | |
start on runlevel [2345] | |
stop on runlevel [06] |
# $ cat template.json | PACKER_LOG=1 packer build -debug - | |
2016/03/12 13:23:31 [INFO] Packer version: 0.9.0 a643faae672ec8b8424352476d2b91b7a7f7b06e+CHANGES | |
2016/03/12 13:23:31 Packer Target OS/Arch: darwin amd64 | |
2016/03/12 13:23:31 Built with Go Version: go1.6 | |
2016/03/12 13:23:31 Detected home directory from env var: /Users/aang | |
2016/03/12 13:23:31 Using internal plugin for vmware-vmx | |
2016/03/12 13:23:31 Using internal plugin for docker | |
2016/03/12 13:23:31 Using internal plugin for parallels-pvm | |
2016/03/12 13:23:31 Using internal plugin for qemu |