Skip to content

Instantly share code, notes, and snippets.

View ervinb's full-sized avatar

Ervin Barta ervinb

View GitHub Profile
@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 -e
registry_version="2"
local_registry_port="5000"
local_registry_name="localhost"
local_registry_url="${local_registry_name}:${local_registry_port}"
docker_image_name="$SEMAPHORE_REPO_SLUG"
base_image_name="${local_registry_url}/${docker_image_name}"
#!/bin/bash
regions=(local ca-central-1 eu-central-1 ap-southeast-1 ap-northeast-1 us-east-1)
image_name_base="cache-bench"
image_sizes_in_mb=(64 512 1024)
dockerfile="Dockerfile.sample"
log_file=docker-bench.log
##
# Exception:
# ThriftClient::NoServersAvailable:
# No live servers in [127.0.0.1:9160]
##
# install Cassandra Cluster Manager
$ sudo pip install ccm
# install Ruby driver
#!/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:
#----------------------------------------------
## 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
#---------------------------------------
#!/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"
#!/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() {
#! /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)