Skip to content

Instantly share code, notes, and snippets.

@ooola
ooola / Download-Slack-Profile-Pictures.js
Created August 29, 2023 16:52 — forked from caseywatts/Download-Slack-Profile-Pictures.js
Download Slack Profile Pictures / Images
// 1. Navigate to the Members View
// Enter slack in the browser. https://{insert your team name here}.slack.com/messages/
// Click on the channel you want.
// Click the information icon.
// Expand the members dropdown.
// Click "See All Members"
// 2. Run JS Code To Start
// Copy-paste this whole thing
# Ola's ~/.tmux.conf
#
# This config file was originally based on the tmux config that ships with tmux.
# See https://github.com/tmux/tmux/blob/master/example_tmux.conf
#
# It has been modified so that the prefix is <Ctrl>-a and the CapsLock
# key also acts as a Ctrl via an OS keymap change.
#
# On OS X be sure to install 'reattach-to-user-namespace' via brew.
@ooola
ooola / dual-csps.go
Created January 27, 2023 02:00
Dual CSP - A small go program showing that a report-only CSP does not impact an enforced content security policy (CSP
package main
import (
"fmt"
"net/http"
)
func serve(w http.ResponseWriter, req *http.Request) {
page := `
<!doctype html>
// Copyright (c) 2020 Andrew Ayer
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included
@ooola
ooola / dummy-web-server.py
Created October 25, 2017 16:42 — forked from bradmontgomery/dummy-web-server.py
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python.
Usage::
./dummy-web-server.py [<port>]
Send a GET request::
curl http://localhost
package main
import (
"math/rand"
"time"
"fmt"
)
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
package main
import (
"fmt"
"net/http"
"net/http/httputil"
)
func handler(w http.ResponseWriter, r *http.Request) {
requestDump, err := httputil.DumpRequest(r, true)
@ooola
ooola / password_strength.md
Created December 28, 2016 18:32 — forked from atoponce/password_strength.md
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
@ooola
ooola / latency.txt
Created December 28, 2016 18:31 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
#!/bin/sh
#
# This script finds and prints authorized SSH public keys in LDAP for the
# username specified as the first argument. The SSH public key read from the
# streetAddress field.
#
# The program must be owned by root and not writable by group or others.
# It expects configuration file /etc/ssh/ldap.conf in format of ldap.conf(5).
#
# sshd_config for OpenSSH 6.2+: