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
<?php | |
function xml2array($contents, $get_attributes=1, $priority = 'tag') { | |
if(!$contents) return array(); | |
if(!function_exists('xml_parser_create')) { | |
//print "'xml_parser_create()' function not found!"; | |
return array(); | |
} |
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
<?php | |
/** | |
USAGE | |
php file.php CONTAINERNAME | |
NOTE | |
By Default Softlayer has a limit of 100 file return. To change it |
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
<?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 |
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
$array = json_decode(json_encode((array) simplexml_load_string($xml_string)),1); |
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", | |
"Statement": [ | |
{ | |
"Action": [ | |
"elasticache:*", | |
"ec2:DescribeAvailabilityZones", | |
"ec2:DescribeVpcs", | |
"ec2:DescribeAccountAttributes", | |
"ec2:DescribeSecurityGroups", |
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
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 |
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
#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; | |
} |
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
$ cat provider.tf | |
provider "aws" { | |
region = "us-west-2" | |
} | |
$ cat dns.tf | |
resource "aws_route53_zone" "main" { | |
name = "dc34vo.com" | |
tags = { |
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
# 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: |
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
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; | |
} |
OlderNewer