Skip to content

Instantly share code, notes, and snippets.

@fc-arny
fc-arny / echo_color.sh
Created September 20, 2018 09:59 — forked from SkypLabs/echo_color.sh
Bash functions to display messages with color
# Green
function echo_ok {
echo -e "\033[32m[OK]\033[0m $@"
}
# Red (using strerr as output)
function echo_err {
echo -e "\033[31m[ERROR]\033[0m $@" 1>&2
}
@fc-arny
fc-arny / gist:5e1a12b83f11f3673ebd
Created December 17, 2015 16:28 — forked from jessedearing/gist:2351836
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key
@fc-arny
fc-arny / gist:4bf6c9368997ba83eb3e
Created October 30, 2015 14:52 — forked from JakubOboza/gist:2008958
faye as subdomain
upstream faye {
server 127.0.0.1:9292;
}
upstream webrick{
server 127.0.0.1:3000;
}
server {
listen 80 default;
@fc-arny
fc-arny / retryable_typhoeus.rb
Last active September 4, 2015 00:19 — forked from kunalmodi/retryable_typhoeus.rb
Retry Typhoeus
module RetryableTyphoeus
require 'typhoeus'
include Typhoeus
DEFAULT_RETRIES = 1
class Request < Typhoeus::Request
def original_on_complete=(proc)
@original_on_complete = proc
require File.join(File.dirname(__FILE__), 'deploy/nginx')
require File.join(File.dirname(__FILE__), 'deploy/log')
default_run_options[:pty] = true
set :ssh_options, { :forward_agent => true }
set :application, "appname"
set :repository, "git@giturl"
set :scm, :git
# An experiment for a capistrano 'stage' that can actually be used to
# deploy multiple feature branches at once.
# Intended to be installed config/deploy/feature_demo , when using cap
# multi-stage support: add 'feature_demo' to 'stages' in `config/deploy.rb` too.
# Run from a git feature branch `cap feature_demo deploy` to deploy to
# single machine we have all our feature demos on.
# Name of feature branch will be taken from current git checkout.