Skip to content

Instantly share code, notes, and snippets.

View svedova's full-sized avatar

Savas Vedova svedova

View GitHub Profile
@svedova
svedova / install-nginx-ssl.bash
Created July 8, 2017 23:31
Install nginx and configure letsencrypt
#!/bin/bash
# Exit on error
set -e
echo "Hello, what is your app name?"
read appname
# slugify the app name
appslug="$(echo $appname | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z)"
@svedova
svedova / install-prod-env.bash
Last active July 8, 2017 23:19
Setting up a Django App with nginx, gunicorn and less compiler
#!/bin/bash
# Exit on error
set -e
echo "Hello, what is your app name?"
read appname
# slugify the app name
appslug="$(echo $appname | iconv -t ascii//TRANSLIT | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z)"
@svedova
svedova / www-perms.bash
Last active June 15, 2017 13:04
Running this bash script will create a var/www folder to host different projects in a Ubuntu environment. It will also set the permissions properly for the current user and www group.
#!/bin/bash
# run this file with sudo permissions, example:
# bash www-perms.bash <group-name> <username>
echo "Creating group if it is not there..."
getent group $1 || groupadd $1
echo "Adding user $2 to group..."
usermod -a -G $1 $2