Skip to content

Instantly share code, notes, and snippets.

@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@kzap
kzap / terraform-app.sh
Created June 28, 2016 15:54
Wrapper for terraform that lets you specify an environment and calls an $ENV.tfvars file, uses a $ENV.tfstate file and sets the env variable
#!/bin/bash
#
# terraform-app
#
# This to terraform the servers for the Galleon App
# By storing the date now, we can calculate the duration of provisioning at the
# end of this script.
start_seconds="$(date +%s)"
@ipbastola
ipbastola / jq to filter by value.md
Last active April 25, 2024 17:14
JQ to filter JSON by value

JQ to filter JSON by value

Syntax: cat <filename> | jq -c '.[] | select( .<key> | contains("<value>"))'

Example: To get json record having _id equal 611

cat my.json | jq -c '.[] | select( ._id | contains(611))'

Remember: if JSON value has no double quotes (eg. for numeric) to do not supply in filter i.e. in contains(611)

@chrismccord
chrismccord / upgrade.md
Last active April 7, 2023 12:03
Phoenix 1.2.x to 1.3.0 Upgrade Instructions

If you want a run-down of the 1.3 changes and the design decisions behidn those changes, check out the LonestarElixir Phoenix 1.3 keynote: https://www.youtube.com/watch?v=tMO28ar0lW8

To use the new phx.new project generator, you can install the archive with the following command:

$ mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Bump your phoenix dep

Phoenix v1.3.0 is a backwards compatible release with v1.2.x. To upgrade your existing 1.2.x project, simply bump your phoenix dependency in mix.exs:

@textarcana
textarcana / jq_recipes.sh
Created March 25, 2017 02:58
JQ Cookbook Examples by Noah Sussman
#!/usr/bin/env bash
set -x
# jq Recipes
# _ _____ _
# (_) | __ \ (_)
# _ __ _ | |__) | ___ ___ _ _ __ ___ ___
# | | / _` | | _ / / _ \ / __|| || '_ \ / _ \/ __|
# | || (_| | | | \ \| __/| (__ | || |_) || __/\__ \
@alexellis
alexellis / k8s-pi.md
Last active April 11, 2024 14:17
K8s on Raspbian
@sdorsett
sdorsett / notes.txt
Last active April 16, 2020 11:51
Using clair-scanner to scan a local docker image
### make sure go is installed
Stans-MacBook-Pro:clair-scanner standorsett$ go version
go version go1.8.3 darwin/amd64
Stans-MacBook-Pro:clair-scanner standorsett$
### make sure GOPATH is defined and $GOPATH/bin is added to $PATH
Stans-MacBook-Pro:clair-scanner standorsett$ cat ~/.bash_profile
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$PATH
@mitchellhenke
mitchellhenke / upgrade.md
Last active September 2, 2019 15:48
Sentry 6.x to 7.x Upgrade Guide

Bump your sentry dep

def deps do
  [
    {:sentry, "~> 7.0"},
  ]
end
require 'base64'
require 'plist'
module Chef::Provider::User::DsclMojaveUserExtensions
# new for 10.14+
def mac_osx_version_greater_than_10_13?
Gem::Version.new(node['platform_version']) > Gem::Version.new('10.13.99')
end
# updated for 10.14+
@jmhobbs
jmhobbs / Dockerfile
Created December 27, 2018 22:02
Google Cloud Build Secret Environment Demo
FROM busybox
ARG THE_SECRET
RUN echo "::${THE_SECRET}::"