I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
# -*- coding:utf-8 -*- | |
import json | |
import sqlite3 | |
JSON_FILE = "some.json" | |
DB_FILE = "some.db" | |
traffic = json.load(open(JSON_FILE)) | |
conn = sqlite3.connect(DB_FILE) |
# set modifier to Super key | |
set $mod Mod4 | |
# workspaces | |
set $ws_chat 1: Chat | |
set $ws_web 2: Web | |
set $ws_code 3: Code | |
set $ws_misc 4: Misc | |
set $ws_fm 5: FM |
require 'openssl' | |
def gen_key(name) | |
key = OpenSSL::PKey::RSA.new 1048 | |
file = File.new(name, "w") | |
file.write(key) | |
file.close | |
end | |
def get_key(name) |
I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.
These are the steps I went through to set up an SSL cert.
<?php | |
/** | |
* Clean HTML string removing all element attributes and elements which are | |
* not in the provided whitelist (but keeping their allowed children). | |
* | |
* @see https://github.com/alixaxel/phunction/blob/master/phunction/HTML.php | |
* @param string $html to clean | |
* @param array $whitelist | |
*/ | |
function clean_html($html, array $whitelist) |
class DatabaseController < ApplicationController | |
def database_dump | |
database = Rails.configuration.database_configuration[Rails.env]["database"] | |
send_file_headers!(:type => 'application/octet-stream', :filename => "#{database}_#{Time.now.to_s(:human)}.backup") | |
pipe = IO.popen("pg_dump '#{database}' -F c") | |
stream = response.stream | |
while (line = pipe.gets) | |
stream.write line | |
sleep 0.0001 # HACK: Prevent server instance from sleeping forever if client disconnects during download |
Copyright (C) 2011 by Colin MacKenzie IV | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in |
require 'mina/bundler' | |
require 'mina/git' | |
require 'mina/rbenv' | |
set :domain, 'your_domain.com' | |
set :deploy_to, '/home/deployer/app_name' | |
set :repository, '[email protected]:user_name/app_name' | |
set :branch, ENV["brunch"] || 'master' | |
set :app_name, "app_name" |
<?php | |
/** | |
* Sanitiza los HTML retirando script tags del codigo | |
* @param $html string cadena HTML a sanitizar | |
* @return string retorna cadena sanitizada | |
*/ | |
public static function sanitize_html($html){ | |
$dom = new DOMDocument(); | |
$dom->loadHTML($html); | |
$script = $dom->getElementsByTagName('script'); |