Skip to content

Instantly share code, notes, and snippets.

Peter Ansell ansell

Block or report user

Report or block ansell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ansell
ansell / install-java.sh
Created Aug 14, 2019 — forked from paul-nelson-baker/install-java.sh
HomeBrew Revert to Java8 from Java9
View install-java.sh
#!/usr/bin/env bash
set -e
# Uninstall Java 9 off the bat, so we can fix our local installation
if brew cask ls --versions "java" &>/dev/null; then
echo "Uninstalling Java"
brew cask uninstall java
fi
# Install jenv, java8 and java9
brew install jenv
brew cask install caskroom/versions/java8
@ansell
ansell / solr-filter.conf
Created Apr 18, 2019 — forked from sebnmuller/solr-filter.conf
Logstash config for ingesting Solr logs
View solr-filter.conf
input {
file {
path => "/Users/sebastienmuller/comperio/projects/sintef/tmp/logs/indexing_logs_2/solr.log.3"
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
filter {
# Extract event severity and timestamp
@ansell
ansell / gist:3f40f066b76a1df7ab849cc695bdfa91
Last active Jun 1, 2018 — forked from MikeSchuette/gist:c70d195c5c5670d1625f
Shell one-liner to parse apache access logs and extract a unique URL list with hit count, querystring excluded.
View gist:3f40f066b76a1df7ab849cc695bdfa91
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sed 's/\?.*//g' | sort | uniq -c | sort -rn > url_hits.txt
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' | sort | uniq -c | sort -rn > url_with_paths_hits.txt
cat access.log | awk -F\" '{print $2}' | awk '{print $2}' | sed '/^$/d' > raw_url_with_paths.txt
@ansell
ansell / use-sshuttle.sh
Last active Mar 3, 2018
sshuttle usage
View use-sshuttle.sh
#!/bin/bash
set -e
VIRTUAL_ENV_DIR="${HOME}/python-virtualenvironments/sshuttle"
GITREPOS_DIR="${VIRTUAL_ENV_DIR}/gitrepos"
SSHUTTLE_REPO="${GITREPOS_DIR}/sshuttle"
# Set these to match your server
TUNNEL_USER="${USER}"
@ansell
ansell / disable.sh
Last active Jun 16, 2019 — forked from pwnsdx/disable.sh
Disable bunch of services in Sierra (Version 2.1)
View disable.sh
#!/bin/bash
# Source: https://gist.github.com/pwnsdx/d87b034c4c0210b988040ad2f85a68d3
# IMPORTANT: You will need to disable SIP aka Rootless in order to fully execute this script, you can reenable it after.
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@ansell
ansell / .bashrc
Created Nov 1, 2017
bash aliases
View .bashrc
alias mci="mvn clean install"
alias mcist="mvn clean install -DskipTests"
alias mcd="mvn clean deploy"
alias mcd-sonatype="mvn clean deploy -Psonatype-oss-release"
alias gfa="git fetch --all"
alias gmff="git merge --ff-only"
View gist:b11a19f4f4a1a0246715e1ce37b6bdbe
### Keybase proof
I hereby claim:
* I am ansell on github.
* I am ansell (https://keybase.io/ansell) on keybase.
* I have a public key whose fingerprint is 9CFB AB43 0420 9E65 7781 6FBE 85D7 0B38 FE3F 41A1
To claim this, I am signing this object:
@ansell
ansell / fix-virtualbox.sh
Last active Jul 13, 2016
Mint-18 VirtualBox fix
View fix-virtualbox.sh
#!/bin/sh
sudo apt-get purge virtualbox-guest-*
sudo apt-get install virtualbox-guest-*
sudo usermod -a -G vboxsf "${USER}"
# NOTE: Cannot use virtualbox guest utils as they add a requirement on Upstart when Ubuntu decided to follow the crowd and downgrade to systemd
@ansell
ansell / howto_gis_ubuntu.md
Last active Feb 14, 2019
Ubuntu-18.04/Mint-18 GIS hackery
View howto_gis_ubuntu.md

Add ubuntugis PPA:

$ sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'

Add POSTGIS repository:

@ansell
ansell / install_postgresql9.4_postgis2.1_ubuntu.md
Last active Feb 26, 2019 — forked from hewerthomn/install_postgresql9.3_postgis2.1_ubuntu.md
Installing PostgreSQL 9.4 and PostGIS on Ubuntu 14.04
View install_postgresql9.4_postgis2.1_ubuntu.md

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
You can’t perform that action at this time.