Skip to content

Instantly share code, notes, and snippets.

Avatar

Alex Nederlof alexnederlof

View GitHub Profile
@alexnederlof
alexnederlof / selenium-start-stop.sh
Created Nov 20, 2012
Selenium start-stop script
View selenium-start-stop.sh
#!/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 May 17, 2021
A hook to build your Latex files after every Git push.
View latex-hook.sh
#!/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 Dec 15, 2015
Make list of random websites
View randomsites.sh
#!/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 Feb 12, 2019
Jersey Cache-Header control via Annotations.
View CacheAnnotations.java
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 Aug 6, 2013
Crawljax setup with custom browser builder that sets a Cookie.
View Test.java
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 Dec 21, 2015
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.
View deploy.sh
#!/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 Sep 6, 2013
Auto recompile Latex in the background on OS X
View watch.sh
#!/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
View keybase.md

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 Mar 15, 2018
Local development with Kubernetes
View bar.yaml
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: bar
spec:
template:
metadata:
labels:
app: bar
spec:
@alexnederlof
alexnederlof / CloudFront.yaml
Last active Jun 27, 2020
Cloudformation template for S3, Cloudfront, Letsencrypt stack
View CloudFront.yaml
# 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