Skip to content

Instantly share code, notes, and snippets.

View vmoravec's full-sized avatar

Vladimir Moravec vmoravec

View GitHub Profile
@vmoravec
vmoravec / Ansible Let's Encrypt Nginx setup
Created October 24, 2017 21:03 — forked from mattiaslundberg/Ansible Let's Encrypt Nginx setup
Let's Encrypt Nginx setup with Ansible
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@vmoravec
vmoravec / jekyll-and-liquid.md
Created September 6, 2016 19:59 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@vmoravec
vmoravec / ssh-exit-codes.sh
Created August 24, 2016 14:10 — forked from asiegman/ssh-exit-codes.sh
Understanding SSH and exit codes in Bash scripts.
#!/bin/bash
#
# SSH Exit Codes
#
# Using SSH in scripting is pretty standard, but sometimes you want to stop execution of a script
# if a command inside an SSH session fails to exit cleanly (return 0). The key to remember is that
# the ssh command's exit code will be that of the *last executed* command inside the ssh session, just
# like a bash script ends with the exit code of the last command executed unless you specifically
# call exit.
#
publishers:
- archive:
artifacts: '.artifacts/**'
allow-empty: 'true'
default-excludes: false
(function (export) {
var App = export.App = {};
// Stores state/current views of the App
App.state = {};
App.state.currentPlayer = null;
// Model containing the player
App.PlayerModel = Backbone.Model.extend({});
# in your app supervisor
:phx_dyn_dispatch = :ets.new(:phx_dyn_dispatch, [:named_table, :bag, :public])
defmodule DynamicDispatch do
def register(group, plug, opts) do
true = :ets.insert(:phx_dyn_dispatch, {group, plug, opts})
end
def unregister(group, plug) do
@vmoravec
vmoravec / snowden-ietf93.md
Last active August 29, 2015 14:27 — forked from mnot/snowden-ietf93.md
Transcript of Edward Snowden's comments at IETF93.
#!/usr/bin/env python
import cStringIO
import json
import pycurl
import os
import sys
##########
# configuration
@vmoravec
vmoravec / default.yml
Last active August 29, 2015 14:18
Default story for cloud tests
# matrix:
# rake story:default
## contains
# rake story:default:install:admin # mkcloud:instcrowbar
# rake feature:admin # cct rake task
# rake story:default:install:controller # mkcloud:setupcompute
# rake feature:controller # cct rake task
@vmoravec
vmoravec / test runner config.yml
Last active August 29, 2015 14:18
Test runner config yaml file
story:
default: &default
mkcloud:
cloudsource: develcloud5
net_public: 192.168.173
net_fixed: 192.168.174
net_admin: 192.168.175
adminnetmask: 255.255.248.0
TESTHEAD: 1
UPDATEREPOS: 1