Skip to content

Instantly share code, notes, and snippets.


Ryan Sechrest ryansechrest

View GitHub Profile
ryansechrest /
Created Feb 19, 2014
Base server setup and configuration.
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:> for detailed information.
# In particular, see
# <URL:>
# for a discussion of each configuration directive.
# Do NOT simply read the instructions in here without understanding
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 /
Last active Aug 29, 2015
Useful commands for CentOS.


Find file

find . -name foobar.txt

-name FooBar — Filter by file name (case sensitive)

ryansechrest /
Last active Aug 29, 2015
Useful programs for CentOS 7.



firewalld command line client

View firewall state
firewall-cmd --state
ryansechrest / default.conf
Last active Sep 23, 2015
SSL Certificate Setup in Virtual Host
View default.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
Include vhosts.d/includes/
SSLEngine on
SSLProtocol all -SSLv2
SetEnvIf User-Agent ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0
SSLCertificateChainFile /var/www/ssl/certificate-authority-default.crt
SSLCertificateFile /var/www/ssl/
SSLCertificateKeyFile /var/www/ssl/
ryansechrest / rewritemap-sample.conf
Last active Dec 28, 2015
Virtual host file for port 80 that redirects 'www' alias to main domain, uses 'cronolog' to rotate error and access logs, redirects non-whitelisted hosts to main site, allows access to itself via URL-based cron jobs, and prompts users of permitted group for username and password via basic authentication. Also includes rewrite map to redirect dom…
View rewritemap-sample.conf
<VirtualHost *:80>
RewriteEngine On
RewriteMap redirect_map_master txt:vhosts.d/includes/redirect_map_master
RewriteCond %{HTTP_HOST} ^(www\.)?(.+)
RewriteCond ${redirect_map_master:%2|} ^(.+)$ [NC]
RewriteRule ^/$ http://%1 [L,R=301]
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!
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
ryansechrest /
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.
# 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
ryansechrest /
Last active Oct 14, 2017
Create a Python command-line tool.
import click
def cli():
"""Example script."""
click.echo('Hello World!')