Skip to content

Instantly share code, notes, and snippets.

Individual Contributor Agreement V1.0

Thank you for your interest in contributing to the VA Operations Platform.

In order to clarify the intellectual property license granted with Contributions from any person or entity, we must have digital or physical evidence that each Contributor has agreed to the license terms below.

This license is for your protection as a Contributor as well as the protection of the Managing Organization and its users. It does not change your rights to use your own Contributions for any other purpose.

You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Managing Organization, UNLESS, you explicitly state otherwise when making future contributions. You acknowledge, however, that we will be unable to accept Your Contributions if they are not provided under this agreement.

function fixJSON( $j ){
$j = trim( $j );
$j = ltrim( $j, '(' );
$j = rtrim( $j, ')' );
$a = preg_split('#(?<!\\\\)\"#', $j );
for( $i=0; $i < count( $a ); $i+=2 ){
$s = $a[$i];
$s = preg_replace('#([^\s\[\]\{\}\:\,]+):#', '"\1":', $s );
$a[$i] = $s;
}
# apply from https://gist.github.com/lorenzoaiello/bcb5e57d3f1da2bdc43c2c808565f6e9
$ docker run -it -v $(pwd):/workspace -v $HOME/.aws:/home/.aws -e "HOME=/home" -w /workspace hashicorp/terraform:light apply
aws_route53_zone.main: Refreshing state... [id=Z1XB1I9YEXBEWV]
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
~ update in-place
Terraform will perform the following actions:
$ cat provider.tf
provider "aws" {
region = "us-west-2"
}
$ cat dns.tf
resource "aws_route53_zone" "main" {
name = "dc34vo.com"
tags = {
@lorenzoaiello
lorenzoaiello / plex.conf
Created December 9, 2018 23:54
Plex NGINX Sample Configuration
#Must be set in the global scope see: https://forum.nginx.org/read.php?2,152294,152294
#Why this is important especially with Plex as it makes a lot of requests http://vincent.bernat.im/en/blog/2011-ssl-session-reuse-rfc5077.html / https://www.peterbe.com/plog/ssl_session_cache-ab
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
#Upstream to Plex
upstream plex_backend {
server 127.0.0.1:32400;
keepalive 32;
}
@lorenzoaiello
lorenzoaiello / Dockerfile
Created October 14, 2016 13:19
LAMP Stack (PHP 5.6) with Xdebug for PHPStorm
FROM php:5.6-apache
RUN a2enmod rewrite vhost_alias
# install the PHP extensions we need
RUN apt-get update
RUN apt-get install -y libpng12-dev libjpeg-dev libpq-dev imagemagick libxml2-dev libldap2-dev unzip libicu-dev libmcrypt-dev libfreetype6-dev
RUN rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr --enable-gd-native-ttf
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"elasticache:*",
"ec2:DescribeAvailabilityZones",
"ec2:DescribeVpcs",
"ec2:DescribeAccountAttributes",
"ec2:DescribeSecurityGroups",
$array = json_decode(json_encode((array) simplexml_load_string($xml_string)),1);
<?php
/**
USAGE
php file.php containers list
php file.php containers create CONTAINERNAME
php file.php containers delete CONTAINERNAME
php file.php cdn enable CONTAINERNAME
<?php
/**
USAGE
php file.php CONTAINERNAME
NOTE
By Default Softlayer has a limit of 100 file return. To change it