Skip to content

Instantly share code, notes, and snippets.

@jeremypruitt
jeremypruitt / generate-animated-counter-gif.py
Last active July 11, 2021 08:23
Generates an animated gif of a counter
from PIL import Image, ImageDraw, ImageSequence, ImageFont
import io
import click
FIRST_NUMBER = click.prompt('Enter the low number of the range', default=10330, type=int)
LAST_NUMBER = click.prompt('Enter the high number of the range', default=10346, type=int)
FRAME_DURATION = click.prompt('How long to hold on each number', default=100, type=int)
ANIMATED_GIF_FILENAME = click.prompt('Enter the name of the animated gif to generate', default="incrementing-counter.gif", type=str)
TEXT_COLOR = (255,255,255)
@jeremypruitt
jeremypruitt / CheatSheet-Pentesting.md
Last active April 1, 2024 10:14
Pentesting Cheatsheet

Reminders

Remember to log all the things!

  • Metasploit - spool /home//.msf3/logs/console.log
  • Save contents from each terminal!
  • Linux - script myoutput.txt # Type exit to stop

Setup

@mubix
mubix / infosec_newbie.md
Last active April 7, 2024 22:35
How to start in Infosec
@zspecza
zspecza / curryN.js
Last active April 12, 2017 18:13
curryN with placeholder support (not optimized)
// this file is just so I can reference the idea behind placeholders - if you want a maintained version, check out:
// - https://github.com/thisables/curry
// - http://ramdajs.com
const __ = Symbol
const ARITIES = {}
const setArity = (arity, fn) => {
if (!ARITIES[arity]) {
@stukennedy
stukennedy / riot-flux.md
Last active April 29, 2019 22:05
Implementing Flux architecture in RiotJS

Implementing Flux architecture in RiotJS

RiotControl seems an unnecessary dependency and has a critical issue whereby registering multiple stores causes any event to be triggered multiple times. I decided to create a minimal dispatcher.

Create a very simple dispatcher singleton called dispatcher.js:

import riot from 'riot'
@BretFisher
BretFisher / docker-swarm-ports.md
Last active April 4, 2024 22:19
Docker Swarm Port Requirements, both Swarm Mode 1.12+ and Swarm Classic, plus AWS Security Group Style Tables

Docker Swarm Mode Ports

Starting with 1.12 in July 2016, Docker Swarm Mode is a built-in solution with built-in key/value store. Easier to get started, and fewer ports to configure.

Inbound Traffic for Swarm Management

  • TCP port 2377 for cluster management & raft sync communications
  • TCP and UDP port 7946 for "control plane" gossip discovery communication between all nodes
  • UDP port 4789 for "data plane" VXLAN overlay network traffic
  • IP Protocol 50 (ESP) if you plan on using overlay network with the encryption option

AWS Security Group Example

@leonardofed
leonardofed / README.md
Last active April 10, 2024 17:16
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@f5io
f5io / core.js
Last active September 7, 2023 18:38
An approach to async middleware for raw `http` in Node.
const http = require('http');
const methods = [ 'get', 'put', 'post', 'delete', 'head' ];
const isStream = obj =>
obj &&
typeof obj === 'object' &&
typeof obj.pipe === 'function';
const isReadable = obj =>
@ryankirkman
ryankirkman / formatjson.js
Last active September 16, 2019 02:12 — forked from kristopherjohnson/formatjson.js
Read JSON from standard input and writes formatted JSON to standard output. Requires Node.js.
#!/usr/bin/env node
// Reads JSON from stdin and writes equivalent
// nicely-formatted JSON to stdout.
var input = '';
process.stdin.resume();
process.stdin.setEncoding('utf8');