Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -e
VERSION_INGRESS=0.13.0
[[ -d ~/Sites/ingress-nginx ]] || git clone git@github.com:kubernetes/ingress-nginx.git ~/Sites/ingress-nginx
cd ~/Sites/ingress-nginx
sh test/e2e/wait-for-nginx.sh || echo "ERROR: This will attempt to deploy a newer version, which does not work..."
kubectl set image \
deployments \
--namespace ingress-nginx \
--selector app=ingress-nginx \
@jpswade
jpswade / hosts.sh
Created April 13, 2018 21:39
Update hosts file provided
#!/usr/bin/env bash
set -e
APP_HOSTS="www1.example.com www2.example.com"
KUBE_IP=127.0.0.1
[[ -f /tmp/hosts.new ]] && rm -f /tmp/hosts.new
for APP_HOST in ${APP_HOSTS}; do
grep "$APP_HOST" /etc/hosts | while read FOUND; do
if [[ ${FOUND} == "$KUBE_IP $APP_HOST" ]]; then
echo "=== $FOUND"
else
@jpswade
jpswade / devops_best_practices.md
Last active May 23, 2024 11:12
Devops Best Practices Checklist

Find the original here article here: Devops Best Practices

DevOps started out as "Agile Systems Administration". In 2008, at the Agile Conference in Toronto, Andrew Shafer posted an offer to moderate an ad hoc "Birds of a Feather" meeting to discuss the topic of "Agile Infrastructure". Only one person showed up to discuss the topic: Patrick Debois. Their discussions and sharing of ideas with others advanced the concept of "agile systems administration". Debois and Shafer formed an Agile Systems Administrator group on Google, with limited success. Patrick Debois did a presentation called "Infrastructure and Operations" addressing

@jpswade
jpswade / ua.html
Created October 19, 2017 16:21
UserAgent detection
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Your UserAgent is...</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<script type="text/javascript">
var userAgent = navigator.userAgent.toLowerCase();
var browserid = userAgent.match(/(firefox|chrome|safari|opera|msie)/)[1];
var browserversion = (userAgent.match(new RegExp('.+(?:version)[\/: ]([\\d.]+)')) || userAgent.match(new RegExp('.+(?:' + browserid + ')[\/: ]([\\d.]+)')) || [0, '0'])[1];
</script>
@jpswade
jpswade / kube_cheatsheet.sh
Created October 19, 2017 13:25
Kubenetes cheatsheet
# Run a command on a pod with the name database.
kubectl exec -it $(kubectl get pods --selector=app=database -o=name | awk -F "/" '{print $2}') /bin/bash
@jpswade
jpswade / setup_fastlane.sh
Created September 14, 2017 15:50
setup fastlane
\curl -L https://get.rvm.io | bash -s stable --ruby
rvm reload
rvm install 2.1.0 --autolibs=enable
sudo gem install fastlane
@jpswade
jpswade / install_adb.sh
Last active December 26, 2023 10:39
Install android on centos
#!/bin/sh
# yum install android-tools -y
yum install java-1.8.0-openjdk-devel
mkdir -p android-sdk-linux
cd android-sdk-linux
# @see https://developer.android.com/studio/index.html
wget --output-document=android-sdk.zip --quiet https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
unzip android-sdk.zip
rm -f android-sdk.zip
yes | tools/bin/sdkmanager --licenses
# Set permissions
sudo chown -R "$USER" /usr/local
# Cleanup
brew uninstall --force php53
brew uninstall --force php54
brew uninstall --force php55
brew uninstall --force php56
brew unlink php70
brew cleanup
[[ -e ~/.ssh/id_rsa ]] || ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""
ssh_hosts="github.com bitbucket.org"
for ssh_host in ${ssh_hosts[@]}; do
ssh_host_ips="$(host ${ssh_host} | awk '/has address/ { print $4 }')"
ssh-keygen -R ${ssh_host}
ssh-keyscan -H ${ssh_host} >> ~/.ssh/known_hosts
for ssh_host_ip in ${ssh_host_ips[@]}; do
ssh-keygen -R ${ssh_host_ip}
ssh-keygen -R ${ssh_host},${ssh_host_ip}
ssh-keyscan -H ${ssh_host},${ssh_host_ip} >> ~/.ssh/known_hosts
[[ -e ~/.ssh/id_rsa ]] || ssh-keygen -t rsa -f ~/.ssh/id_rsa -N ""