Skip to content

Instantly share code, notes, and snippets.

View scottrigby's full-sized avatar
🤓

Scott Rigby scottrigby

🤓
View GitHub Profile
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@rabellamy
rabellamy / git-fork-sync
Last active June 24, 2016 19:23 — forked from ianmariano/git-fork-sync
Syncs your repo fork with the upstream integration and then pushes the synced integration to origin. Presumes you have an 'upstream' remote which is from whence your fork was created. Put on your path and chmod a+x it then do: git fork-sync
#!/bin/bash
VERSION="20150504"
usage() {
cat << __EOF
$0 usage:
$0 [options]
@rimusz
rimusz / preemtible_kubernetes.md
Last active July 7, 2018 02:52 — forked from tsuri/preemtible_kubernetes.md
kubernetes cluster w/ pre-emptible instances

Kubernetes clusters using preemtible instances

Motivation

People experimenting with kubernetes clusters on the GKE not necessarily have money to keep a full cluster on at all time. GKE clusters can be easily resized, but this still incurs in the full instance cost when the cluster is up.

Google has added preemptible instances that are ideal for many

@stefanfoulis
stefanfoulis / docker_for_mac_disk_default_size.md
Last active June 29, 2023 12:02
How to resize Docker for Mac Disk image and set the default size for new images

Set the default size for new Docker for Mac disk images

UPDATE: The instructions here are no longer necessary! Resizing the disk image is now possible right from the UI since Docker for Mac Version 17.12.0-ce-mac49 (21995).

If you are getting the error: No space left on device

Configuring the qcow2 size cap is possible in the current versions:

# my disk is currently 64GiB
@scottrigby
scottrigby / k8s_charts_bump_dependency_version.sh
Last active September 3, 2017 18:31
kubernetes/charts dependency update script
#!/bin/bash
# @file
# See HELP().
# This script is useful until functionality is adopted into Helm.
#
# Follow @link https://github.com/kubernetes/helm/issues/1947 the issue. @endlink
# Define SCRIPT var for help and validation output.
SCRIPT=`basename ${BASH_SOURCE[0]}`
@mattfarina
mattfarina / reqs.md
Last active October 10, 2017 17:11

Hosted Chart Repository Requirements

Background

Kubernetes Helm has the ability to work with remotely hosted Charts. While charts can be seen in the community provided charts, the charts themselves can be privately or separately hosted for an organization or individual.

There are currently 3 major ways to host your own chart repository:

  • Helm provides a means to generate a chart repository that can be hosted on a web server, object storage, or via a similar setup.
  • App Registry provides a system, similar to the handling of Docker images, to store charts. In this setup one can push or pull charts in a similar way to container images. There is a spec and Quay, the image hosting service, has implemented it. For Helm to interact with this API a plugin is required.
@scottrigby
scottrigby / raw_joke.sh
Last active January 20, 2018 04:36
Raw gist joke
#!/bin/bash
echo 'Why did the guy get fired from the orange juice factory?'; read ANSWER;
echo "He couldn’t concentrate! 🍊😂😭. But '${ANSWER}' is funny too."
@scottrigby
scottrigby / rbac-config.sh
Last active November 8, 2018 17:13
RBAC for Tiller script
#!/bin/sh
# See https://github.com/kubernetes/helm/blob/master/docs/rbac.md#tiller-and-role-based-access-control
echo 'apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
---
@scottrigby
scottrigby / Dockerfile
Created August 11, 2018 19:12
Example Composer deps for Bitnami Drupal image
FROM bitnami/drupal:8
# Allow user codebase to include a custom composer merge file.
# See https://github.com/wikimedia/composer-merge-plugin.
COPY merge-composer.json /opt/bitnami
RUN apt-get update && apt-get install -y jq
RUN cd /opt/bitnami/drupal \
&& tmp=$(mktemp) \
&& cat composer.json | jq '.extra."merge-plugin".include |= .+ ["../merge-composer.json"]' > "$tmp" \
&& mv "$tmp" composer.json \
@scottrigby
scottrigby / Dockerfile
Last active August 22, 2018 00:07
bitnami-drupal-composer-persistence
FROM bitnami/drupal:8
COPY custom-app-entrypoint.sh /
ENTRYPOINT ["/custom-app-entrypoint.sh"]
CMD ["/run.sh"]