#!/bin/bash | |
# Script to backup git repo to S3 | |
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars | |
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc | |
bucket=$GITHUB_BACKUP_BUCKET | |
dir=$GITHUB_BACKUP_DIR | |
password=$GITHUB_BACKUP_PASSWORD | |
account=$GITHUB_ACCOUNT |
name: Security audit | |
on: | |
push: | |
paths: | |
- '**/Cargo.toml' | |
- '**/Cargo.lock' | |
jobs: | |
security_audit: | |
runs-on: ubuntu-latest | |
steps: |
INSTALL JAVA | |
$ sudo apt-get update && sudo apt-get install default-jre | |
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
$ sudo apt-get update && sudo apt-get install elasticsearch | |
$ sudo update-rc.d elasticsearch defaults 95 10 | |
$ sudo service elasticsearch restart | |
$ sudo service elasticsearch status |
INSTALL JAVA | |
$ sudo apt-get update && sudo apt-get install default-jre | |
INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
$ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
$ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
$ sudo apt-get update && sudo apt-get install elasticsearch | |
$ sudo update-rc.d elasticsearch defaults 95 10 | |
$ sudo service elasticsearch restart | |
$ sudo service elasticsearch status |
YARD CHEATSHEET http://yardoc.org
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
Using RVM, PostgreSQL, NGINX, Unicorn and Capistrano
Today I will cover how to setup a multi-application Ruby on Rails server with RVM, NGINX, Unicorn, Capistrano and PostgreSQL on a fresh virtual private server running Linux Ubuntu Server 14.04. I will be using Rails 4.2.0 new applications as examples.
My current company asked me to configure this setup, they're using the IBM's Softlayer as the main datacenter, so the server that I am playing with is a Softlayer. Nothing special about it, but in this case I have decided to don't use Chef or anything like that, but to make the entire server by hand, because it's funnier, right? Let's go.
####Creating the first user and SSH security configurations
assets_path = File.expand_path("~/projects/rails/scout/public") | |
log_path = File.expand_path "~/assets.txt" | |
temp_requested_files_path = File.expand_path "~/processed_assets.txt" | |
ignore_pattern = /sparkline|datejs/ | |
known_used =[ | |
"javascripts/jquery-1.7.1.min.js", | |
"javascripts/jquery.extensions.js", | |
"javascripts/application.js", | |
"stylesheets/default.css", |
upstream app { | |
server unix:/srv/app/current/tmp/sockets/unicorn.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name www.app.com; | |
rewrite ^/(.*) http://app.com/$1 permanent; | |
} | |
server { |