Skip to content

Instantly share code, notes, and snippets.

View ann-kilzer's full-sized avatar
💻
crushing it

Ann Kilzer キルザー杏 ann-kilzer

💻
crushing it
View GitHub Profile
@bgeesaman
bgeesaman / CVE-2019-11253-poc.sh
Last active December 29, 2022 14:25
CVE-2019-11253 Kubernetes API Server YAML Parsing Remote Denial of Service PoC aka "Billion Laughs"
#!/usr/bin/env bash
# CVE-2019-11253
# https://github.com/kubernetes/kubernetes/issues/83253
# Shout out: @raesene for poc collab, @iancoldwater + @mauilion for
# HONKing inspiration and other guidance.
# Description: In Kubernetes 1.13 and below, the default configuration
# is that system:anonymous can request a selfsubjectaccessreview
# via mechanisms such as "kubectl auth can-i". This request can
# include POSTed YAML, and just the act of trying to parse it causes
@ann-kilzer
ann-kilzer / 0 StampRally.sol
Last active October 15, 2019 23:15
Copy and paste into Remix for Stamp Rally Build-Along
pragma solidity ^0.5.0;
contract StampRally {
uint8 public numStamps; // number of Stamps in the game
string public name; // name of the Stamp Rally
address public owner; // Ownership for the game manager of the contract
// A StampKey keeps track of every stamp in the game
struct StampKey {
// The hashedPassphrase keeps the keccak256 encoded passphrase
@Gorcenski
Gorcenski / fizzbuzz.py
Last active May 23, 2022 23:55
The most obnoxious solution to FizzBuzz I can imagine.
import numpy as np
from functools import reduce
class Buzzer:
def __init__(self, **kwargs):
values = [v for k, v in kwargs.items()]
self.kwargs = kwargs
self.lcm = np.lcm.reduce(values)
self.eps = 1e-7
@ermish
ermish / codingguidelines.md
Last active July 4, 2021 11:58
a collection of coding guidelines/bestpractices/standards/goodthingstodo!

Coding Guidelines

Sass and html-y things

  • Don't use classes in html based on styles
    • i.e. instead of .table .table-lined .shift-right .moar-styling use user-table and use sass %placeholders instead.
  • Place @media queries within each related component
  • Use em's and rem's instead of px. (there's handy sass functions to convert px)
  • 99% of the time, avoid tables. instead, use divs to avoid the underlying styling challenges when using table.
  • Don't nest reusable styles in shared scss files. This makes it difficult to see the impact of what styles are inherited and forces the consumer to override unwanted nested styles.
@nathan-osman
nathan-osman / letsencrypt.go
Created April 20, 2017 02:22
Obtain a Let's Encrypt certificate from the ACME staging server using golang.org/x/crypto/acme
package main
import (
"context"
"crypto"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
@tduarte
tduarte / publish-ghpages.md
Last active October 2, 2024 10:14
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active October 26, 2024 16:38
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@djaiss
djaiss / gist:85a0ada83e6bca68e41e
Last active August 4, 2024 06:25
Block Twitter/Facebook in your /etc/hosts
# Block Facebook IPv4
127.0.0.1 www.facebook.com
127.0.0.1 facebook.com
127.0.0.1 login.facebook.com
127.0.0.1 www.login.facebook.com
127.0.0.1 fbcdn.net
127.0.0.1 www.fbcdn.net
127.0.0.1 fbcdn.com
127.0.0.1 www.fbcdn.com
127.0.0.1 static.ak.fbcdn.net
@0xabad1dea
0xabad1dea / severscam.md
Last active July 12, 2021 01:32
Sever Scam

The Scammiest Scam To Yet Anonymity Scam

I'm still holding out for this being a hoax, a big joke, and that they're going to cancel the kickstarter any minute. It'd be quite the cute "lessons learned" about anonymity scams. However, I will be treating it from here on out as a genuine scam. (As of May 2nd, the kickstarter has been cancelled, after the strangest attempt to reply to this imaginable. Good riddance.)

This absolutely ridiculous thing was brought to my attention by a friend and since it was late at night I thought I must be delirious in how absurdly over the top fake it seemed. So I slept on it, woke up, and found that it had gotten a thousand dollars more funding and was every bit as flabbergasting as I thought it was.

Since I realize that not everyone has spent their entire lives studying computers – and such people are the targets of such scams –

@abayer
abayer / jenkins-git-backup.sh
Last active July 16, 2024 17:17
Example of a script for backing up Jenkins config in git.
#!/bin/bash
#
# Copies certain kinds of known files and directories from a given Jenkins master directory
# into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em.
#
set -ex
if [ $# -ne 2 ]; then
echo usage: $0 root_dir jenkins_master