Skip to content

Instantly share code, notes, and snippets.

@alexnederlof
alexnederlof / selenium-start-stop.sh
Created November 20, 2012 19:49
Selenium start-stop script
#!/bin/bash
# Note that this script requires you to have
# an X window running on Display :90
# This can be done by running: /usr/bin/Xvfb :90 -ac -screen 0 1024x768x8 &
#
# You can save this script as /etc/init.d/selenium to start and stop selenium
PORT=4443
DESC="Selenium server"
@alexnederlof
alexnederlof / latex-hook.sh
Last active July 31, 2022 06:30
A hook to build your Latex files after every Git push.
#!/bin/sh
WEBDIR=yourwebdir
WORKSPACE=your/workspace
TEX_FILE_NAME=your_file
echo
echo "**** Pulling changes into Live [Hub's post-update hook]"
echo
@alexnederlof
alexnederlof / randomsites.sh
Last active December 15, 2015 00:58
Make list of random websites
#!/bin/bash
#
# This script will create a file with random URLs and a file with random domain names.
# It makes use of the site http://www.randomwebsite.com
#
# You should have curl and grep installed to run this.
SITES_FILE=sites.txt
SITES_NORMALIZED=sites_normalized.txt
@alexnederlof
alexnederlof / CacheAnnotations.java
Last active February 12, 2019 11:15
Jersey Cache-Header control via Annotations.
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
public final class CacheAnnotations {
/**
* Set the "Max-age" Cache header.
@alexnederlof
alexnederlof / Test.java
Created August 6, 2013 13:25
Crawljax setup with custom browser builder that sets a Cookie.
public class Test {
static class MyProvider implements Provider<EmbeddedBrowser> {
@Override
public EmbeddedBrowser get() {
EmbeddedBrowser browser2;
browser2 = newFireFoxBrowser();
return browser2;
}
@alexnederlof
alexnederlof / deploy.sh
Last active December 21, 2015 21:48
Automatic deployment of your latest Latex (or other) PDF to Amazon S3. The script adds the latest git describe output to the title so that if someone reviews and annotates it, you know which version it was.
#!/bin/bash
#####
#
# Deploy a PDF file annotated with the latest git version
# to your Amazon S3 bucket.
#
# This script requires you are running on a Mac with
# homebrew installed and a S3 bucket setup.
#
@alexnederlof
alexnederlof / watch.sh
Created September 6, 2013 09:04
Auto recompile Latex in the background on OS X
#!/bin/bash
###
# A Script that automatically recompiles your
# Latex in the background on Mac OS X.
###
# Options
BIN_PATH=/usr/texbin
FILE=thesis
WATCH_FILE=chapters

Keybase proof

I hereby claim:

  • I am alexnederlof on github.
  • I am alexnederlof (https://keybase.io/alexnederlof) on keybase.
  • I have a public key whose fingerprint is BDC4 6641 4245 59E6 A643 5B05 3F07 D02F 8650 B123

To claim this, I am signing this object:

@alexnederlof
alexnederlof / bar.yaml
Last active March 15, 2018 10:52
Local development with Kubernetes
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: bar
spec:
template:
metadata:
labels:
app: bar
spec:
@alexnederlof
alexnederlof / CloudFront.yaml
Last active June 27, 2020 07:57
Cloudformation template for S3, Cloudfront, Letsencrypt stack
# Deploy with
# aws cloudformation update-stack --stack-name your-static-site --template-body file://cloudfront.yaml
AWSTemplateFormatVersion: 2010-09-09
Description: Stack for static website hosting
Parameters:
IamCertificateId:
Type: String
Description: Use the ID from from the create-certificate.sh script
Default: xslidfjlskdfj