Skip to content

Instantly share code, notes, and snippets.

@cloudrck
cloudrck / secure-link.conf
Created October 14, 2023 16:25
Nginx Secure Link Config

Keybase proof

I hereby claim:

  • I am cloudrck on github.
  • I am cloudrck (https://keybase.io/cloudrck) on keybase.
  • I have a public key ASDb9ncY0PDpPIK8YQCkyT2UwOXjeNwDwWjtcXnCHfFzmwo

To claim this, I am signing this object:

@cloudrck
cloudrck / defaults_unicorn_app
Created April 22, 2017 02:22 — forked from AlexeyDemidov/defaults_unicorn_app
Unicorn service file for systemd with rvm support
# save this file in /etc/default/unicorn_app
USER=app_user
APP_ROOT=/srv/app
RVM_STRING=2.2.4@app_gemset
RACK_ENV=production
UNICORN_OPTS="-D -c /srv/app/shared/config/unicorn.rb -E production"
DAEMON=unicorn
@cloudrck
cloudrck / certbot-renew.sh
Last active February 20, 2017 03:46
Renew Script for LetsEncrypt
#!/usr/bin/env bash
set -o errexit
set -o nounset
# Bash will remember & return the highest exitcode in a chain of pipes.
# This way you can catch the error in case mysqldump fails in `mysqldump |gzip`
set -o pipefail
PATH=/sbin:/bin:/usr/sbin:/usr/bin
@cloudrck
cloudrck / Backup.sh
Created June 10, 2016 02:37
Bash Backup Script
#!/usr/bin/env bash
# This file:
#
# - Simple Bash script to mysqldump > Gzip > Rsync+ssh storage
# - It trys to avoid hardcoded login credentials
# - It assumes the user executing has ~/.my.cnf for mysqldump
#
# Version: 0.1
#
# Usage:
@cloudrck
cloudrck / install-comodo-ssl-cert-for-nginx.rst
Created May 9, 2016 04:04 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@cloudrck
cloudrck / ComicIO.py
Last active December 30, 2022 18:42
Python Script to generate a Comic Book EPUBv3 or CBZ file from JPEG's.
#!/usr/bin/env python
# coding: utf-8
# ComicIO: copyright (C) 2016, Daejuan Jacobs
# This is a preview to a script I will be packaging soon. Consider this an Alpha build
# Just need Python v3
#
#ToDo
# * Add page count
# * dc:identifier for UPC/ISBN http://www.idpf.org/epub/30/spec/epub30-publications.html#sec-opf-dcidentifier
# * Coverimage.xtml
require 'rubygems'
require 'sinatra'
helpers do
def request_headers
env.inject({}){|acc, (k,v)| acc[$1.downcase] = v if k =~ /^http_(.*)/i; acc}
end
end
@cloudrck
cloudrck / Gemfile
Last active August 29, 2015 14:25
Spree 3.0 Variant Errors
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
@cloudrck
cloudrck / myapp.conf
Last active August 29, 2015 14:25
Debian Unicorn Init Script
## A sample /etc/unicorn/my_app.conf
##
APP_ENV=production
APP_ROOT=/home/myuser/legendsu
SHARED_ROOT=/home/myuser/shared
UNICORN="/home/myuser/.rvm/gems/ruby-2.1.2/bin/unicorn"