Skip to content

Instantly share code, notes, and snippets.

@btoueg
btoueg / main.py
Last active February 24, 2023 07:30
An example of symmetric encryption in python 2.7 using a single known secret key - utilizes cryptography library
# -*- encoding: utf-8 -*-
import os
import base64
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.backends import default_backend
backend = default_backend()
secret_key = base64.b64decode(
# generated randomly once, kept secret
@bmaupin
bmaupin / open-source-sso.md
Last active April 11, 2024 09:36
Comparison of some open-source SSO implementations

ⓘ This list is not meant to be exhaustive and is not guaranteed to be maintained. See the comments for updates and alternative options.

(Items in bold indicate possible concerns)

Keycloak WSO2 Identity Server Gluu CAS OpenAM Shibboleth IdP
OpenID Connect/OAuth support yes yes yes yes yes yes
Multi-factor authentication yes yes yes yes yes yes
Admin UI yes yes yes yes yes no
OpenJDK support yes yes partial² yes
@tcotav
tcotav / dotbashrc.sh
Created March 31, 2017 16:08
dot-bashrc set kubernetes kubeconfig on login
#!/bin/bash
# add this to users .bashrc file -- remove the #!/bin/bash
#
# script that prompts user on login to select a kubernetes cluster as their current
#
# - we set an alias for kubectl which is kubectl --kubeconfig=<some config>
# - we create a different kubeconfig file in .kube for each context
#
declare -a KUBE_CONFIG_FILES
@pavgup
pavgup / gist:a5ddb047df6669e138cf
Created March 8, 2015 02:37
Python-poker-network alternative installation on Ubuntu 14.04.1 (and 14.04.2) LTS
# Tried this on an AWS EC2 Ubuntu 14.04.1 (and a dist-upgraded 14.04.2) 64 bit VM
# This is nothing more than a copy and paste thing you can do as ubuntu to get up and running.
# It's definitely not efficient at this point, feel free to make more efficient
sudo apt-get -y update;
sudo echo mysql-server-5.5 mysql-server/root_password password abc123 | sudo debconf-set-selections;
sudo echo mysql-server-5.5 mysql-server/root_password_again password abc123 | sudo debconf-set-selections;
sudo apt-get -y install build-essential checkinstall git-core mysql-server \
python-pip python-twisted python-mysqldb \
python-mysqldb-dbg memcached python-memcache \
python-simplejson python-cjson python-cjson-dbg \
@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@christopheranderton
christopheranderton / homebrew-github-api-token.md
Last active January 2, 2024 13:07
Set your Github API Token If you hit a ”GitHub API rate limit exceeded” when searching with Homebrew (http://brew.sh/).

Description

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS
When using Homebrew (http://brew.sh) and searching formulas or pull requests you may get the dreaded error message: Github API Rate limit exceeded

Let's fix that! (yeah!)


Short version

PLEASE SCROLL DOWN AND READ THE COMMENTS FOR A MORE UP TO DATE WAY (AND EASIER) TO DO THIS

@millermedeiros
millermedeiros / osx_setup.md
Last active May 7, 2024 08:01
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@P7h
P7h / IntelliJ_IDEA__Perf_Tuning.txt
Last active March 22, 2024 20:18
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2048m
-Xmx2048m
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark