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
[ | |
{ | |
"il": "Adana", | |
"plaka": 1, | |
"ilceleri": [ | |
"Aladağ", | |
"Ceyhan", | |
"Çukurova", | |
"Feke", | |
"İmamoğlu", |
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 golang:1.7.3 | |
RUN mkdir -p /go/src/github.com/alexellis2/jaas | |
WORKDIR /go/src/github.com/alexellis2/jaas | |
COPY ./app.go ./ | |
RUN go get -v -d | |
RUN go build |
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
# https://www.scalescale.com/tips/nginx/nginx-proxy-cache-explained-2/ | |
proxy_cache_path /var/lib/nginx/cache levels=1:2 keys_zone=my_diskcached:10m max_size=5g inactive=45m use_temp_path=off; | |
server { | |
listen 80; | |
set $cache_uri $uri; | |
server_name example.com; | |
location ~ /purge(/.*) { | |
proxy_cache_purge my_diskcached acme.mycachedefault$uri$is_args$args; |
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
To restore a filesystem-backed Vault instance: | |
1. Shut down running Vault process (pkill vault) | |
2. Make backup to new location (cp -r /original-storage /new-storage) | |
3. Write a new config file to point to /new-storage | |
4. Start new Vault process (vault server -config=new-config-file.hcl) | |
5. DO NOT run `vault init` | |
6. ONLY RUN `vault unseal <key1>`, etc... |
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
#!/bin/bash | |
export vault=/usr/local/bin/vault | |
export VAULT_TOKEN=$(cat /root/.vault-token) | |
vault_cacert='-ca-cert=/path/to/your/ca.pem' | |
local_vault="-address=https://$(hostname -f):8200" | |
unsealed_vault="-address=https://$(getent hosts $(dig +short vault.service.consul | tail -n 1) | awk '{ print $2 }'):8200" | |
leader_vault="-address=https://$($vault status $vault_cacert $unsealed_vault 2> /dev/null | grep Leader | awk '{ print $2 }' | sed 's/^http\(\|s\):\/\///g'):8200" | |
vault_read="$vault read $vault_cacert $leader_vault" | |
vault_unseal="$vault unseal $vault_cacert $local_vault" |
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
echo "Flipping tables! (╯°□°)╯︵ ┻━┻" | |
num_rules=3 | |
real=3 # exposed to the ELB as port 443 | |
test=4 # used to install test certs for domain verification | |
health=5 # used by the ELB healthcheck | |
blue_prefix=855 | |
green_prefix=866 |
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
# install missing libraries (if any) | |
cd ~ | |
sudo yum update | |
yum install java-1.7.0-openjdk.x86_64 | |
yum install unzip | |
yum install mc | |
yum install wget | |
yum install curl | |
# get and unpack elasticsearch zip 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
# install missing libraries (if any) | |
cd ~ | |
sudo yum update | |
yum install java-1.7.0-openjdk.x86_64 | |
yum install unzip | |
yum install mc | |
yum install wget | |
yum install curl | |
# get and unpack elasticsearch zip 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 | |
/** | |
* Application driver class to initialize Phalcon and | |
* other resources. | |
*/ | |
class Application extends \Phalcon\Mvc\Application | |
{ | |
private static $mode = 'development'; // TODO change default to production | |
private static $modules = array( | |
'portal' => 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 | |
// Crude check. Off course this should be stored in a (memory) database. $token is an | |
// access token that is provided by oauth. | |
$token = $_SERVER['HTTP_X_AUTH_TOKEN']; | |
if ($token == "mellon") { | |
header("X-Api-User: Gandalf"); | |
header("X-Api-Context: Middle-Earth"); | |
header("Cache-Control: public, max-age=120"); |
NewerOlder