Skip to content

Instantly share code, notes, and snippets.

View tiomoreno's full-sized avatar
🎯
Focusing

Tio Moreno tiomoreno

🎯
Focusing
View GitHub Profile

Local SSL websites on Mac OSX

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on Mac OSX Yosemite.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward edit to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
A versão do Nginx disponível nos repositórios oficiais do Ubuntu 12.04 é a 1.1.19, mas queremos a usar a versão estável atual, então vamos adicionar o repositório PPA oficial do Nginx ao nosso VPS. Para isso, digite o seguinte comando no terminal:
nano /etc/apt/sources.list
Com o arquivo de repositórios aberto, navegue até o final do arquivo com as setas de direção do seu teclado e adicione a linha abaixo:
deb http://ppa.launchpad.net/nginx/stable/ubuntu precise main
Adicione o repositório PPA do Nginx no final do arquivo sources.list
Feito isso, aperte <Ctrl + O> para salvar e <Ctrl + X> para fechar o arquivo e voltar ao terminal. Agora ainda com o terminal aberto, vamos adicionar a chave de autentificação do PPA, atualizar a lista de repositórios e atualizar o sistema todo. Copie e cole os comandos abaixo, lembrando de dar enter ao final de cada linha:
#!/usr/bin/ruby
require 'rss'
# Usage
# $ ./railscasts.rb http://railscasts.com/subscriptions/YOURRAILSCASTRSS/\/
# episodes.rss
# OR
# $ ./railscasts.rb
p 'Downloading rss index'
from geopy import units, distance
from mezzanine.core.managers import CurrentSiteManager
class GeoManager(CurrentSiteManager):
def near(self, latitude=None, longitude=None, distance_range=30):
queryset = super(GeoManager, self).get_query_set()
if not (latitude and longitude and distance_range):
return queryset.none()
Vagrant.configure("2") do |config|
# Use Ubuntu 12.04 64-bit for now.
config.vm.box = "precise-server-cloudimg-amd64-vagrant-disk1"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
# Provision the VM
config.vm.provision :shell, :path => "vagrant_data/install.sh"
# Configure network
config.vm.network :private_network, ip: "192.168.50.4"
def init_nmp():
install_nginx()
install_php()
install_phpfpm()
def install_nginx():
sudo("add-apt-repository ppa:nginx/stable")
sudo("apt-get update")
sudo("apt-get -y -q install nginx-full nginx-common")
server {
listen 80;
server_name localhost;
root /home/website/web;
rewrite ^/app\.php/?(.*)$ /$1 permanent;
try_files $uri @rewriteapp;
location @rewriteapp {
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
#!/usr/bin/env python
# Python script to make Skype co-operate with GNOME3 notifications.
#
#
# Copyright (c) 2011, John Stowers
#
# Adapted from skype-notify.py
# Copyright (c) 2009, Lightbreeze
#
#