Skip to content

Instantly share code, notes, and snippets.

View harryfinn's full-sized avatar
:shipit:

Harry Finn harryfinn

:shipit:
View GitHub Profile
@harryfinn
harryfinn / installing-phpmyadmin-on-subdomain.md
Last active September 13, 2023 10:23
How to install PHPMyAdmin on a subdomain

Installing PHPMyAdmin on a subdomain

I was recently tasked with adding PHPMyAdmin to one of our LAMP servers for a 3rd party with little/no ssh knowledge to use in order to access the MySQL database(s). This gist documents how I configured PHPMyAdmin on the LAMP server on a subdomain with an SSL.

Prerequisites

Before following this guide, it is assumed that you already have a LAMP server up

@harryfinn
harryfinn / security.ubuntu.com-timeout-on-apt-get-update.md
Last active October 9, 2023 05:39
security.ubuntu.com timeout on apt-get update

security.ubuntu.com timeout on apt-get update

Issue

When running the apt-get update command, the process 'hangs' when checking security.ubuntu.com endpoints. This is apparantely due to an issue some sites face when trying to connect over IPv6 and whilst it is assumed that this will be fixed at some point in the future (sooner rather than later judging by the transition to IPv6 by most), the fix below resolves this issue, allowing the update process to complete successfully.

Fix

@harryfinn
harryfinn / letsencrypt-wordpress-setup.md
Last active November 12, 2023 10:21
Instructions on how to setup a Letsencrypt SSL certificate on a WordPress site

Letsencrypt (for WordPress sites)

Note: This setup assumes you are running Ubuntu 16.04 OS with Apache 2.4.23, older versions of Ubuntu (i.e. 14.04) require minor configuration changes in order for this setup to work.

Setup

Follow the install instructions for certbot (letsencrypt's SSL manager) on https://certbot.eff.org/, making sure to select the correct server OS version.

Note: You only need to complete the Install section, then return to this README in order to setup your SSL

@harryfinn
harryfinn / README.md
Last active August 8, 2016 16:39
WordPress helper class for building themes with Brunch support

WP Brunch

Usage

To use this file simply add this to your WordPress theme (in your includes folder or similar) then add the following to your functions.php file:

require_once(get_template_directory() . '/includes/class.wp-brunch.php');
@harryfinn
harryfinn / ubuntu16.04-lamp-nodejs-wp-cli.md
Last active May 17, 2022 14:12
Ubuntu 16.04: LAMP w/ NodeJS & WP-CLI

Ubuntu 16.04 LAMP w/ NodeJS & WP-CLI

Setup LAMP stack

Apache

apt-get update
apt-get install apache2
@harryfinn
harryfinn / wp_with_brunch.sh
Last active May 19, 2016 19:18
bash script to pull down wp-with-brunch framework files
#/bin/bash
function get_branch {
valid_branches=("theme" "component")
if `echo ${valid_branches[@]} | grep -qw "$1"`; then
echo "Branch selected: $1-framework"
git clone -b "$1-framework" git@github.com:1minus1limited/wp-with-brunch.git .
rm -rf .git .gitignore
@harryfinn
harryfinn / pagespeed-module.md
Last active July 21, 2023 05:06
Pagespeed module (Apache) instructions

Using Google Pagespeed module (Apache)

Install

Follow initial install instructions here

Recommended additional modules

Add the following to the bottom (but inside the <IfModule /> block) of /etc/apache2/mods-available/pagespeed.conf

@harryfinn
harryfinn / wp-cli-migrate-db.md
Created March 24, 2016 11:59
WP-CLI DB migrate instructions

Instructions for using WP-CLI to migrate a WordPress DB

# Export current (local) DB
wp db export db.sql

# Copy file from local to server (may need to amend server path if not in html folder)
# The example below is for local to remote, simply swap these 2 around for remote to local
scp -r db.sql www-data@IP_ADDRESS:/var/www/html

# SSH onto box (should be same connection details as above)
@harryfinn
harryfinn / jquery.isonscreen.js
Created February 17, 2016 09:33
isOnScreen jQuery plugin for check if given element is within the current viewport
(function($) {
$.fn.isOnScreen = function(x_offset, y_offset) {
if(x_offset == null || typeof x_offset == 'undefined') x_offset = 1;
if(y_offset == null || typeof y_offset == 'undefined') y_offset = 1;
var win = $(window),
viewport = {
top : win.scrollTop(),
left : win.scrollLeft()
},
@harryfinn
harryfinn / Preferences.sublime-settings
Created November 24, 2015 15:40
Sublime Text 3 - User settings
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/SublimeLinter/Material-Theme (SL).tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_options":
[
"gray_antialias"
],
"font_size": 14,