Skip to content

Instantly share code, notes, and snippets.

Avatar
👍

Drawcard drawcard

👍
  • Drawcard
  • Australia
View GitHub Profile
@drawcard
drawcard / random-troubleshooting-zsh.md
Last active Apr 23, 2020
Random troubleshooting - ZSH
View random-troubleshooting-zsh.md

ZSH

Insecure directories and files warning

zsh compinit: insecure directories and files, run compaudit for list.                                                                                                                                
Ignore insecure directories and files and continue [y] or abort compinit [n]? y

Fix this by running

@drawcard
drawcard / wp-cli-migrate.md
Created Feb 25, 2020
Manually migrate production WP DB to local environment, using WP CLI
View wp-cli-migrate.md

This guide assumes you’re using https://localwp.com for your local environment.

Pull DB from the production server

  • wp db export ~/.mysqldump/wp_transfer.sql

Transfer DB from the production server to local

  • Connect to server via FTP
  • Transfer ~/.mysqldump/wp_transfer.sql to your desktop
@drawcard
drawcard / mc-server-setup.md
Last active Nov 13, 2018 — forked from niksudan/mc-server-setup.md
How to create a new Minecraft Server with DigitalOcean
View mc-server-setup.md

Creating a new Minecraft Server

Setup

Create a new Ubuntu 16.04 droplet on DigitalOcean. Make sure it has at least 2GB of RAM, and you provide it with your SSH key.

SSH into the server and install Java, which is required for Minecraft to run.

View wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
View wp.sh
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Do you need to setup new MySQL database? (y/n)"
read -e setupmysql
if [ "$setupmysql" == y ] ; then
echo "MySQL Admin User: "
read -e mysqluser
@drawcard
drawcard / glyphs-font-design-process.md
Last active Jul 3, 2017
Glyphs Font Design Process
View glyphs-font-design-process.md

Font Design Process - Glyphs

For drawing a complete sans-serif Latin Alphabet

Initial Setup

  • Preferences > Addons > Modules > Install Modules
  • Start with Regular font master
  • Font Info > Masters > Metrics: Set values for each of these (or use / slightly adjust the defaults)

General approach

@drawcard
drawcard / woocommerce-update-old-overrides.md
Last active May 7, 2017
WooCommerce - Updating old theme override files to latest version
View woocommerce-update-old-overrides.md

The Problem

Let's say you've inherited a theme from a client that some other developer made a long time ago, and your job is to update the code and figure out what stays and what doesn't.

Occassionally WC will update its core template library and this will get out of sync with any overrides in a given theme's /woocommerce/ folder. WC will send an alert in the WP backend that various templates are out of date and need updating. The theme will need its override files updated.

(Version examples for this demo: 2.1.1 is old, 3.0.0 is latest)

Identification

Go to https://xxxxxxx.zzz/wp-admin/admin.php?page=wc-status and scroll to Templates to see what files are problematic.

@drawcard
drawcard / wp-setup-management-2017.md
Last active Mar 21, 2017
Wordpress Setup & Management 2017
View wp-setup-management-2017.md

WP-CLI Stuff

Handy Shortcuts

Search & Replace Database

### Remove "dry-run" to write the changes to the DB! 
### Run "wp db export" to back up DB first!

DO NOT BLINDLY COPY AND PASTE THESE, CHANGE THE DIRECTORY PATHS IN THEM FIRST!
@drawcard
drawcard / setup_mailcatcher.sh
Last active Feb 9, 2017 — forked from shark0der/setup_mailcatcher.sh
Mailcatcher installation script for Ubuntu 16.04 (14.04 commands commented out)
View setup_mailcatcher.sh
#!/bin/bash
# Install dependencies
# older ubuntus
#apt-get install build-essential libsqlite3-dev ruby1.9.1-dev
# xenial
apt install build-essential libsqlite3-dev ruby-dev
# Install the gem
# gem install mailcatcher
@drawcard
drawcard / backup.sh
Last active Feb 7, 2017 — forked from codeablehq/backup.sh
A script that creates a backup of your WordPress site and uploads it to Dropbox
View backup.sh
#!/bin/bash
# For this script to work, save it somewhere in the executable path, like /usr/local/sbin/backup.sh
# make it executable: chmod +x /usr/local/sbin/backup.sh
# then add it to cron: crontab -e
# and add the line below, which will run backup 3am each day, then upload to Dropbox
# 0 3 * * * /usr/local/sbin/backup.sh > /dev/null 2>&1
# You also need WP CLI installed: http://wp-cli.org/