This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sublime, sublime_plugin | |
import os, sys | |
import threading | |
import subprocess | |
import functools | |
import time | |
import collections | |
class ProcessListener(object): | |
def on_data(self, proc, data): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# assumming path to nginx is /etc/nginx/ | |
sudo su | |
cd /etx/nginx | |
mkdir certs_localhost | |
cd certs_localhost | |
# generate self signed certificate, the identifier for it should be localhost | |
openssl req -x509 -newkey rsa:2048 -keyout development.key -out development.crt -days 5000 -nodes | |
cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Checking your system to see if IPsec got installed and started correctly: | |
Version check and ipsec on-path [OK] | |
Linux Openswan U2.6.37/K(no kernel code presently loaded) | |
Checking for IPsec support in kernel [FAILED] | |
SAref kernel support [N/A] | |
Checking that pluto is running [OK] | |
Pluto listening for IKE on udp 500 [FAILED] | |
Pluto listening for NAT-T on udp 4500 [FAILED] | |
Checking for 'ip' command [OK] | |
Checking /bin/sh is not /bin/dash [WARNING] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "fog" | |
require "net/http" | |
class CloneRackspaceCloudFiles | |
def service | |
@service ||= Fog::Storage.new({ | |
:provider => 'Rackspace', | |
:rackspace_username => ENV["RACKSPACE_USER_NAME"], | |
:rackspace_api_key => ENV["RACKSPACE_API"], | |
:rackspace_auth_url => Fog::Rackspace::UK_AUTH_ENDPOINT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Discovered a cool mongoid feature for autobuilding embedded or references relations: | |
class Person | |
include Mongoid::Document | |
embeds_one :name, autobuild: true | |
has_one :address, autobuild: true | |
end | |
> Person.new.name # returns a new name object, yey |