Skip to content

Instantly share code, notes, and snippets.

View masterxavierfox's full-sized avatar
✌️

Xavier Fox masterxavierfox

✌️
View GitHub Profile
@masterxavierfox
masterxavierfox / wp-config.php
Created September 27, 2016 10:05
WordPress: Set WordPress site URL in the config file instead of the database
<?php
// WordPress stores the site URL in the database by default (which I have never
// understood), and it's a pain to have to type out the UPDATE SQL or search in
// phpMyAdmin to change it. This is a simple way to put the URL into
// wp-config.php instead.
// Note that you will still need to update any URLs that appear in the content,
// especially when you copy a database from a development site to production:
// https://gist.github.com/davejamesmiller/a8733a3fbb17e0ff0fb5
@masterxavierfox
masterxavierfox / nginx.conf
Last active September 27, 2016 10:31
Nginx Reverse Proxy Configuration
upstream lucky {
server xfssvsd.co.ke:443;
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl_certificate /etc/nginx/ssl/xfssvsd.co.ke/fullchain.pem;
ssl_certificate_key /etc/nginx/ssl/xfssvsd.co.ke/privkey.pem;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
<?php
global $post;
$author_id=$post->post_author;
?>
<?php
/* You can also use one of these instead:
- nickname
- user_nicename
- display_name
@masterxavierfox
masterxavierfox / ssh-key-login
Created March 14, 2017 11:00
Add ssh key to remote server
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host
@masterxavierfox
masterxavierfox / codedeploy.sh
Last active March 22, 2017 09:58
Aws code Deploy Agent Install
#!/bin/bash/
#To run:
# bash -c "$(curl -fsSL https://ADD-RAW-URL-HERE)"
#Go to the following Resource URL
#http://docs.aws.amazon.com/codedeploy/latest/userguide/how-to-run-agent-install.html
#For Ubuntu:
sudo apt-get update -y
@masterxavierfox
masterxavierfox / install
Created May 6, 2017 20:37
Super Desk Install Script
#!/bin/bash
# NOTE: This file is generated by script.
# Modify "tpl/*" and run "./fire gen-files"
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -exuo pipefail
export DEBIAN_FRONTEND=noninteractive
export DBUS_SESSION_BUS_ADDRESS=/dev/null

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@masterxavierfox
masterxavierfox / tmux.cheat
Created July 25, 2017 08:30 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@masterxavierfox
masterxavierfox / varnish
Created July 25, 2017 12:01 — forked from reifman/varnish
Example Varnish configuration file e.g. /etc/default/varnish
# Configuration file for varnish
#
# /etc/init.d/varnish expects the variables $DAEMON_OPTS, $NFILES and $MEMLOCK
# to be set from this shell script fragment.
#
# Should we start varnishd at boot? Set to "no" to disable.
START=yes
# Maximum number of open files (for ulimit -n)