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
[default] | |
aws_access_key_id = AKIHONEYPOTHONEYPPKA | |
aws_secret_access_key = juBYW/RHTE1ki+DyDFG/uPIhtwO9hm9+8+ErzMo9 | |
honeypot = True |
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
yum update -y nginx | |
yum install -y pcre-devel | |
service nginx stop | |
mkdir ~/nginx_test | |
cd ~/nginx_test/ | |
wget 'http://nginx.org/download/nginx-1.13.6.tar.gz' | |
tar -xzvf nginx-1.13.6.tar.gz | |
wget https://github.com/openresty/headers-more-nginx-module/archive/v0.33.tar.gz | |
tar -xzvf v0.33.tar.gz | |
cd nginx-1.13.6/ |
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
# erlang deps | |
sudo yum groupinstall "Development Tools" | |
sudo yum install ncurses-devel openssl-devel | |
# erlang | |
wget http://erlang.org/download/otp_src_20.1.tar.gz | |
tar -zxvf otp_src_20.1.tar.gz | |
rm -f otp_src_20.1.tar.gz | |
cd otp_src_20.1/ | |
./configure |
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 | |
NEW_VERSION="2.7.14" | |
CURRENT_VERSION="$(python -V 2>&1)" | |
if [[ "$CURRENT_VERSION" == "Python $NEW_VERSION" ]]; then | |
echo "Python $NEW_VERSION already installed, aborting." | |
else | |
echo "Starting upgrade from ${CURRENT_VERSION} to ${NEW_VERSION}" |
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
var COUNTER = 900; | |
function deleteSome(count) { | |
var itemsToDel = db.tasks.find({status: "SUCCESS"}, {_id: 1}).sort({created_at: 1}).limit(count).toArray(); | |
var IDs = itemsToDel.map(function(item){ return item["_id"]}) | |
if (IDs.length > 0 ) { | |
db.tasks.remove({"_id": {"$in": IDs } }); | |
sleep(5000); | |
} else { | |
COUNTER++; |
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
var db = db.getSiblingDB("admin"); | |
var dbs = db.runCommand({ "listDatabases": 1 }).databases.sort(); | |
dbs.forEach(function(database) { | |
db = db.getSiblingDB(database.name); | |
cols = db.getCollectionNames().sort(); | |
cols.forEach(function(col) { | |
if (!db[col]) { return; } | |
db[col].getIndexes().sort().forEach(function(index) { | |
if ("_id_" !== index.name) { | |
print("at database: [" + database.name +"], db." + col + ".ensureIndex(" + tojson(index.key) + ")"); |
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
# Command: GLOG | |
# Description: alias that creates a nice and easy on eye history log with graph indication of merge commits and branches | |
git config --global alias.glog "\!git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative ; true" | |
# Run: | |
git glog | |
# Command: LASTWORKS | |
# Description: Lists the last 10 branches you worked on | |
git config --global alias.lastworks "for-each-ref --count=10 --sort=-committerdate refs/heads/" |
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/sh | |
ECHO='echo ' | |
for branch in $(git branch -a | sed 's/^\s*//' | sed 's/^remotes\///' | grep -v 'master$'); do | |
if [[ "$(git log $branch --since "6 months ago" | wc -l)" -eq 0 ]]; then | |
if [[ "$DRY_RUN" = "false" ]]; then | |
ECHO="" | |
fi | |
local_branch_name=$(echo "$branch" | sed 's/remotes\/origin\///') | |
$ECHO git branch -d "${local_branch_name}" |
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 | |
readonly ARGS="$@" | |
readonly DEPLOY_USER="www-data" | |
clone_repo_at_tag() { | |
local repo="$1" | |
local tag="$2" | |
local project_name="$3" | |
local repo_dirname="$project_name-$tag" |
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
require 'bundler' | |
require 'socket' | |
Bundler.require | |
WS_CLIENTS = {} | |
WS_CLIENTS_NAME_TO_SOCKET = {} | |
WS_HOST = Socket.ip_address_list.last.ip_unpack.first) | |
WS_PORT = 8090 | |
HTTP_PORT = WS_PORT + 1 |