Skip to content

Instantly share code, notes, and snippets.

View georgemck's full-sized avatar
😀

GeorgeMcK georgemck

😀
View GitHub Profile
@georgemck
georgemck / 00_get_certificate.sh
Created June 23, 2025 05:10 — forked from rschuetzler/00_get_certificate.sh
Using LetsEncrypt with Amazon Linux 2023
#!/usr/bin/env bash
# Place in .platform/hooks/postdeploy directory
sudo certbot -n -d YOURDOMAINHERE --nginx --agree-tos --email YOUREMAILHERE
@georgemck
georgemck / envtojson.mjs
Last active May 28, 2025 05:31 — forked from anwarulislam/env-to-json.js
ENV format to JSON object converter node script - node env-to-json ./file.env
//usage node ./env2json.mjs ./.env
//package.json
/*
{
"name": "jsonsecrets",
"version": "1.0.0",
"description": "",
"main": "index.mjs",
@georgemck
georgemck / get_into_docker_image.md
Created May 22, 2025 12:23 — forked from joseluisq/get_into_docker_image.md
How do you get into a Docker image?

How do you get into a Docker image?

We can do this running our image interactively which creates a temporary container for:

docker run --rm -it \
    --name my_container \
    --volume $PWD:/some_dir_in_container \
    --workdir /some_dir_in_container \
 golang:1.13-buster bash
@georgemck
georgemck / get_into_docker_image.md
Created May 22, 2025 12:23 — forked from joseluisq/get_into_docker_image.md
How do you get into a Docker image?

How do you get into a Docker image?

We can do this running our image interactively which creates a temporary container for:

docker run --rm -it \
    --name my_container \
    --volume $PWD:/some_dir_in_container \
    --workdir /some_dir_in_container \
 golang:1.13-buster bash
let path = require('path');
let aws = require('aws-sdk');
let s3Client = new aws.S3();
let zlib = require('zlib');
let s3s = require('s3-streams');
const output_bucket = "stackoverflow-bucket";
exports.handler = (event, context, callback) => {
context.callbackWaitsForEmptyEventLoop = false;
<html>
<head>
<script src="clmtrackr.js"></script>
<script src="p5.js"></script>
<script>
var ctracker;
function setup() {
@georgemck
georgemck / smiley.py
Created July 19, 2024 17:28 — forked from bbengfort/smiley.py
Matplotlib smiley face.
fig = plt.figure(figsize=(8,8))
ax = fig.add_subplot(1,1,1, aspect=1)
ax.scatter([.5],[.5], c='#FFCC00', s=120000, label="face")
ax.scatter([.35, .65], [.63, .63], c='k', s=1000, label="eyes")
X = np.linspace(.3, .7, 100)
Y = 2* (X-.5)**2 + 0.30
ax.plot(X, Y, c='k', linewidth=8, label="smile")
@georgemck
georgemck / lambda-pinpoint.js
Created May 6, 2022 17:42 — forked from netroy/lambda-pinpoint.js
Use A Lambda function to send an SMS over Amazon Pinpoint
const appId = [[PINPOINT_APPLICATION_ID]];
const destination = [[YOUR_PHONE_NUMBER]];
const { Pinpoint } = require('aws-sdk');
const pinpoint = new Pinpoint();
const payloadFn = (appId, destination, message) => {
const ApplicationId = appId;
const Addresses = {};
@echo off
SET count=1
FOR /f "tokens=*" %%G IN ('dir /b') DO (
echo %count%:%%G
convert -background white -gravity center "%%G" -resize 750x750 -extent 750x750 "results/%%G"
set /a count+=1 )
echo File count = %count%
REM DOS !
@georgemck
georgemck / aws-cloudformation-lamp-stack.json
Created July 22, 2021 17:53 — forked from christophchamp/aws-cloudformation-lamp-stack.json
AWS CloudFormation single instance LAMP stack template
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template LAMP_Single_Instance: Create a LAMP stack using a single EC2 instance and a local MySQL database for storage. This template demonstrates using the AWS CloudFormation bootstrap scripts to install the packages and files necessary to deploy the Apache web server, PHP and MySQL at instance launch time. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Parameters" : {
"KeyName": {
"Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance",
"Type": "AWS::EC2::KeyPair::KeyName",