Skip to content

Instantly share code, notes, and snippets.

Avatar

Nicholas Thompson njt1982

View GitHub Profile
@njt1982
njt1982 / phpbrew.sh
Last active Mar 21, 2020
Building PHP 5.6 and 7.x on OSX Mojave and Catalina (with Homebrew for dependencies)
View phpbrew.sh
# Switch out 5.6 for required version
phpbrew install -j $(nproc) 5.6 +default +mysql +fpm +gd \
+bz2="$(brew --prefix bzip2)" \
+curl="$(brew --prefix curl-openssl)" \
+zlib="$(brew --prefix zlib)"
# PHP 7.2 needed some tweaks (the mirror and the X11 thing (which helps GD compile))
@njt1982
njt1982 / log_since_last_tag
Created Apr 24, 2017
Git Log Since Lat Tag
View log_since_last_tag
#!/bin/bash
if [ -z "$1" ]
then
TAG=$(git describe --abbrev=0 --tags)
else
TAG="$1"
fi
if [ -z "$2" ]
then
@njt1982
njt1982 / # percona-server - 2016-12-19_13-11-47.txt
Created Dec 19, 2016
percona-server on macOS 10.11.6 - Homebrew build logs
View # percona-server - 2016-12-19_13-11-47.txt
Homebrew build logs for percona-server on macOS 10.11.6
Build date: 2016-12-19 13:11:47
@njt1982
njt1982 / dump.sql
Last active Jun 12, 2016
Stock Drupal 7.43 SQL Dump
View dump.sql
-- MySQL dump 10.13 Distrib 5.7.11-4, for osx10.11 (x86_64)
--
-- Host: localhost Database: drupal_d7
-- ------------------------------------------------------
-- Server version 5.7.11-4
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
View Simple Drush Make File
# See: https://github.com/drush-ops/drush/blob/master/examples/example.make.yml
core: "7.x"
api: 2
projects:
drupal:
version: ~
defaults:
@njt1982
njt1982 / gist:dd1c533142639aed7d25
Created Mar 18, 2015
VarnishADM Reload helper
View gist:dd1c533142639aed7d25

Basically:

  • Switch to a different conf (you cannot discard / reload an active conf)
  • Discard it
  • Reload it into a name
  • Use that name
vcl.use boot
vcl.discard reload01
@njt1982
njt1982 / clean-settings.sh
Created Jan 7, 2015
Drupal - Make Clean Settings.php file
View clean-settings.sh
#!/bin/sh
grep -vE '^(#|\/| \*)' default.settings.php | sed '/^\s*$/d' > settings.php
@njt1982
njt1982 / Borked Internet
Created Oct 26, 2014
Pings aren't great...
View Borked Internet
$ ping google.co.uk
PING google.co.uk (74.125.230.127): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
64 bytes from 74.125.230.127: icmp_seq=1 ttl=54 time=4025.251 ms
64 bytes from 74.125.230.127: icmp_seq=2 ttl=54 time=3040.001 ms
64 bytes from 74.125.230.127: icmp_seq=3 ttl=54 time=2103.742 ms
@njt1982
njt1982 / keybase.md
Created Oct 20, 2014
KeyBase.io proof
View keybase.md

Keybase proof

I hereby claim:

  • I am njt1982 on github.
  • I am njt1982 (https://keybase.io/njt1982) on keybase.
  • I have a public key whose fingerprint is 907A 2485 7EF0 D11C F390 FF7E 4C6F CE31 94FB E84B

To claim this, I am signing this object:

@njt1982
njt1982 / ipwatcher.sh
Created Mar 18, 2014
Domain IP Watcher
View ipwatcher.sh
#!/bin/sh
if [ $# -lt 1 ]; then
echo "USAGE: $0 [domain.com]"
exit 1
fi
DOMAIN=$1
INITIAL=$(dig $DOMAIN | grep -E 'IN.+A.+.+' | awk '{print $5}')
echo "Initial IP = $INITIAL"
You can’t perform that action at this time.