The following blob is a set of basic setup configuration for Git, along with some shortcuts that I personally use.
Here we assume that you are working on your own, local branch (basically, not the master).
The shortcuts and what they do
Generate KEY and CSR:
openssl req -new -newkey rsa:2048 -nodes -keyout DOMAIN.key -out DOMAIN.csr
Echo the KEY in PEM format:
openssl rsa -in DOMAIN.key -outform PEM
Echo the CRT in PEM format:
#!/bin/bash | |
#if [[ $EUID -ne 0 ]]; then | |
# echo "Script MUST be run as a root user" | |
# exit 1 | |
#fi | |
session="bg-apps" | |
logs_dir=~/tmux-logs | |
{% set states = { | |
AL: 'Alaska', | |
AZ: 'Arizona', | |
AR: 'Arkansas', | |
CA: 'California', | |
CO: 'Colorado', | |
CT: 'Connecticut', | |
DE: 'Delaware', | |
DC: 'District of Columbia', | |
FL: 'Florida', |
This guide assumes you've created an EC2 instance on AWS, with 2 drives (1 for the OS, 1 where the actual site(s) live). The 2 drive system allows for easier replacement of the OS/software side if something breaks, while keeping site data intact.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install php5.6-fpm php5.6-mysql php5.6-gd php5.6-mcrypt nginx git ntp
cd ~/.ssh
Generate files:
ssh-keygen -t rsa -b 2048 -v
Fix file names:
mv id_rsa id_rsa.pem
mv id_rsa.pub authorized_keys
cat hostname.key hostname.crt PositiveSSLCA2.crt AddTrustExternalCARoot.crt > subsonic.crt
openssl pkcs12 -in subsonic.crt -export -out subsonic.pkcs12
sudo keytool -importkeystore -srckeystore subsonic.pkcs12 -destkeystore subsonic.keystore -srcstoretype PKCS12 -srcstorepass subsonic -srcalias 1 -destalias subsonic
sudo zip /var/subsonic/subsonic-booter-jar-with-dependencies.jar subsonic.keystore
source ~/.git-completion.sh | |
source ~/.git-prompt.sh | |
export GIT_PS1_SHOWDIRTYSTATE=1 | |
export PS1='\[\033[00;00m\] \w\[\033[00;32m\]$(__git_ps1)\[\033[00m\] ⚡ ' | |
# A quick way to find the answer: `google "cat videos"` (Mac OSX / macOS) | |
function google() { open /Applications/Google\ Chrome.app/ "http://www.google.com/search?q=$1"; } |
function fromUTF8Array(data) { // array of bytes | |
let str = '', | |
i; | |
for (i = 0; i < data.length; i++) { | |
let value = data[i]; | |
if (value < 0x80) { | |
str += String.fromCharCode(value); | |
} else if (value > 0xBF && value < 0xE0) { |