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 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
LATEST_RELEASE=$(curl -sSL -H "Accept: application/json" https://github.com/adnanh/webhook/releases/latest) | |
LATEST_VERSION=$(echo $LATEST_RELEASE | jq -r .tag_name) | |
ARTIFACT_URL="https://github.com/adnanh/webhook/releases/download/$LATEST_VERSION/webhook-linux-amd64.tar.gz" | |
mkdir -p "${DIR}/bin" | |
[ -f "${DIR}/hooks.yml" ] || touch "${DIR}/hooks.yml" |
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
# Staging | |
# Use this command for testing purpose, because of Let's Encrypt API restrictions | |
docker run -it --rm \ | |
-v certs:/etc/letsencrypt \ | |
-v certs-data:/data/letsencrypt \ | |
certbot/certbot \ | |
certonly --webroot \ | |
--register-unsafely-without-email --agree-tos \ | |
--webroot-path=/data/letsencrypt \ | |
--staging \ |
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 | |
# Updating and installing stuff | |
apt-get update | |
apt-get install -y git curl | |
# Install docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
apt-key fingerprint 0EBFCD88 | |
add-apt-repository \ |
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 | |
set -e | |
NAME=$1 | |
if [ -z "$NAME" ]; then | |
echo "$0 NAME" | |
exit | |
fi |
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
#!/usr/bin/env bash | |
set -e | |
function info { | |
echo " " | |
echo "--> $1" | |
echo " " | |
} | |
if [[ $EUID -ne 0 ]]; then |
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
'response' => [ | |
'on afterSend' => function ($event) { | |
list($queryCount, $totalExecTime) = Yii::getLogger()->getDbProfiling(); | |
list($mongoQueryCount, $mongoTotalExecutionTime) = mongodb_profiling(); | |
$elapsedTime = Yii::getLogger()->getElapsedTime(); | |
$request = Yii::$app->getRequest(); | |
Yii::info(\yii\helpers\VarDumper::dumpAsString([ | |
'url' => "{$request->getMethod()} {$request->getAbsoluteUrl()}", |
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
location ^~ /api/ { | |
root /var/www/; | |
index index.php; | |
fastcgi_split_path_info ^/api(.+\.php)(.*)$; | |
fastcgi_pass 127.0.0.1:9000; | |
#fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; | |
try_files $uri /index.php =404; |
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 | |
COLOR_NC='\e[0m' # No Color | |
COLOR_LIGHT_RED='\e[1;31m' | |
COLOR_LIGHT_GREEN='\e[1;32m' | |
COLOR_LIGHT_YELLOW='\e[1;33m' | |
COLOR_LIGHT_BLUE='\e[1;34m' | |
usage() { | |
echo "$0 [options] url" |
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 | |
set -e | |
RSYNC_BIN=`command -v rsync` | |
GIT_BIN=`command -v git` | |
GULP_BIN=`command -v node_modules/gulp/bin/gulp.js` | |
SEMVER_BIN=`command -v node_modules/semver/bin/semver` | |
COLOR_NC='\e[0m' # No Color | |
COLOR_LIGHT_BLUE='\e[1;34m' |
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
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'net/ssh' | |
require 'net/scp' | |
HOST = '127.0.0.1' | |
@username = 'user' | |
@password = 'password' | |
MYSQL_DATABASE = 'db' |
NewerOlder