Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Shhh...

Ryan Sechrest ryansechrest

:octocat:
Shhh...
View GitHub Profile
@ryansechrest
ryansechrest / sshd_config
Created Mar 21, 2014
Default sshd configuration file.
View sshd_config
# $OpenBSD: sshd_config,v 1.80 2008/07/02 02:24:18 djm Exp $
# This is the sshd server system-wide configuration file. See
# sshd_config(5) for more information.
# This sshd was compiled with PATH=/usr/local/bin:/bin:/usr/bin
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options change a
@ryansechrest
ryansechrest / httpd.conf
Created Mar 21, 2014
Default httpd configuration file.
View httpd.conf
#
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html>
# for a discussion of each configuration directive.
#
#
# Do NOT simply read the instructions in here without understanding
@ryansechrest
ryansechrest / server.md
Created Feb 19, 2014
Base server setup and configuration.
@ryansechrest
ryansechrest / html-style-guide.md
Last active Feb 7, 2021
HTML style guide with coding standards and best practices.
View html-style-guide.md

HTML Style Guide

All rules and guidelines in this document apply to HTML files.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Icon Legend:

· Space, Tab, Enter/Return

@ryansechrest
ryansechrest / .htaccess
Last active Apr 20, 2020
Sample configuration files for WordPress as Git submodule.
View .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Prevent requests to index.php from being rewritten
RewriteRule ^index\.php$ - [L]
# Prefix specified PHP files with 'wordpress'
RewriteRule ^((wp-login|xmlrpc)\.php) wordpress/$1 [R=301,L]
@ryansechrest
ryansechrest / php-style-guide.md
Last active Feb 26, 2021
PHP style guide with coding standards and best practices.
View php-style-guide.md

PHP Style Guide

All rules and guidelines in this document apply to PHP files unless otherwise noted. References to PHP/HTML files can be interpreted as files that primarily contain HTML, but use PHP for templating purposes.

The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.

Most sections are broken up into two parts:

  1. Overview of all rules with a quick example
  2. Each rule called out with examples of do's and don'ts
@ryansechrest
ryansechrest / vagrant.md
Last active Jan 27, 2019
Various cheat sheets for systems like Vagrant, Puppet, MySQL, etc.
View vagrant.md

Initialize

vagrant init [box-name] [box-url] — Add box and initialize VM

CentOS 6.5 box with Puppet:

vagrant init centos65p http://puppet-vagrant-boxes.puppetlabs.com/centos-65-x64-virtualbox-puppet.box

CentOS 6.5 box without Puppet:

vagrant init centos65 https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box

@ryansechrest
ryansechrest / server-to-localhost.sh
Created Dec 23, 2013
Bash script to synchronize website directory and database between server and localhost or server and server.
View server-to-localhost.sh
#!/bin/bash
# Created on 10/8/13 by Ryan Sechrest
# site (localhost edition)
# Program to mirror a directory and database of a website between two servers.
### Program meta data
@ryansechrest
ryansechrest / vagrantfile-default
Created Dec 22, 2013
Default Vagrant box file running CentOS 6.4 x64 with Puppet.
View vagrantfile-default
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@ryansechrest
ryansechrest / post-receive.sh
Last active Feb 12, 2017
Git post-receive hook to deploy WordPress and plugins as submodules. It can also install Node.js modules with npm and vendor packages with Composer.
View post-receive.sh
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"