Skip to content

Instantly share code, notes, and snippets.

@cannonkalra
cannonkalra / Makefile
Created February 6, 2024 16:50
makefile for c programs with clang
IDIR =../include
CC=clang
CFLAGS=-I$(IDIR) -g -Wall -O0
ODIR=.
LDIR =../lib
LIBS=-lm
*,
*:before,
*:after {
box-sizing: border-box;
}
html,
body,
div,
span,
ARG PORT=3000
FROM node:14-alpine AS node
# Builder stage
FROM node AS builder
# Use /app as the CWD
#!/bin/bash
########################################
# Put this on a Server
# run chmod +x deploy_app.sh to make the script executable
#
# Execute this script: ./deploy_app.sh ${DOCKER_IMAGE:TAG} ${CONTAINER_NAME} ${PORT}
# Replace the ${TAG} with the actual Build Tag you want to deploy
#
########################################
@cannonkalra
cannonkalra / pre-commit-config.yaml
Created January 23, 2024 09:27
poetry file with pre-commit-config.yaml
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.12.1
hooks:
@cannonkalra
cannonkalra / reset.css
Last active February 1, 2024 12:24 — forked from Asjas/reset.css
Modern CSS Reset - Andy Bell
/* https://piccalil.li/blog/a-modern-css-reset */
/* Box sizing rules */
*,
*::before,
*::after {
box-sizing: border-box;
}
@cannonkalra
cannonkalra / update_godaddy_dns.py
Last active January 13, 2024 14:18 — forked from robweber/update_godaddy_dns.py
Use the GoDaddy API to update a DNS record when external IP changes
"""update_godaddy_dns.py
Updates a GoDaddy DNS record with a new external IP address using the GoDaddy API
Run in debug mode (-D) to check the IP but not update DNS records
https://developer.godaddy.com/doc/endpoint/domains
Requires:
configargparse
requests
"""
@cannonkalra
cannonkalra / aws-ubuntu.pkr.hcl
Last active January 10, 2024 12:34
packer wireguard ami
packer {
required_plugins {
amazon = {
version = ">= 1.2.8"
source = "github.com/hashicorp/amazon"
}
}
}
source "amazon-ebs" "ubuntu" {
import logging
FORMAT = "%(asctime)s: %(levelname)s: %(lineno)s: %(message)s"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
log = logging.getLogger()
logging.basicConfig(level=logging.DEBUG, format=FORMAT, datefmt=DATE_FORMAT)