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 | |
$files = scandir('.'); | |
foreach ($files as $file) { | |
if (strpos($file, '\\') !== false) { | |
echo "Deleting {$file}<br>"; | |
unlink($file); | |
} | |
} |
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 | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
$domain = "smtp.gmail.com"; | |
$port = 587; | |
if ($socket = stream_socket_client("tcp://{$domain}:{$port}", $errno, $errstr, 10)) { | |
echo "stream_socket_client: Connection to {$domain}:{$port} successful!<br>"; |
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
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
server_name _; | |
root /home/app/html/public; | |
index index.php index.html index.htm; | |
# Load configuration files for the default server block. | |
include /etc/nginx/default.d/*.conf; |
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
{ | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": [ | |
"s3:ListBucket", | |
"s3:GetBucketLocation", | |
"s3:ListBucketMultipartUploads" | |
], | |
"Resource": "arn:aws:s3:::BUCKETNAME", |
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":"2008-10-17", | |
"Statement":[{ | |
"Sid":"AddPerm", | |
"Effect":"Allow", | |
"Principal": { | |
"AWS": "*" | |
}, | |
"Action":["s3:GetObject"], | |
"Resource":["arn:aws:s3:::example.com/*"] |
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 | |
set_time_limit(0); | |
$directory = new RecursiveDirectoryIterator('../'); | |
$counters = []; | |
foreach ($directory as $item) { | |
if (!is_dir($item)) { |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
$master_bootstrap = <<SCRIPT | |
apt-get update | |
apt-get install -y apt-transport-https | |
wget -O - http://repo.saltstack.com/apt/debian/9/amd64/2017.7/SALTSTACK-GPG-KEY.pub | apt-key add - |
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
# Create the LXC container. | |
lxc-create -n saltmaster -t debian -- -r stretch | |
lxc-start -n saltmaster | |
# Install SaltStack on it. | |
lxc-attach -n saltmaster -- sh -c "apt-get update && apt-get install curl -y && curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com && sh bootstrap-salt.sh -M -N" |
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
# Add the following line to /var/lib/lxc/saltmaster/config | |
lxc.mount.entry=/path/to/your/projects/saltstack srv none bind 0 0 |
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
lxc-attach -n $MY_MINION -- sh -c "apt-get update && apt-get install curl -y && curl -L https://bootstrap.saltstack.com | sh && sed -i -e 's/#master: salt/master: saltmaster/g' /etc/salt/minion && systemctl restart salt-minion" |
NewerOlder