Skip to content

Instantly share code, notes, and snippets.

@ryboe
ryboe / .travis.yml
Last active November 23, 2023 05:37
Example .travis.yml for Golang
# use the latest ubuntu environment (18.04) available on travis
dist: bionic
language: go
# You don't need to test on very old versions of the Go compiler. It's the user's
# responsibility to keep their compiler up to date.
go:
- 1.16.x
@atoponce
atoponce / password_strength.md
Last active July 11, 2019 04:20
A document evaluating different open source password generators and password strength testers. See the other Gists at the end of the document for the password results.

Open Source Password Generator / Strength Meter Testing

This is a collection of password generators and strength meter testing. Each generator produces a different array of passwords, of which are then tested against each of the strength meters. The defaults are used where possible, otherwise sane options are provided.

The Results

The following results are tables showing the generators, passwords, and strength testers described below.

  1. Randomly generaterd passwords: atoponce/random_results_table.md
@domenic
domenic / 0-github-actions.md
Last active April 8, 2024 23:35
Auto-deploying built products to gh-pages with Travis

Auto-deploying built products to gh-pages with GitHub Actions

This is a set up for projects which want to check in only their source files, but have their gh-pages branch automatically updated with some compiled output every time they push.

A file below this one contains the steps for doing this with Travis CI. However, these days I recommend GitHub Actions, for the following reasons:

  • It is much easier and requires less steps, because you are already authenticated with GitHub, so you don't need to share secret keys across services like you do when coordinate Travis CI and GitHub.
  • It is free, with no quotas.
  • Anecdotally, builds are much faster with GitHub Actions than with Travis CI, especially in terms of time spent waiting for a builder.
@jay
jay / PostJSON.c
Last active July 31, 2022 20:35
Use libcurl to POST JSON data.
/* Use libcurl to POST JSON data.
Usage: PostJSON <name> <value>
curl-library mailing list thread:
'how do i post json to a https ?'
https://curl.haxx.se/mail/lib-2015-01/0049.html
* Copyright (C) 2015 Jay Satiro <raysatiro@yahoo.com>
https://curl.haxx.se/docs/copyright.html
@OnlyInAmerica
OnlyInAmerica / find_iam_user.py
Created April 3, 2014 22:52
Find an AWS IAM user corresponding to an AWS Access Key
# Find the IAM username belonging to the TARGET_ACCESS_KEY
# Useful for finding IAM user corresponding to a compromised AWS credential
# Requirements:
#
# Environmental variables:
# AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY
# python:
# boto
import sys
import subprocess
import tempfile
import urllib
text = sys.stdin.read()
chart_url_template = ('http://chart.apis.google.com/chart?'
'cht=qr&chs=300x300&chl={data}&chld=H|0')
chart_url = chart_url_template.format(data=urllib.quote(text))
@earthgecko
earthgecko / bash.generate.random.alphanumeric.string.sh
Last active April 2, 2024 15:59
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1
@jboner
jboner / latency.txt
Last active May 5, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@devd
devd / ext2csp.pl
Last active July 12, 2016 22:31
Simple Tool to maybe rewrite extensions to be CSP compatible
#Run this on Extension Source code to make it inline-script-less
#perl ext2csp.pl <extdir>;
#where extdir is the directory with the manifest.json.
#This will make a inplace change: make a copy if you want it to work on a copy.
use strict;
use warnings;
use HTML::Parser ();
@sylvinus
sylvinus / LICENSE.txt
Created October 2, 2011 10:24 — forked from 140bytes/LICENSE.txt
Mandelbrot in less than 140 bytes of Javasacript
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE