Skip to content

Instantly share code, notes, and snippets.

@HowardMei
HowardMei / syncthing
Created October 17, 2015 18:14 — forked from arudmin/syncthing
/etc/init.d/syncthing script for Raspberry Pi (or any Ubuntu/Debian)
#!/bin/sh
### BEGIN INIT INFO
# Provides: syncthing
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of syncthing.

Business Models

Advertising

Models Examples
Display ads Yahoo!
Search ads Google
#!/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=.

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.

@HowardMei
HowardMei / gist:7716565
Created November 30, 2013 08:06
Nginx separate module locations
echo-nginx-module https://github.com/agentzh/echo-nginx-module
headers-more-nginx-module https://github.com/agentzh/headers-more-nginx-module
nginx-http-concat https://github.com/alibaba/nginx-http-concat
ngx_http_substitutions_filter_module https://github.com/yaoweibin/ngx_http_substitutions_filter_module
ngx_cache_purge https://github.com/FRiCKLE/ngx_cache_purge
ngx_devel_kit https://github.com/simpl/ngx_devel_kit
nginx-http-user-agent https://github.com/alibaba/nginx-http-user-agent
nginx-http-footer-filter https://github.com/alibaba/nginx-http-footer-filter
nginx-backtrace https://github.com/alibaba/nginx-backtrace
ngx_http_image_water_filiter_module https://github.com/wangmh/ngx_http_image_water_filiter_module
@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

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 / 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
@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