Skip to content

Instantly share code, notes, and snippets.

@lukearmstrong
lukearmstrong / csr.sh
Created June 21, 2017 13:31
Generate CSR (Certificate Signing Request) and new Private Key
openssl req -nodes -newkey rsa:2048 -sha512 -keyout myserver.key -out server.csr
@lukearmstrong
lukearmstrong / wp-config.php
Created May 22, 2017 10:10
Disable WordPress Updates
if (ENVIRONMENT != 'development') {
define('AUTOMATIC_UPDATER_DISABLED', true); // Disable Automatic Updates
define('WP_AUTO_UPDATE_CORE', false); // Disable WordPress Core Automatic Updates
define('DISALLOW_FILE_EDIT', true); // Disable the Plugin and Theme Editor
define('DISALLOW_FILE_MODS', true); // Disable Wordpress, Plugin and Theme Installation and Updates
}
@lukearmstrong
lukearmstrong / verify-ssl-certificates.sh
Created May 17, 2017 09:32
Verify SSL Certificates
openssl x509 -noout -modulus -in certificate.crt | openssl md5
openssl rsa -noout -modulus -in private-key.key | openssl md5
openssl req -noout -modulus -in certificate-signing-request.csr | openssl md5
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document id="Warwickshire_Ring_New" xsi:schemaLocation="http://www.opengis.net/kml/2.2 http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd http://www.google.com/kml/ext/2.2 http://code.google.com/apis/kml/schema/kml22gx.xsd">
<name>Warwickshire_Ring_New</name>
<Snippet maxLines="0"></Snippet>
<Style id="LineStyle01">
<LabelStyle>
<color>00000000</color>
<scale>0</scale>
</LabelStyle>
@lukearmstrong
lukearmstrong / varnish.sh
Created March 23, 2017 15:54
Apt: Specific Version of Package
# Install a specific version of Varnish
sudo apt-get install varnish=3.0.5-2
# Ensure Package cannot be updated
sudo apt-mark hold varnish
@lukearmstrong
lukearmstrong / holland.sh
Created March 23, 2017 14:51
Install Holland
# Download and Setup Key
wget http://download.opensuse.org/repositories/home:/holland-backup/xUbuntu_14.04/Release.key -O - | sudo apt-key add -
# Add Repo
sudo echo 'deb http://download.opensuse.org/repositories/home:/holland-backup/xUbuntu_14.04/ ./' > /etc/apt/sources.list.d/holland.list
# Install Holland
sudo apt-get update && sudo apt-get install holland-common holland-mysqldump
@lukearmstrong
lukearmstrong / gist:6487b08dfd64aee90ee8
Created December 27, 2014 18:34
Is there a better way of setting the value of a field on a form shared with create/edit views using Laravel 5?
<input type="text" name="forename" class="form-control" id="forename" value="{{ ! is_null(old('forename')) ? old('forename') : (isset($model->forename) ? $model->forename : '') }}" />
@lukearmstrong
lukearmstrong / app.less
Created December 11, 2014 21:11
Sass seemed a bit slow, so just out of curiosity I tried using Less instead.
@import '../../../bower_components/bootstrap/less/bootstrap.less';
var elixir = require('laravel-elixir');
/*
|--------------------------------------------------------------------------
| Elixir Asset Management
|--------------------------------------------------------------------------
|
| Elixir provides a clean, fluent API for defining some basic Gulp tasks
| for your Laravel application. By default, we are compiling the Sass
| file for our application, as well as publishing vendor resources.
@lukearmstrong
lukearmstrong / output
Created September 25, 2014 18:57
shellshock
luke@samsung:~$ env X="() { :;} ; echo busted" /bin/sh -c "echo completed"
completed
luke@samsung:~$ env X="() { :;} ; echo busted" `which bash` -c "echo completed"
busted
completed
luke@samsung:~$ sudo apt-get update && sudo apt-get upgrade -y
...
...
...
luke@samsung:~$ env X="() { :;} ; echo busted" /bin/sh -c "echo completed"