Skip to content

Instantly share code, notes, and snippets.

View bmcculley's full-sized avatar

bmcculley

View GitHub Profile
@bmcculley
bmcculley / rp2g.py
Created March 7, 2022 17:28
Random pronounceable password generator
import random
def get_char(chars):
random_char = random.choice(chars)
if random.randrange(2):
return random_char.upper()
return random_char
def gen(length):
password = ""
@bmcculley
bmcculley / main.go
Created September 3, 2021 03:36
AWS example web server for learning
package main
import (
"fmt"
"net/http"
"os"
)
var hostname string
@bmcculley
bmcculley / userdata.sh
Created September 3, 2021 02:07
Install nginx on aws ec2 instance
#!/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 August 15, 2021 05:34
Flask socket io
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 August 15, 2021 04:26
Running a docker container from Python example.
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()
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 May 10, 2023 18:40
SRE/DevOps Challenge

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 June 22, 2021 00:08
Docker Compose File For Wordpress and MariaDB
version: '3'
services:
# Database
db:
image: mariadb:latest
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@bmcculley
bmcculley / psprojectitem.objecttype.kv.txt
Created June 8, 2021 12:06
PeopleSoft PSPROJECTITEM table OBJECTTYPE column to name value
{ '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 March 1, 2021 22:52
Golang HTTP/3 fileserver example
package main
import (
"flag"
"fmt"
"log"
"net/http"
"path"
"github.com/lucas-clemente/quic-go/http3"