Skip to content

Instantly share code, notes, and snippets.

View pbredenberg's full-sized avatar
🖖

Paul Bredenberg pbredenberg

🖖
View GitHub Profile
#
# Sample /etc/sudoers file.
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the sudoers man page for the details on how to write a sudoers file.
##
# Override built-in defaults
##
@pbredenberg
pbredenberg / createdb.sh
Last active August 29, 2015 14:26
Shell script to create MySQL database and user - ./createdb testdb testuser secretpass
#!/bin/bash
# from: http://jetpackweb.com/blog/2009/07/20/bash-script-to-create-mysql-database-and-user/
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="GRANT ALL ON $1.* TO '$2'@'localhost' IDENTIFIED BY '$3';"
Q3="FLUSH PRIVILEGES;"
SQL="${Q1}${Q2}${Q3}"
@pbredenberg
pbredenberg / serverblock.sh
Last active August 8, 2018 02:30
Shell script to create nginx server blocks for wordpress website.
#!/usr/bin/env bash
#
# Nginx - new server block
# Based on this post: http://clubmate.fi/how-to-make-an-nginx-server-block-manually-or-with-a-shell-script/
# Functions
ok() { echo -e '\e[32m'$1'\e[m'; } # Green
die() { echo -e '\e[1;31m'$1'\e[m'; exit 1; }
# Variables
@mixin flex-grid($columns) {
@include flexbox();
@include flex-flow(row nowrap);
@if ($columns = 2) {
& > .flex-grid--element {
@include flex(1 0 50%);
}
}
}