Skip to content

Instantly share code, notes, and snippets.

@dbtlr
dbtlr / AddressBookSpec.md
Last active August 29, 2015 14:01
Build an Address Book

The Application

Build an address book application that allows a user to

  • Create a contact group
  • Edit a contact group
  • Delete a contact group
  • Add a contact
  • Edit a contact
  • Delete a contact
@dbtlr
dbtlr / jekyll.nginx.conf
Created January 6, 2017 18:45
Jekyll Nginx config, assumes you're using a versioned deployment dir that matches the domain name and uses Let's Encrypt SSL cert.
server {
listen 80;
server_name yourdomain.com;
return 301 https://yourdomain.com$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain.com;
@dbtlr
dbtlr / jekyll-git-deploy.md
Last active January 6, 2017 19:02
A git based deploy for a Jekyll site.

A post-receive hook designed to take a pushed jekyll git repository and deploy it to a web directoy on the server.

Uses a releases / current symlink to point to the current site.

Deploys would go to: ssh://[email protected]/var/repo/yourdomain.com.git

#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Domain Name: "
read -e DOMAIN_NAME
echo "Database Name: "
read -e DATABASE_NAME
echo "Database User: "
@dbtlr
dbtlr / add_nginx_redirect.sh
Created February 6, 2017 02:35
Add a redirect for a domain name, over to a new url in Nginx w/ LetsEncrypt ssl cert
#!/bin/bash
FROM_DOMAIN=$1
TO_URL=$2
echo "
server {
listen 80;
server_name $FROM_DOMAIN;
#!/bin/bash
echo $NEW_USER
timedatectl set-timezone UTC
apt-get update
apt-get dist-upgrade -y
apt-get upgrade -y
useradd $NEW_USER