Skip to content

Instantly share code, notes, and snippets.

View vchrisb's full-sized avatar

Christopher Banck vchrisb

View GitHub Profile
Vagrant.configure(2) do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://atlas.hashicorp.com/search.
config.vm.box = "hashicorp/precise32"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
config.vm.network "forwarded_port", guest: 80, host: 8080
vagrant plugin install vagrant-cachier
vagrant plugin install sahara
git clone https://github.com/vchrisb/vagrant-coprhd.git
#!/bin/bash
echo "Updating images:"
docker images | grep -v '^<none>' | grep -v '^REPOSITORY' | awk '{print $1}' | xargs -L1 docker pull | grep 'Status'
echo -e "\nChecking if a container is not running the latest image:"
CIDS=$(docker ps | grep -v '^CONTAINER ID' | awk '{print $1}')
for CID in $CIDS
do
RUNNING=`docker inspect --type=container --format "{{.Image}}" $CID`
IMAGE=`docker inspect --type=container --format "{{.Config.Image}}" $CID`
#!/bin/bash
#stopping container
echo "Stopping Container: wordpress1_mariadb wordpress_html"
sudo docker stop wordpress_mariadb wordpress_html
#delete
echo "Deleting Container: wordpress1_mariadb wordpress_html"
sudo docker rm -f wordpress_mariadb wordpress_html
#!/bin/bash
#stopping container
echo "Stopping Container: nginx nginx-gen nginx-letsencrypt"
sudo docker stop nginx nginx-gen nginx-letsencrypt
#delete
echo "Deleting Container: nginx nginx-gen nginx-letsencrypt"
sudo docker rm -f nginx nginx-gen nginx-letsencrypt
@vchrisb
vchrisb / cf-networking-bosh-lite.yml
Last active November 26, 2018 18:06
A bosh ops file to allow cloud foundry networking for bosh-lite
# add cf-networking release
- type: replace
path: /releases/-
value:
name: cf-networking
sha1: 689ff1050b49513d5fe889b9655803bcdd265824
url: https://bosh.io/d/github.com/cloudfoundry-incubator/cf-networking-release?v=0.18.0
version: "0.18.0"
- type: replace
#!/bin/bash
USER=$(curl -s http://metadata.google.internal/computeMetadata/v1/instance/attributes/ssh-keys -H "Metadata-Flavor: Google" | cut -d: -f1)
[ -x /home/$USER/.vnc ] && exit
sudo apt-get -q update
sudo apt-get -yq install xfce4 xfce4-goodies firefox tightvncserver autocutsel
PASS=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 16 | head -n 1)
echo "VNCServerPassword: $PASS"

Command to create a Minio Gateway to GCS from command line

variables

INSTANCE="minio-gw"
PROJECT=<project>
CRED_FILE="minio.key.json"
BUCKET="<bucket>"
SERVICE_ACCOUNT="<service account>"
ZONE="us-east1-b"
#dnsmasq
brew install dnsmasq
echo "listen-address=127.0.0.1" >> $(brew --prefix)/etc/dnsmasq.conf
echo "port=5354" >> $(brew --prefix)/etc/dnsmasq.conf
sudo brew services start dnsmasq
sudo mkdir -v /etc/resolver
sudo tee -a /etc/resolver/local <<EOF