Skip to content

Instantly share code, notes, and snippets.

View jay-johnson's full-sized avatar

Jay jay-johnson

View GitHub Profile
@jay-johnson
jay-johnson / Debugging Database Schema Creation.md
Last active April 11, 2016 05:11
Debugging Database Schema Creation
[root@mysql1 db-loaders]# cat /tmp/dbreload.log

Creating Database(stocks) on Env(Local)

Dropping Targeted Database(stocks) Address(127.0.0.1) User(dbadmin) Pass(dbadmin123) Schema(/opt/db-loaders/schema/db_schema.py) Init(/opt/db-loaders/schema/initialize_db.py)
/opt/db-loaders/schema/drop_database.sh stocks dbadmin 127.0.0.1 dbadmin123 3306
Creating Targeted Database(stocks) Address(127.0.0.1) User(dbadmin) Pass(dbadmin123) Schema(/opt/db-loaders/schema/db_schema.py) Init(/opt/db-loaders/schema/initialize_db.py)
/opt/db-loaders/schema/create_database.sh stocks dbadmin 127.0.0.1 dbadmin123 3306
Adding Records with Initializer(/opt/db-loaders/schema/initialize_db.py)
@jay-johnson
jay-johnson / docker-compose.yml
Last active April 13, 2016 03:33
Docker Compose - Schema Prototyper Example
version: '2'
services:
db:
image: jayjohnson/schemaprototyping
container_name: "schemaprototyping"
hostname: "mysql1"
networks:
- dbprototyping
environment:
@jay-johnson
jay-johnson / Change the Compose File without having to Rebuild the Container.md
Last active January 4, 2017 23:47
Change the Compose File without having to Rebuild the Container

Clone the Repo

$ git clone https://github.com/jay-johnson/docker-schema-prototyping-with-mysql.git

Start the Composition

$ ./start_composition.sh 
@jay-johnson
jay-johnson / Setting up X11 for use on an EC2 host.md
Last active January 20, 2024 02:37
Setting up X11 for use on an EC2 host

Run this on EC2 host

  1. Set these attributes in /etc/ssh/sshd_config
# cat /etc/ssh/sshd_config  | grep X11
X11Forwarding yes 
X11DisplayOffset 10
X11UseLocalhost yes 
@jay-johnson
jay-johnson / Downloading all Debian Packages from a Repo
Created April 27, 2016 21:08
Downloading all Debian Packages from a Repo
#!/bin/bash
repo="<DEBIAN REPO FQDN>"
outputDir="<DIRECTORY TO STORE DEBIAN FILES>"
arch="<ARCH like binary-i386 or binary-amd64>"
echo "Download All Debs from Repository($repo) to dir($outputDir)"
pushd $outputDir >> /dev/null
packagenames=`wget -q -O - http://$repo/pool/main/h | grep deb | grep href | sed -e 's/\/"/ /g' | sed -e 's/"/ /g' | awk '{print $3}'`
@jay-johnson
jay-johnson / Python Date Transformations.md
Last active June 4, 2016 02:42
Python Date Transformations

A list of python data transformations

String to Datetime

  1. String to Datetime and then compare
#!/usr/bin/python

import datetime
@jay-johnson
jay-johnson / CJE-DockerContainerTester.groovy
Last active July 13, 2016 21:52
CloudBees Jenkins Docker Pipeline
node {
// Setup the Docker Registry (Docker Hub) + Credentials
env.REGISTRY_URL = "https://index.docker.io/v1/" // Docker Hub
env.DOCKER_CREDS_ID = "jayjohnson-DockerHub" // name of the Jenkins Credentials ID
env.BUILD_TAG = "testing" // default tag to push for to the registry
stage 'Checking out GitHub Repo'
git url: 'https://github.com/jay-johnson/docker-django-nginx-slack-sphinx.git'

DEMO TITLE

@jay-johnson
jay-johnson / Run CJE Docker Container
Created July 15, 2016 06:05
Run CJE Docker Container
$ docker run -p 8080:8080 -p 50000:50000 -d --name cje -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker:/usr/local/bin/docker cloudbees/jenkins-enterprise
@jay-johnson
jay-johnson / Jenkins Pipeline - Set up Auth Credentials
Last active July 19, 2016 14:19
Jenkins Pipeline - Set up Auth Credentials
registry_url = "https://index.docker.io/v1/" // Docker Hub
docker_creds_id = "jayjohnson-DockerHub" // name of the Jenkins Credentials ID
build_tag = "testing" // default tag to push for to the registry