Skip to content

Instantly share code, notes, and snippets.

Avatar

bmcculley

View GitHub Profile
@bmcculley
bmcculley / main.go
Created Sep 3, 2021
AWS example web server for learning
View main.go
package main
import (
"fmt"
"net/http"
"os"
)
var hostname string
@bmcculley
bmcculley / userdata.sh
Created Sep 3, 2021
Install nginx on aws ec2 instance
View userdata.sh
#!/bin/bash
yum update -y
sudo amazon-linux-extras install nginx1 -y
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
@bmcculley
bmcculley / app.py
Created Aug 15, 2021
Flask socket io
View app.py
from flask import Flask, render_template, session, copy_current_request_context, jsonify
from flask_socketio import SocketIO, emit, disconnect
from threading import Lock
async_mode = None
app = Flask(__name__)
app.config['SECRET_KEY'] = 'ceafa6fe-f968-4d7d-8583-4252c5ab54a4' # change me
socketio = SocketIO(app, async_mode=async_mode)
thread = None
@bmcculley
bmcculley / example.py
Created Aug 15, 2021
Running a docker container from Python example.
View example.py
import docker
import os
def run_container(container_name):
client = docker.from_env()
client.containers.run(container_name, ports={8080:8080}, detach=True)
def get_id(container_name):
client = docker.from_env()
View bank.py
from collections import Counter
def withdraw_one(amount):
bills = [100,50,20]
memo = [amount + 1] * (amount + 1)
bills_results = [[]] * (amount+1)
d = {100:0, 50:0, 20:0}
memo[0] = 0
@bmcculley
bmcculley / readme.md
Last active Aug 7, 2021
SRE/DevOps Challenge
View readme.md

SRE/DevOps Challenge

Overview

This challenge will test the following skills:

  • Kubernetes orchestration
  • CI systems
  • REST APIs
  • Scripting
@bmcculley
bmcculley / docker-compose.yaml
Last active Jun 22, 2021
Docker Compose File For Wordpress and MariaDB
View docker-compose.yaml
version: '3'
services:
# Database
db:
image: mariadb:latest
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@bmcculley
bmcculley / psprojectitem.objecttype.kv.txt
Created Jun 8, 2021
PeopleSoft PSPROJECTITEM table OBJECTTYPE column to name value
View psprojectitem.objecttype.kv.txt
{ '0': 'Record',
'1': 'Index',
'2': 'Field',
'3': 'Field Format',
'4': 'Translate Values',
'5': 'Page',
'6': 'Menu',
'7': 'Component',
'8': 'Record PC',
'9': 'Menu PC'
@bmcculley
bmcculley / fileServer.go
Created Mar 1, 2021
Golang HTTP/3 fileserver example
View fileServer.go
package main
import (
"flag"
"fmt"
"log"
"net/http"
"path"
"github.com/lucas-clemente/quic-go/http3"
@bmcculley
bmcculley / README.md
Last active Feb 18, 2021
A Go embed example of serving static files at the root URL path.
View README.md