Skip to content

Instantly share code, notes, and snippets.

View HowardMei's full-sized avatar
🏠
Working

Howard Mei HowardMei

🏠
Working
View GitHub Profile
@HowardMei
HowardMei / gmaildomain.py
Created April 3, 2012 02:28 — forked from dstevensio/gmaildomain.py
Python Script To Add DNS Overrides For WebFaction Hosted Domains to use Google Apps Mail
'''
Run this script either by doing:
python gmaildomain.py
And you will be prompted for details, or you can save time by doing:
python gmaildomain.py WEBFACTION_USERNAME_HERE DOMAIN_TO_USE_GMAIL_FOR_HERE_WITHOUT_WWW
And you will only be prompted for your password.
@HowardMei
HowardMei / django_interface.py
Created May 7, 2012 03:47 — forked from niwinz/django_interface.py
Django websockets with tornado, gevent and zeromq
# -*- coding: utf-8 -*-
from gevent import monkey; monkey.patch_all()
import gevent
from gevent_zeromq import zmq
class WebSocketHandler(object):
def __init__(self, _id, in_queue, socket):
@HowardMei
HowardMei / nginx.conf
Created July 26, 2012 07:35 — forked from justincormack/nginx.conf
Using Lua and Nginx to proxy Amazon web services example
# example location parts of nginx.conf
# add your own AWS keys, server lines etc, and set your aws domains, paths
http {
# you will need the luacrypto in the cpath, download from http://luacrypto.luaforge.net/
lua_package_cpath "/home/justin/lua/luacrypto-0.2.0/src/l?.so.0.2.0;;";
server {
listen 80;
@HowardMei
HowardMei / install_profile.php
Created October 30, 2012 14:51
New Wordpress Install Profile
<?php
//$base_dir = '/home/username/www/wordpress';
//chdir($base_dir);
define( 'WP_SITEURL', 'http://localhost/wordpress' );
define( 'WP_INSTALLING', true );
require_once 'wp-load.php';
require_once 'wp-admin/includes/upgrade.php';
'''
Based on:
- Read this for EC2 setup info and the approach - http://www.dikant.de/2010/10/08/setting-up-a-vpn-server-on-amazon-ec2/
- https://gist.github.com/1130401
- EC2 fabric bits via - https://github.com/slacy/fabric-ec2
'''
import boto

Building Riak on SmartOS, the hard way

Build Machine

Here is some information on the build machine I'm using for reference:

  1. Dataset

    $ dsadm list

UUID OS PUBLISHED URN

Comment Blacklist for WordPress

Sometimes a simple solution is a better solution.

Over the past couple of years, I have identified over 6,100 phrases, patterns, and keywords commonly used by spammers and comment bots in usernames, email addresses, link text, and URIs. This blacklist is still a work in progress and there is certainly room for optimization. Suggestions are always appreciated.

How Do I Use It?

Copy the list of keywords, paste it into the Comment Blacklist field of your WordPress Discussion Settings panel, and click the “Save Changes” button.

@HowardMei
HowardMei / nginx.conf
Created November 18, 2013 01:52 — forked from plentz/nginx.conf
#don't send the nginx version number in error pages and Server header
server_tokens off;
# config to enable HSTS(HTTP Strict Transport Security) https://developer.mozilla.org/en-US/docs/Security/HTTP_Strict_Transport_Security
# to avoid ssl stripping https://en.wikipedia.org/wiki/SSL_stripping#SSL_stripping
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
# config to don't allow the browser to render the page inside an frame or iframe
# and avoid clickjacking http://en.wikipedia.org/wiki/Clickjacking
# if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri

License

All code providing basic infrastructure services will be Open Source. Closed source code may be used to access APIs or used in VMs started with the exchange. However, no closed source code which provides service to the infrastructure or network will be promoted by the network. Infrastructure is meant to be open and trustworthy.

Concept

The underlying concept is a cryptcoin operated 'compute exchange' powered by multiple OpenStack cluster deployments. These deployments are run by 'providers' and managed by 'compute pools'. A provider can participate in multiple pools by running multiple virtual appliance 'controllers'.

Various compute pools can provide levels of reliability, diverse instance types, custom OS images, unique branding, community reach and more. Diversification is encouraged and welcome.

It is the intent of this project to create a fully distributed compute exchange which greatly minimizes the central control authority for server starts and access.

#!/bin/bash
# source: http://stackoverflow.com/questions/4023830/bash-how-compare-two-strings-in-version-format
vercomp () {
if [[ $1 == $2 ]]
then
return 0
fi
local IFS=.