Skip to content

Instantly share code, notes, and snippets.

View jdeathe's full-sized avatar
💭
Taking a break from development projects to focus other things

James Deathe jdeathe

💭
Taking a break from development projects to focus other things
View GitHub Profile
@jdeathe
jdeathe / php-hello-world.yml
Last active March 11, 2017 14:51
Kubernetes Deployment definition for php-hello-world app based on the Docker image jdeathe/centos-ssh-apache-php
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: php-hello-world
spec:
replicas: 1
template:
metadata:
labels:
app: php-hello-world
@jdeathe
jdeathe / php-hello-world-kubernetes-notes.md
Last active March 12, 2017 08:28
Notes made during initial trial of Kubernetes minkube
@jdeathe
jdeathe / docker-compose.yml
Last active March 14, 2017 05:54
docker-compose definition for a Wordpress environment with SSH access
# Requirement: https://github.com/jdeathe/centos-ssh/issues/472
#
# On CentOS-7 Host install docker-compose:
# sudo yum -y upgrade python*
# sudo yum -y install epel-release
# sudo yum -y install python-pip
# sudo pip install docker-compose
# OR Use container alias and add the following 2 environment variables to .env
# Ref: https://gist.github.com/jdeathe/e7b09222bb44a2efa6a67b893fe35ac1
#
@jdeathe
jdeathe / javascript-loader-demo.html
Last active May 15, 2017 01:49
JavaScript Loader
<!DOCTYPE html>
<html>
<head>
<title>JavaScriptLoader</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.8.23/themes/base/jquery-ui.css" type="text/css" media="all" />
<style type="text/css">
body.jsLoaded .hidden {display: none;}
</style>
</head>
@jdeathe
jdeathe / docker-compose-alias.md
Last active May 18, 2017 22:42
Alias for docker-compose (version 1.13.0) installed as a docker container

How to Install docker-compose as a Docker Container

It might be desirable to to install docker-compose as a container. The official way is to use wrapper script. Here is an alternative approach using an alias.

Using the Default docker Binary

# alias docker-compose='touch ${PWD}/.env; \
  docker run \
  --privileged \
@jdeathe
jdeathe / containerised-squid-proxy.sh
Last active May 21, 2017 14:37
Local Squid Proxy (Experimental)
#
# WARNING! This configures a Man-In-The-Middle proxy that decrypts HTTPS traffic.
#
# - Requires Local DNS: https://gist.github.com/jdeathe/252578a3217ab9782fed10c3b3816d30
# - Disable the SSH features and process - using local docker.
# - https://docs.docker.com/engine/userguide/networking/
# - http://www.squid-cache.org/Versions/v3/3.3/cfgman/http_port.html
# - http://www.squid-cache.org/Versions/v3/3.3/cfgman/ssl_bump.html
# - http://www.squid-cache.org/Versions/v3/3.3/cfgman/refresh_pattern.html
# - https://www.openssl.org/docs/manmaster/ssl/SSL_CTX_set_options.html
@jdeathe
jdeathe / telnet-memcached.exp
Last active June 7, 2017 21:21
Expect script to test memcached using telnet.
#!/usr/bin/env expect
set env(HOME) /usr/local/bin
set env(SHELL) /bin/bash
set env(TERM) xterm
set timeout 3
# Destination IP address
set HOST [lindex ${argv} 0]
@jdeathe
jdeathe / telnet-proxy-tcp4.exp
Last active June 7, 2017 21:22
Expect script to test PROXY protocol requests using telnet.
#!/usr/bin/env expect
set env(HOME) /usr/local/bin
set env(SHELL) /bin/bash
set env(TERM) xterm
set timeout 15
# Source IP address
set SOURCE_ADDRESS [lindex ${argv} 0]
@jdeathe
jdeathe / using-curl-to-capture-website-response-time.md
Last active June 28, 2017 22:32
Using CURL to Capture Website Response Time

Using CURL to Capture Website Response Time

Generate 2 CURL templates, the first is for readability and the second is for generating a CSV report over time.

$ tee &> /dev/null ~/.curl_report <<-EOT
       url_effective: %{url_effective}\n
           http_code: %{http_code}\n
\n
      speed_download: %{speed_download}\n
@jdeathe
jdeathe / traefik.app-1.local.toml
Created October 25, 2016 22:53
Traefik configuration example for load balanced containers with front-end https://app-1.local
################################################################
# Global configuration
################################################################
# Timeout in seconds.
# Duration to give active requests a chance to finish during hot-reloads
#
# Optional
# Default: 10
#