Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

miked0004 miked0004

🎯
Focusing
Block or report user

Report or block miked0004

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@miked0004
miked0004 / docker-save-restore-images.md
Created May 19, 2018
Easy save and restore docker images
View docker-save-restore-images.md

Docker Save and Restore Images

Use this to save and load images from local disk. It is faster and more efficient than network loading. Caveat, the images can become outdated.

Pull Image

docker pull gradle:4.7.0-jdk8
View index.html
<html>
<head>
<meta name="description" content="vis.js navigation">
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#mynetwork {
width: 600px;
height: 400px;
@miked0004
miked0004 / main.tf
Last active Nov 30, 2018
terraform-template user data
View main.tf
# This example will generate a user-data script for in AWS ec2.
#
# The purpose is to debug creation of user-data scripts with terraform templating limitations.
#
# Primary goal is to get a string like this in the user-data script:
#
# echo ECS_INSTANCE_ATTRIBUTES='{"placement_instance": "foo"}' >> /etc/ecs/ecs.config
#
locals {
@miked0004
miked0004 / highsierra_iso.sh
Created Jan 20, 2018 — forked from jnovack/highsierra_iso.sh
Create bootable ISO from HighSierra Installer
View highsierra_iso.sh
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7000m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ High\ Sierra.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
# Do not copy the core, recovery CD ONLY
cp /Volumes/highsierra/Packages/EmbeddedOSFirmware.pkg /Volumes/OS\ X\ Base\ System/System/Installation/
cp /Volumes/highsierra/Packages/FirmwareUpdate.pkg /Volumes/OS\ X\ Base\ System/System/Installation/
cp /Volumes/highsierra/Packages/OSInstall.mpkg /Volumes/OS\ X\ Base\ System/System/Installation/
@miked0004
miked0004 / pre-commit
Created Sep 7, 2017 — forked from jamtur01/pre-commit
A Terraform validation and formatting pre-commit hook
View pre-commit
#!/usr/bin/env bash
set -e
# Formats any *.tf files according to the hashicorp convention
files=$(git diff --cached --name-only)
for f in $files
do
if [ -e "$f" ] && [[ $f == *.tf ]]; then
#terraform validate `dirname $f`
terraform fmt $f
View capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@miked0004
miked0004 / Dockerfile-rubyphantomjs
Last active Nov 14, 2016
Docker phantomjs ruby test box
View Dockerfile-rubyphantomjs
From ruby:2.3.1
RUN apt-get update
RUN apt-get install build-essential chrpath libssl-dev libxft-dev -y \
&& apt-get install libfreetype6 libfreetype6-dev -y \
&& apt-get install libfontconfig1 libfontconfig1-dev -y
RUN set -xeu \
\
View homebrew-install-gnu.sh
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@miked0004
miked0004 / Dockerfile-gobuilder.sh
Last active May 15, 2018
demo using docker to compile terraform master branch
View Dockerfile-gobuilder.sh
#!/usr/bin/env bash
#
# this will cross-compile terraform from source and drop the zipped
# packages in ./build
#
# this is only an exercise for docker, it is not a recommended usage
# of anything
#
mkdir -p ./build
cat<<-EOF | docker build --rm -t my/gobuilder -
You can’t perform that action at this time.