Skip to content

Instantly share code, notes, and snippets.

View guigo2k's full-sized avatar

Guigo2k guigo2k

View GitHub Profile
@guigo2k
guigo2k / wp-config.php
Last active August 29, 2015 14:22
Cannot redeclare wp_unregister_GLOBALS()
/* That's all, stop editing! Happy blogging. */
/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') ) {
define('ABSPATH', dirname(__FILE__) . '/');
}
/** Sets up WordPress vars and included files. */
if ( !defined('WP_CLI') ) {
require_once(ABSPATH . 'wp-settings.php');
@guigo2k
guigo2k / docker-installed.sls
Created June 23, 2017 13:16
Saltstack state for Docker on Debian/Ubuntu
docker-repository:
pkg.installed:
- pkgs:
- apt-transport-https
- ca-certificates
- curl
- software-properties-common
cmd.run:
- name: |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@guigo2k
guigo2k / grains.txt
Created July 6, 2017 20:00
non chat-pod grains/states
✖ support_portal
✖ proxy
✖ influxdb
✖ strongswan
✖ jmeter
✖ prosody
✖ jicofo
✖ tools
✖ jitsi-videobridge
✖ collaboration-nodejs-server
@guigo2k
guigo2k / parse_yaml.sh
Created December 6, 2017 19:16 — forked from pkuczynski/LICENSE
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@guigo2k
guigo2k / fix_github_https_repo.sh
Created February 14, 2018 19:27 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones to use SSH
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@guigo2k
guigo2k / php-fpm.conf
Created March 15, 2019 20:22
PHP-FPM config for Docker containers
[global]
pid = /tmp/php-fpm.pid
error_log = /proc/self/fd/2
log_limit = 8192
daemonize = no
[www]
listen = 9000
clear_env = no
access.log = /proc/self/fd/2