Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Powell stringsn88keys

View GitHub Profile
@stringsn88keys
stringsn88keys / letsencrypt.sh
Created Jul 3, 2017
get certs via lets encrypt
View letsencrypt.sh
#first time setup only
sudo apt-get install git
sudo git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
# I had to restart apache with a stubbed *.443 section, do this, and then
# add the SSL* directives in.
sudo -H ./letsencrypt-auto certonly --standalone -d example.com
View example.com-new.conf
<Directory /var/www/html/example.com/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
Redirect / https://example.com/
</VirtualHost>
<VirtualHost *:443>
SSLEngine On
View wp-config-new.fake.snippet.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp_example_com');
/** MySQL database username */
define('DB_USER', 'examplecom');
/** MySQL database password */
define('DB_PASSWORD', '!@(87P@ss');
View initial.vhost.conf
<Directory /var/www/html/example.com/public_html>
Require all granted
</Directory>
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
ServerAdmin email@example.com
DocumentRoot /var/www/html/example.com/public_html
View apache2.conf
<Directory /var/www/html/example.com/public_html/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
@stringsn88keys
stringsn88keys / mysqldump command
Last active Jul 3, 2017
Mysqldump example for extracting wordpress
View mysqldump command
mysqldump wp_example_com --host mysql.db.example.com -u examplecom -p > example.com.sql
@stringsn88keys
stringsn88keys / wp-config.fake.snippet.php
Last active Jul 3, 2017
Fake wp-config snippet for instructions on moving from Dreamhost to Linode
View wp-config.fake.snippet.php
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', 'wp_example_com');
/** MySQL database username */
define('DB_USER', 'examplecom');
/** MySQL database password */
define('DB_PASSWORD', 'ASD9@!h12');
@stringsn88keys
stringsn88keys / init.lua
Last active Jul 20, 2021
Hammerspoon init script to auto-arrange for three screens.
View init.lua
-- https://en.wikipedia.org/wiki/Web_colors#X11_color_names
-- hs.streamdeck.init(function(connected, sd)
-- device = hs.streamdeck.getDevice(1)
-- device.setButtonColor("1", hs.drawing.color.x11.teal)
-- end)
applications = { "Messages", "iTunes", "Skype for Business", "iTerm2", "Microsoft Outlook", "HipChat", "Microsoft OneNote", "MacVim", "RubyMine", "Firefox" }
hs.hotkey.bind({"cmd", "alt", "ctrl"}, "pageup", function()
@stringsn88keys
stringsn88keys / init.lua
Created Apr 1, 2017
Hammerspoon init script that allows 1-9 to move windows into 9ths of the screen
View init.lua
function move_to_third(r,c)
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local extents = screen:frame()
f.x = extents.x + (extents.w / 3) * c
f.y = extents.y + (extents.h / 3) * r
f.w = extents.w / 3
f.h = extents.h / 3
@stringsn88keys
stringsn88keys / .zlogin
Last active Aug 29, 2015
A section of my .zlogin to notify me when a process > 4 minutes finishes. (Mac-specific)
View .zlogin
export PMPSVN='http://cvs.appriss.com/svn/softeng/projects/pmp'
export PATH=~/bin:$PATH
export DYLD_LIBRARY_PATH=~/instantclient_11_2
#alias gvim='mvim'
export EDITOR=/usr/local/bin/mvim
export NARWHAL_ENGINE=jsc
export RSENSE_HOME=~/.vim/bundle/rsense
export PATH="/Library/PostgreSQL/9.2/bin:/usr/local/narwhal/bin:$PATH"