This file contains hidden or 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 | |
require_once 'Console/Table.php'; | |
$groupsDoc = new DOMDocument(); | |
$groupsDoc->load("groups.xml"); | |
$groupsDoc->formatOutput = TRUE; | |
file_put_contents("readable-groups.xml",$groupsDoc->saveXML()); | |
$xpath = new DOMXpath($groupsDoc); | |
/******************************************************************************* | |
This file contains hidden or 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 | |
/* | |
* Google oAuth 2.0 PHP Curl boilerplate | |
* Google Tasks API example | |
* | |
* | |
* Settings | |
* | |
* scope Space-delimited set of permissions that the application requests. | |
* state Provides any state that might be useful to your application upon receipt of the response. |
This file contains hidden or 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
<html> | |
<header> | |
<title> | |
Display Name | |
</title> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<style> | |
* { | |
margin:0;padding:0; |
This file contains hidden or 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 | |
/** | |
ABSTRACT | |
Sets precedence to Apache mime types repo at http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types | |
Caches the Apache repo locally (in php temp folder) to avoid unnecessary http calls. | |
Fallback to native PHP mime_content_type function if no extension match. |
This file contains hidden or 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 | |
/* | |
ABSTRACT | |
s3SimpleUpload.php is a standalone (no AWS SDK), intentionally verbose, upload only S3 class utilizing the AWS API, Signature Version 4. | |
Options include defining the s3_prefix path, regardless of the origination path, or using the source file's origination prefix path (default). | |
USAGE |
This file contains hidden or 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 | |
class S3 { | |
private $key = 'ABC123'; | |
private $secret = 'lolftw'; | |
private $region = 'us-west-2'; | |
private $bucket = 'examplebucket'; | |
private $host = 's3.amazonaws.com'; |
This file contains hidden or 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
# Dont forget to set the env variable "certdomain", and either fill in your email below or use an env variable for that too. | |
# Also note that this config is using the LetsEncrypt staging server, remove the flag when ready! | |
Resources: | |
sslSecurityGroupIngress: | |
Type: AWS::EC2::SecurityGroupIngress | |
Properties: | |
GroupId: {"Fn::GetAtt" : ["AWSEBSecurityGroup", "GroupId"]} | |
IpProtocol: tcp | |
ToPort: 443 |
This file contains hidden or 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
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
This file contains hidden or 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 | |
$cmd = <<<CMD | |
echo "hello \ | |
world" | |
CMD; | |
$output = shell_exec($cmd); | |
echo $output; // "hello world" |
This file contains hidden or 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
# Pick the topic name or number from the list below | |
#sudo amazon-linux-extras list | |
# 0 ansible2 disabled [ =2.4.2 ] | |
# 1 emacs disabled [ =25.3 ] | |
# 2 memcached1.5 disabled [ =1.5.1 ] | |
# 3 nginx1.12 disabled [ =1.12.2 ] | |
# 4 postgresql9.6 disabled [ =9.6.6 ] | |
# 5 python3 disabled [ =3.6.2 ] | |
# 6 redis4.0 disabled [ =4.0.5 ] |
NewerOlder