Skip to content

Instantly share code, notes, and snippets.

@inderpartap
inderpartap / node_migration.py
Created March 4, 2025 20:33
This Python script automates the zero-downtime migration of workloads between Amazon EKS node groups. It taints and cordons old nodes to prevent new pod scheduling, drains workloads while respecting eviction policies, and moves those workloads to the new node groups. This ensures a smooth transition without disrupting running services.
# Standard Library
import argparse
import json
import logging
import subprocess
import time
from typing import List
# Configure logging
logging.basicConfig(
@raviagheda
raviagheda / github-action-ssh.md
Last active December 3, 2025 22:10
Github Action with EC2 using SSH
@xerosai
xerosai / FACPaymentUtils.js
Last active October 2, 2020 19:25
Helper class in JavaScript that works with the First Atlantic Commerce payment gateway service. Still a work in progress but, I will turn this into an NPM module eventually
/**
* Filename: FACPaymentUtils.js
* Created by: xerosai @ 22/07/2020 11:10 AM
* @author: Simon Neufville <simon@xrscodeworks.com>
*/
const axios = require('axios');
const CryptoJS = require('crypto-js');
const xmlJS = require('xml-js');
const xml2js = require('xml2js');
@pcgeek86
pcgeek86 / Car Manufacturers.json
Last active November 15, 2025 09:45
Plain-text list of major car manufacturers
[
"Abarth",
"Alfa Romeo",
"Aston Martin",
"Audi",
"Bentley",
"BMW",
"Bugatti",
"Cadillac",
"Chevrolet",
@mollerse
mollerse / gulpfile-express.js
Last active March 28, 2021 20:07
Gulpfile for livereload + static server
var gulp = require('gulp'),
sass = require('gulp-sass'),
browserify = require('gulp-browserify'),
concat = require('gulp-concat'),
embedlr = require('gulp-embedlr'),
refresh = require('gulp-livereload'),
lrserver = require('tiny-lr')(),
express = require('express'),
livereload = require('connect-livereload')
livereloadport = 35729,
@comfuture
comfuture / manage-daemon
Created November 11, 2010 06:28
init script sample for gunicorn daemonized flask app
#!/bin/bash
gunicorn="/usr/local/bin/gunicorn"
prog="dev.maroo.info"
PROJECT_HOME="/home/maroo/sites/$prog"
pid="/var/lock/$prog"
RETVAL=0
start() {
@davidphasson
davidphasson / show.html.erb
Created April 8, 2009 03:42
ERB and the case statement
# Doesn't work
<p>
<% case @request.author_hosted %>
<% when "yes" %>
The school <b>has</b> hosted an author before.
<% when "no" %>
The school <b>has not</b> hosted an author before.
<% end %>
</p>