Skip to content

Instantly share code, notes, and snippets.

View askdevops's full-sized avatar

Alexander Chechelnitskiy askdevops

  • CleanChoice Energy
  • New York City
View GitHub Profile
@askdevops
askdevops / InstallHaProxy.sh
Created May 14, 2018 16:54 — forked from jrouleau/InstallHaProxy.sh
Amazon Linux AMI Install HAProxy From Source (1.7.0 release pre configured). chmod +x InstallHaProxy.sh then ./InstallHaProxy.sh
#!/bin/bash
### VARIABLES ###
PRE_PACK="openssl-devel pcre-devel make gcc"
VER="1.7.0"
# Setup Colours
black='\E[30;40m'
red='\E[31;40m'
green='\E[32;40m'
@askdevops
askdevops / sendToSlack.js
Created January 11, 2018 14:36 — forked from scripting/sendToSlack.js
A tiny JavaScript app that sends a message to your default Slack channel. Can be customized with a name, icon, emoji or sent to a different channel. Runs in Node.js.
var request = require ("request");
var urlWebHook = "https://hooks.slack.com/services/abcdef"; //the URL you get on your "incoming web hooks" page.
function sendToSlack (s, theUsername, theIconUrl, theIconEmoji, theChannel) {
var payload = {
text: s
};
if (theUsername !== undefined) {
payload.username = theUsername;
@askdevops
askdevops / downgrade_Mongodb_replica_to_standalone.txt
Created October 30, 2017 14:56 — forked from marcoberri/downgrade_Mongodb_replica_to_standalone.txt
Migrate MongoDB ReplicaSet to single MongoDB Node
mongoserver:PRIMARY> rs.status();
{
"set" : "mongoserver",
"date" : ISODate("2016-02-02T10:47:07.510Z"),
"myState" : 1,
"members" : [
{
"_id" : 3,
"name" : "192.168.1.10:37017",
"health" : 1,
@askdevops
askdevops / deploy.sh
Created September 20, 2017 16:40 — forked from lxhunter/deploy.sh
Ansible deployment with Travis-CI
#!/bin/bash
[ -z "$GITHUB_SSH_URL" ] && echo "You need to set GITHUB_SSH_URL - e.g. [email protected]:user/repository.git" && exit 1;
[ -z "$ANSIBLE_PLAYBOOK" ] && echo "You need to set ANSIBLE_PLAYBOOK - e.g. ANSIBLE_PLAYBOOK=deploy.yml" && exit 1;
[ -z "$ANSIBLE_HOSTS" ] && echo "You need to set ANSIBLE_HOSTS - e.g. ANSIBLE_HOSTS=host.ini" && exit 1;
[ -z "$ANSIBLE_ROLES_FOLDER" ] && echo "You need to set ANSIBLE_ROLES_FOLDER - e.g. ANSIBLE_ROLES_FOLDER=/var/tmp/user-repository/roles" && exit 1;
[ -z "$ANSIBLE_REQUIREMENTS_FILE" ] && echo "You need to set ANSIBLE_REQUIREMENTS_FILE - e.g. ANSIBLE_REQUIREMENTS_FILE=/var/tmp/user-repository/requirements.yml" && exit 1;
[ -z "$ANSIBLE_SSH_USER" ] && echo "You need to set ANSIBLE_SSH_USER - e.g. ANSIBLE_SSH_USER=user" && exit 1;
[ -z "$GIT_REPOSITORY" ] && echo "You need to set GIT_REPOSITORY - e.g. GIT_REPOSITORY=/var/tmp/user-repository" && exit 1;
[ -z "$GITHUB_BRANCH" ] && echo "You need to set GITHUB_BRANCH - e.g. GITHUB_BRANCH=master" && exit