Skip to content

Instantly share code, notes, and snippets.

View martijngastkemper's full-sized avatar

Martijn Gastkemper martijngastkemper

View GitHub Profile
#!/bin/bash
#
# This script is an example for running Delft3D-FLOW
# Adapt and use it for your own purpose
#
# adri.mourits@deltares.nl
# 27 Dec 2010
#
#
# This script starts a single-domain Delft3D-FLOW computation on Linux
@martijngastkemper
martijngastkemper / build-delft3d.sh
Last active February 4, 2017 13:14
Script to build Delft3D with parallel computation Ubuntu Lucid (10.04). I tested it on AWS AMI "Ubuntu Server 14.04 LTS (HVM), SSD Volume Type - ami-f0b11187".
#!/bin/bash
# Sources:
# - http://content.oss.deltares.nl/delft3d/Webinar/Baart_LinuxCodeCompiling/WebinarBaart_11012012_v3.html
# - http://oss.deltares.nl/web/delft3d/general/-/message_boards/view_message/567530
sudo apt-get update
sudo apt-get install \
build-essential\
subversion\
@martijngastkemper
martijngastkemper / git.sh
Last active August 29, 2015 14:13
Checkout a tag or a branch.
# version=2.3.4
# version=master
if [ "`git tag -l $version`" == "" ]; then
git checkout -qf $version
git pull -q
else
versionRef=`git rev-list -n 1 $version`
git checkout -qf $versionRef
fi
@martijngastkemper
martijngastkemper / .bashrc
Last active January 22, 2016 13:15
Prevent "stdin: is not a tty" error
# .bashrc
# Prevent "stdin: is not a tty" error
# Put the following line at the top of .bashrc
[ -z "$PS1" ] && return
@martijngastkemper
martijngastkemper / gist:cfbed9fe9549a8b9556c
Last active August 29, 2015 14:13
Find all directories of a user and change the owner and group of that directory recursive.
find . -user userA -type d -exec chown -R userB:groupX {} +
@martijngastkemper
martijngastkemper / .htaccess
Created December 9, 2014 10:24
Some htaccess rules to block all traffic or traffic from a specific domain.
RewriteCond %{HTTP_REFERER} facebook.com [NC] # Optional: block only traffic from facebook.com
RewriteRule .* - [R=404] # Give all visitors a 404 response
@martijngastkemper
martijngastkemper / gist:e9bd5ef40cd233727427
Created November 10, 2014 09:41
Get commit hash of a branch or tag
git rev-list master | head -n 1
@martijngastkemper
martijngastkemper / domains-from-email.sql
Created November 3, 2014 16:35
A mysql query to group the domains in your list of e-mail addresses
SELECT
(substr( email, instr( email, '@') + 1)) as domain,
count(*) as total
FROM relations
GROUP BY domain
ORDER BY total DESC;
@martijngastkemper
martijngastkemper / gist:1d158066bbfb76fa0267
Last active August 29, 2015 14:07
Run KeePass 2 on Mac OS
brew install wine winetricks
winetricks dotnet20
wget http://keepass.info/download.html (Select KeePass 2 Portable version)
wine KeePass-2.28/KeePass.exe
@martijngastkemper
martijngastkemper / gist:87514efac2e004862c19
Created October 3, 2014 13:37
Update a Git tag and push that to origin.
# Steps
# 1. Remove tag
git tag -d TAGNAME
# 2. Push to origin
git push origin :refs/tags/TAGNAME
# 3. Create tag
git tag TAGNAME
# 4. Push to origin
git push origin