Skip to content

Instantly share code, notes, and snippets.

View Epigene's full-sized avatar

Augusts Bautra Epigene

View GitHub Profile
Copy the CapPack into project directory replacing existing files
# CapPack at
Edit contents of config/deploy to reflect Swisslanguages -> <appname>
@Epigene
Epigene / Nginx Examples
Created September 12, 2014 12:42
Nginx default examples
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts to this file
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
========== SSL certs for FDL ==========
Staging:
1. $ openssl req -sha1 -newkey rsa:2048 -keyout 1216308_key.pem -out 1216308_req.pem -subj "/C=LV/O=www.stockholmhealth.com/CN=1216308" -outform PEM -config openssl.cnf
2. Ielogojamies IBIS un self-sign
3. Iemetam no šiem saņemtos failus (viņi atsūta sertifikātu pirms atbildes, ka atsūtīs sertifikātu) tai pašā mapē, kur key un:
4. $ openssl pkcs12 -export -in 1216308.pem -out 1216308.p12 -certfile ECOMM.pem -inkey 1216308_key.pem
5. $ openssl pkcs12 -in 1216308.p12 -out 1216308_keystore.pem
@Epigene
Epigene / config.fish
Last active August 29, 2015 14:06
Server ~/.config/fish/config.fish
# Be sure to change <appname> and <dbname> to real values
# Path to your oh-my-fish.
set fish_path $HOME/.oh-my-fish
# Load oh-my-fish configuration.
. $fish_path/oh-my-fish.fish
# Custom plugins and themes may be added to ~/.oh-my-fish/custom
# Plugins and themes can be found at https://github.com/oh-my-fish/
@Epigene
Epigene / private.xml
Created October 2, 2014 11:21
Karabiner's Private.xml config
<?xml version="1.0"?>
<root>
<item>
<name>Swap Paragraph-Hash key to Del</name>
<identifier>private.swap_para_and_del</identifier>
<autogen>__KeyToKey__ KeyCode::DANISH_DOLLAR, KeyCode::FORWARD_DELETE</autogen>
</item>
<item>
<name>Swap Space and Tab</name>
@Epigene
Epigene / gist:5bfac6cf1756b5f876b3
Last active August 29, 2015 14:07
Mina Workflow
# place in Gemfile, then bundle
gem 'mina'
# Initialize mina to get deploy.rb
mina init
# In deploy.rb uncomment your ruby manager (Creative uses rvm, so)
#require 'mina/rbenv'
require 'mina/rvm'
@Epigene
Epigene / pg_search.rb
Created October 13, 2014 12:56
pg_search install
========= pg_search Workflow =========
# add to gemfile and bundle
gem 'pg_search', '0.7.8' # # Empowers PostgreSQL-driven ActiveRecord
# setup addon migrations
rails g migration add_contrib_extensions
class AddContribExtensions < ActiveRecord::Migration
def up
execute 'CREATE EXTENSION pg_trgm;'
@Epigene
Epigene / PHP Dokku workflow
Last active August 29, 2015 14:13
A workflow for configuring and deploying PHP apps via dokku
# Make PHP app Dokku-friendly
# Add staging and production clauses to database.yml
# Tell docker how to start app, Add to Procfile (web server dependant)
# Simple puma setup
Make Procfile, add line:
web: bundle exec puma -t ${PUMA_MIN_THREADS:-1}:${PUMA_MAX_THREADS:-1} -w ${PUMA_WORKERS:-2} -p $PORT -e ${RACK_ENV:-production}
# Simple unicorn setup:
Make Procfile, add line:
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
Make config/unicorn.rb, populate with default pre and post-fork blocks
@Epigene
Epigene / Dokku rails staging env
Last active August 29, 2015 14:14
Dokku rails app staging environment setup
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
config.eager_load = false
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = true
@Epigene
Epigene / Static dokku
Last active August 29, 2015 14:14
Static pages with dokku
# Static html serving via dokku:
1. make .env in root, include the line “export BUILDPACK_URL=https://github.com/florianheinemann/buildpack-nginx.git”;
2. make .static (an empty file for buildpack to pick up it will be a static app)
3. make www directory
4. place index.html along with .css into www folder to be served. (Assets come in www/assets/)
5. init git remote
$ git remote add dokku dokku@apps.creative.gs:<domain.com>
6. $ git push dokku master
7. visit working site.