Skip to content

Instantly share code, notes, and snippets.

View ervinb's full-sized avatar

Ervin Barta ervinb

View GitHub Profile
DEB="thrift_0.9.3-1_amd64.deb"
URL="https://s3-us-west-2.amazonaws.com/container-libraries/$DEB"
if ! [ -e $SEMAPHORE_CACHE_DIR/$DEB ]; then (cd $SEMAPHORE_CACHE_DIR; wget $URL); fi
sudo dpkg -i $SEMAPHORE_CACHE_DIR/$DEB
echo "$(thrift --version) installed"
#! /usr/bin/env expect -f
set otc_pattern "(\d){6}"
set name [lindex $argv 0]
set server [lindex $argv 1]
set secret $env(MFA_SECRET)
spawn oathtool --totp -b "$secret"
expect otc_pattern
set otc $expect_out(buffer)
#!/bin/sh
export DEBIAN_FRONTEND=noninteractive
sudo rm -rf /etc/apt/sources.list.d/mysql.list
sudo add-apt-repository -y ppa:ondrej/mysql-5.5
sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/remove-data-dir boolean true"
sudo apt-get remove --purge -y mysql-client mysql-common mysql-community-client mysql-community-server mysql-server php5-mysql libmysqlclient-dev libmysqlclient18
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo -E bash -c 'apt-get -y --force-yes install mysql-server libmysqlclient-dev'
mysqladmin -u root password semaphoredb
#!/usr/bin/env bash
sudo bash -c 'echo -e "net.ipv6.conf.all.disable_ipv6 = 1\nnet.ipv6.conf.default.disable_ipv6 = 1\nnet.ipv6.conf.lo.disable_ipv6 = 1" >> /etc/sysctl.conf'
sudo sysctl -p &>/dev/null
disabled=$(cat /proc/sys/net/ipv6/conf/all/disable_ipv6)
[ $disabled == 1 ] && echo "IPv6 disabled" || echo "IPv6 is enabled"
#!/bin/bash
## This script is very hacky way to use VPN only for specific domains.
# For example: if you have a VPN subscription and want to access Pandora outside of the USA (may or may not be legal),
# you'd run it like "veer ovpn.conf www.pandora.com"
#
## How it works:
# Fetches the domain's IPs and routes their connections through a VPN gateway.
#
## Requirements:
##
# Exception:
# ThriftClient::NoServersAvailable:
# No live servers in [127.0.0.1:9160]
##
# install Cassandra Cluster Manager
$ sudo pip install ccm
# install Ruby driver
#!/usr/bin/env bash
chrome_aliases=('/usr/bin/google-chrome' '/usr/bin/google-chrome-stable')
wrapper_name="chrome-wrapper"
wrapper_install_path="/opt/$wrapper_name"
cat <<WRP > $wrapper_install_path
#!/bin/bash
_kill_proc() {
@ervinb
ervinb / devops_best_practices.md
Created November 18, 2017 18:27 — forked from jpswade/devops_best_practices.md
Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, Andrew Shafer did a talk called "Agile Infrastucture" addressing issues around involving more of the company in the same disciplines as programmers.

In 2009, Patrick Debois created "DevOpsDays" conference to help to bring it to light. However, it wouldn't begin to trend until about 2010, when people would begin to describe it as a standalone discipline.

Today, DevOps goes beyond just developers, systems administration and infrastructure, its about [dev, ops, agile, cloud, open source and business](https://blogs.the451group.com/opensource/2010/03/03/devops-mixing-dev-ops-agile-cloud-open-source-and-busi

#!/bin/bash
set -euo pipefail
changed_files=""
changed_directories=""
if [ "$BRANCH_NAME" = "master" ]; then
echo "On master. Nothing to do."
#----------------------------------------------
## add this snippet to ./config/application.rb
#----------------------------------------------
if ENV["SEMAPHORE_CACHE_DIR"]
config.assets.configure do |env|
env.cache = ActiveSupport::Cache::FileStore.new("#{ENV["SEMAPHORE_CACHE_DIR"]}/assets-cache")
end
end
#---------------------------------------