Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@tybenz
tybenz / urlshort.sh
Created February 7, 2013 23:02
Bash URL Shortener
#!/bin/bash
echo "Generating URL..."
FULL_PATH="/Users/tbenzige/Projects/aws"
#Count is kept based on a list.txt file
#list.txt is a plain text file meant to show relationships between URLs
#Instead of a running count, we just count the lines in list.txt
INITIAL=`echo -n $(cat $FULL_PATH/list.txt | wc -l)`
NUM="$INITIAL/4"
@joemccann
joemccann / nginx + node setup.md
Created October 25, 2010 02:06
Set up nginx as a reverse proxy to node.js.

The idea is to have nginx installed and node installed. I will extend this gist to include how to install those as well, but at the moment, the following assumes you have nginx 0.7.62 and node 0.2.3 installed on a Linux distro (I used Ubuntu).

In a nutshell,

  1. nginx is used to serve static files (css, js, images, etc.)
  2. node serves all the "dynamic" stuff.

So for example, www.foo.com request comes and your css, js, and images get served thru nginx while everything else (the request for say index.html or "/") gets served through node.

  1. nginx listens on port 80.
@twe4ked
twe4ked / application_controller.rb
Created April 29, 2010 04:40
One idea for giving devise's controllers their own layout
# How to give your devise controllers all the same layout (e.g. "authentication" below)
class ApplicationController < ActionController::Base
layout :setup_layout
def setup_layout
return "authentication" if
[ConfirmationsController, PasswordsController, SessionsController,
RegistrationsController, UnlocksController].include? self.class
"application"
end
$ autotest
loading autotest/rails_rspec2
style: RailsRspec2
--------------------------------------------------------------------------------
/Users/dchelimsky/.rvm/rubies/ruby-1.8.7-p249/bin/ruby -rrubygems /Users/dchelimsky/.rvm/gems/ruby-1.8.7-p249/gems/rspec-core-2.0.0.beta.6/bin/rspec /Users/dchelimsky/tmp/example/spec/models/widget_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/show.html.erb_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/edit.html.erb_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/new.html.erb_spec.rb /Users/dchelimsky/tmp/example/spec/controllers/widgets_controller_spec.rb /Users/dchelimsky/tmp/example/spec/views/widgets/index.html.erb_spec.rb
*...................