Skip to content

Instantly share code, notes, and snippets.

@waxpancake
waxpancake / ThinkUp on EC2 Ubuntu User-Data Script
Created January 4, 2011 04:29
Install script for non-interactively installing ThinkUp and prerequisites
#!/bin/bash -ex
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
# install ThinkUp on EC2 Ubuntu instance:
#
# @spara 12/23/10
# @waxpancake 1/3/11
# install required packages
sudo apt-get update
@bmchild
bmchild / CustomMethodSecurityExpressionHandler.java
Created January 19, 2012 21:15
Custom regex lookup access Expression with Spring Security 3.1. The lookup, hasRegexRole, is available on the JSP or on the method.
package com.bmchild.security.access.expression;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.log4j.Logger;
import org.springframework.security.access.expression.SecurityExpressionRoot;
import org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler;
import org.springframework.security.core.Authentication;
/**
* @author bchild
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@willurd
willurd / web-servers.md
Last active June 13, 2024 14:37
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
sudo apt-get -y install build-essential devscripts quilt
sudo apt-get -y build-dep openssl
apt-get source openssl
cd openssl-*
quilt pop -a # This removes updates
vi debian/patches/series # Remove no-ssl2.patch
vi debian/rules # Remove no-ssl2 in args
quilt push -a # Re-applies the updates
dch -n 'Allow dangerous v2 protocol'
dpkg-source –commit
sudo apt-get -y install build-essential devscripts quilt nano
sudo apt-get -y build-dep openssl
apt-get source openssl
cd openssl-*
nano debian/rules # Remove no-ssl2 in args
dch -n 'Allow dangerous v2 protocol'
dpkg-source –commit
debuild -uc -us
sudo dpkg -i ../*ssl*.deb
@gokulkrishh
gokulkrishh / media-query.css
Last active June 16, 2024 12:26
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@cludden
cludden / howto-installing-vault-on-aws-linux.md
Created February 3, 2016 00:30
HOWTO: Installing Vault on AWS Linux

HOWTO: Installing Vault On AWS Linux

This is quick howto for installing vault on AWS Linux, mostly to remind myself. At the end of this tutorial, you'll have a working vault server, using s3 for the backend, self signed certificates for tls, and supervisord to ensure that the vault server is always running, and starts on reboot.

Setting up S3

First things first, let's set up an s3 bucket to use as the storage backend for our s3 instance.

  1. From the AWS Mangement Console, go to the S3 console.

  2. Click on the Create Bucket button

@clems4ever
clems4ever / custom-chain-enforcement.service
Last active July 18, 2019 17:49
docker-swarm iptables FORWARD custom chain enforcement
[Unit]
Description=Public filter enforcement Service
[Service]
Type=simple
ExecStart=/home/user/custom-chain-enforcement.sh
KillMode=mixed
TimeoutStartSec=0
RestartSec=0
@delfuego
delfuego / docker-block-enforcement.sh
Last active March 5, 2017 03:05 — forked from clems4ever/custom-chain-enforcement.service
docker-swarm iptables FORWARD custom chain enforcement
#!/bin/bash
CUSTOM_CHAIN=DOCKER-BLOCK
DELAY=10
NEW_RULE="-o docker0 -j ${CUSTOM_CHAIN}"
chain_exists()
{
[ $# -lt 1 -o $# -gt 2 ] && {
echo "Usage: chain_exists <chain_name> [table]" >&2