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 / pybddfrm
Created December 20, 2012 08:37
Python BDD Frameworks Actively Maintained
Minimalist BDD in python:
https://github.com/mdwhatcott/pyspecs
Clone of Ruby Cucumber:
https://github.com/jeamland/behave
Full stack acceptance test framework:
https://github.com/heynemann/pyccuracy
Test automation framework for webapps:
@HowardMei
HowardMei / pybrowserlib
Last active December 9, 2015 23:28
Python autobrowsing libs
Alternative to inactive pycurl http://pycurl.sourceforge.net/:
https://github.com/lispython/human_curl
https://github.com/fireteam/curlish
Pexpect upgraded to support unicode:
https://bitbucket.org/takluyver/pexpect/overview
Python http made simple:
@HowardMei
HowardMei / gist:4350896
Last active May 16, 2020 16:30
python bash integration
A collection of python & shell integration attempts:
pysh:Write shell scripts in Python
https://github.com/yunabe/pysh
lshell:function limited shell
https://github.com/ghantoos/lshell
sh:similar to plumbum but has builtin features
https://github.com/amoffat/sh
@HowardMei
HowardMei / gist:4372078
Created December 25, 2012 07:38
singapore ipv4 range
# Report generated on Tue Dec 25 07:37:20 2012
# by http://software77.net/geo-ip/
# Report Type : xx.xx.xx.xx-yy.yy.yy.yy format
# Country : Singapore
# ISO 3166 CC : ALPHA-2 SG; ALPHA-3 SGP
# Registry : APNIC
# Records found: 595
14.100.0.0-14.100.255.255
27.0.8.0-27.0.11.255
27.34.176.0-27.34.191.255
'''
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

@HowardMei
HowardMei / saltinit
Created August 25, 2013 16:20
salt init
#!/bin/sh
HOSTNAME=hostname_here
SALT_MASTER=internal_ip_here
echo $HOSTNAME > /etc/hostname
hostname --file /etc/hostname
sed --in-place -e "s/127.0.0.1 localhost/127.0.0.1 $HOSTNAME localhost/" /etc/hosts
sed --in-place -e "s/::1 ip6-localhost ip6-loopback/::1 $HOSTNAME ip6-localhost ip6-loopback/" /etc/hosts
sed --in-place "2i $SALT_MASTER salt" /etc/hosts
@HowardMei
HowardMei / gist:6448672
Created September 5, 2013 10:54
nginx auto restart
#!/bin/bash
#
# Wrapper based on MiteshShah script
# https://github.com/rtCamp/easyengine/issues/3
#
# Start nginx
/usr/sbin/nginx

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