Skip to content

Instantly share code, notes, and snippets.

View ryansechrest's full-sized avatar
👨‍💻
Andiamo

Ryan Sechrest ryansechrest

👨‍💻
Andiamo
View GitHub Profile
@ryansechrest
ryansechrest / httpd.conf
Created March 21, 2014 03:07
Default httpd configuration file.
#
# 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 / sshd_config
Created March 21, 2014 03:10
Default sshd configuration file.
# $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 / configuration-files.md
Last active June 4, 2021 21:21
RedHat/CentOS configuration files and paths of interest.

Apache

TXT /etc/httpd/conf/httpd.conf — Main Apache server configuration file.

TXT /etc/httpd/conf.d/ssl.conf — Apache server configuration file providing SSL support.

DIR /etc/httpd/vhosts.d/ — Virtual host configuration files.

DIR /var/log/httpd/ — Apache logs.

@ryansechrest
ryansechrest / commands.md
Last active September 12, 2022 14:24
Useful CentOS Commands

Files

Find file

find . -name foobar.txt

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

@ryansechrest
ryansechrest / terminal.md
Last active October 6, 2022 03:47
Mac Terminal

Editor

Command Description
Control + A Jump to beginning of line
Control + E Jump to end of line
Control + U Delete text before cursor
Control + K Delete text after cursor
Control + W Delete word before cursor
Control + T Swap last two characters before cursor
@ryansechrest
ryansechrest / programs.md
Last active August 29, 2015 14:16
Useful programs for CentOS 7.

Programs

firewall-cmd

firewalld command line client

View firewall state
firewall-cmd --state
@ryansechrest
ryansechrest / hello.py
Last active October 14, 2017 15:56
Create a Python command-line tool.
import click
@click.command()
def cli():
"""Example script."""
click.echo('Hello World!')
@ryansechrest
ryansechrest / default.conf
Last active September 12, 2022 14:23
SSL Certificate Setup in Virtual Host
<IfModule mod_ssl.c>
<VirtualHost *:443>
Include vhosts.d/includes/domain.com.conf
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
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/star.domain.com.crt
SSLCertificateKeyFile /var/www/ssl/star.domain.com.key
@ryansechrest
ryansechrest / states.php
Last active November 15, 2022 20:23
PHP Arrays of U.S. States
# State Abbr => State Name; Vertical Format
[
'AL' => 'Alabama',
'AK' => 'Alaska',
'AZ' => 'Arizona',
'AR' => 'Arkansas',
'CA' => 'California',
'CO' => 'Colorado',
'CT' => 'Connecticut',
@ryansechrest
ryansechrest / post-receive-laravel.php
Last active November 14, 2019 15:28
Git post-receive hook to deploy a Laravel application.
#!/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"