Skip to content

Instantly share code, notes, and snippets.

@carlosedp
carlosedp / nginx-auth.yaml
Last active February 22, 2024 19:45
NGINX Keycloak Authentication
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: nginx
@TechnologistAU
TechnologistAU / unifi.sh
Last active October 10, 2019 02:57
UniFi 5 Installation Script for Raspberry Pi
#!/bin/bash
################################################################################
#
# This script automates the installation of the UniFi controller software on the
# Raspberry Pi.
#
# http://www.technologist.site/ubnt
#
################################################################################
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@renshuki
renshuki / ubuntu_agnoster_install.md
Last active April 23, 2024 13:04
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH

@erans
erans / mongobackup.sh
Last active October 7, 2019 16:59
MongoDB ReplicaSet Backup Script on Google Compute Engine and Google Cloud Storage
# Path to boto config file, needed by gsutils
BOTO_CONFIG="/etc/boto.cfg"
# Path in which to create the backup (will get cleaned later)
BACKUP_PATH="/mnt/data/dump/"
# DB name
DB_NAME="mydatabase"
# Google Cloud Storage Bucket Name
@joshukraine
joshukraine / how-to-install-powerline-on-osx.md
Last active August 10, 2020 03:04
How to Install Powerline on OS X

How to Install Powerline on OS X

Preface

This whole thing hinges on having the right version of Python installed. We're going to do it via Homebrew. You have to install Python BEFORE you install Vim. So if Vim is already installed (the Homebrew version, that is) then remove it first.

Installation

Check to see if vim or python are installed.

brew list

@absoutherland-zz
absoutherland-zz / dashboard
Created November 19, 2013 23:00
init script for Dashing
#!/bin/bash
# chkconfig: 2345 55 25
# Dashing service
# Add this file to /etc/init.d/
# Make executable
# Configure chkconfig
# Dashboard will start at boot. Check out the boot log for trouble shooting "/var/log/boot.log"
######################################################
#YOU WILL NEED TO CONFIGURE THIS FOR YOUR ENVIRONMENT#
######################################################
@runlevel5
runlevel5 / puma.sh
Last active July 18, 2022 17:37
pumactl is very broken, @nemshilov and @joneslee85 wrote this bash script replacement and it works so reliably on production server. So here it is, share with the world!
#!/usr/bin/env bash
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`.
# Please modify the CONSTANT variables to fit your configurations.
# The script will start with config set by $PUMA_CONFIG_FILE by default
PUMA_CONFIG_FILE=config/puma.rb
PUMA_PID_FILE=tmp/pids/puma.pid
PUMA_SOCKET=tmp/sockets/puma.sock
@shtirlic
shtirlic / gist:5052306
Last active November 18, 2021 17:58 — forked from joelmoss/gist:2470666
set :stage, 'production'
set :shared_children, shared_children << 'tmp/sockets'
puma_sock = "unix://#{shared_path}/sockets/puma.sock"
puma_control = "unix://#{shared_path}/sockets/pumactl.sock"
puma_state = "#{shared_path}/sockets/puma.state"
puma_log = "#{shared_path}/log/puma-#{stage}.log"
namespace :deploy do
desc "Start the application"
@josegonzalez
josegonzalez / access.lua
Created December 3, 2012 18:26
Simple lua file enabling oauth support for nginx via nginx-lua and access_by_lua.
- certain endpoints are always blocked
if nginx_uri == "/_access_token" or nginx_uri == "/_me" then
ngx.exit(403)
end
-- import requirements
local cjson = require "cjson"
-- setup some app-level vars
local app_id = "APP_ID"