Skip to content

Instantly share code, notes, and snippets.

Brandon Simpson brandonsimpson

View GitHub Profile
@brandonsimpson
brandonsimpson / ssh_login_private_keys.md
Last active Aug 29, 2015
Passwordless SSH logins with private key authentication
View ssh_login_private_keys.md

###Passwordless SSH logins with private key authentication

  1. On local machine, create your ssh key files

    Run ssh-keygen -t rsa as your local user, and allow all defaults and no password. This will create your private key associated with your computer and a public key (~/.ssh/id_rsa.pub) file to be shared later.

  2. Login to remote server and make sure RSA Authentication and Public Key Authentication is on

$ ssh user@remotehost

@brandonsimpson
brandonsimpson / vmware_tools_centos.md
Last active Aug 29, 2015
Install / Update VMware Tools on CentOS
View vmware_tools_centos.md

Install / Update VMware Tools on CentOS

  1. Create yum repo config file

    sudo vi /etc/yum.repos.d/vmware-tools.repo
    

    Add these config settings, and save file.

@brandonsimpson
brandonsimpson / py_git_updater.py
Created Jun 8, 2014
Python git auto pull for multiple development site virtual hosts
View py_git_updater.py
#!/usr/bin/env python
import os
import grp
import pwd
import subprocess
# update these settings to match your server settings
vhost_directory = '/home/' # cpanel uses /home - most linux servers use a variation of /var/www/vhosts
git_pull_command = 'git pull origin dev --quiet' # set to your preferred git pull command, and what branch to pull
show_all_output = True
@brandonsimpson
brandonsimpson / osx_cleardns_alias.md
Last active Aug 29, 2015
Flush and Reset All DNS Caches in OS X Yosemite
View osx_cleardns_alias.md

###Flush and Reset All DNS Caches in OS X Yosemite

Quickly clear all dns caches in OS X Yosemite with this bash alias.

  1. Edit your local ~/.bash_profile and add the following alias:
alias cleardns="sudo discoveryutil mdnsflushcache; sudo discoveryutil udnsflushcaches; sudo discoveryutil udnscachestats; sudo discoveryutil mdnscachestats;"
  1. Make sure to reload your bash profile (or restart your terminal):
@brandonsimpson
brandonsimpson / nginx_timed_combined.md
Created Apr 23, 2015
Nginx multi-host combined access log format
View nginx_timed_combined.md

###Nginx multi-host combined access log format

Log multiple hosts with gzip compression and request time data.

From /etc/nginx/nginx.conf:

log_format timed_combined '$remote_addr - $remote_user [$time_local]  '
	'$host "$request" $status $body_bytes_sent '
	'"$http_referer" "$http_user_agent" "$gzip_ratio" ($request_time)';
@brandonsimpson
brandonsimpson / vhost1
Last active Aug 29, 2015
Nginx php5-fpm Symfony2 app server config
View vhost1
server {
listen 80;
server_name symfony.dev;
root /var/www/vhosts/symfony.dev/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
@brandonsimpson
brandonsimpson / vagrant-ubuntu-trusty64-mariadb-my.cnf
Created May 25, 2015
vagrant-ubuntu-trusty64-mariadb-my.cnf
View vagrant-ubuntu-trusty64-mariadb-my.cnf
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user = mysql
@brandonsimpson
brandonsimpson / jira_cacert.md
Created Jun 8, 2014
Add ssl cacert for a secure mail server to Jira
View jira_cacert.md

Add ssl cacert for a secure mail server to Jira

  1. Login as root and create directory for mail server files to be created. Rename "mail.mailserver.com" for your mail server you're trying to connect to.

    mkdir ~/mail.mailserver.com
    cd ~/mail.mailserver.com
    
  2. Get certificate file contents from mail server on port 995:

@brandonsimpson
brandonsimpson / ubuntu-php5-fpm-phalcon.md
Last active Aug 14, 2016
Ubuntu 14.04 (Trusty) php5-fpm PhalconPHP install
View ubuntu-php5-fpm-phalcon.md

Ubuntu 14.04 (Trusty) php5-fpm PhalconPHP install

Optional - add repo for php 5.6.8

sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
@brandonsimpson
brandonsimpson / sync_mysql.sh
Created Jun 8, 2014
Quickly Dump + Backup + Sync MySQL tables between servers via command line
View sync_mysql.sh
#!/bin/bash
# sync mysql tables from dev server to production server quickly via command line
# specify the list of tables to sync below
dev_host="127.0.0.1"
dev_user="root"
dev_pass="K#oDAk6AF@GumR7"
dev_db_name="local_dev"
You can’t perform that action at this time.