Skip to content

Instantly share code, notes, and snippets.

@promolic1
promolic1 / nginx.conf
Created October 10, 2015 02:47 — forked from toomasr/nginx.conf
nginx configuration for the Wordpress blog post
upstream servers-frontend {
ip_hash;
server 10.10.137.100:80; # server-1
server 10.10.126.101:80; # server-2
}
upstream server-2 {
server 10.10.137.101:80;
}
@promolic1
promolic1 / README.md
Created October 7, 2015 23:43 — forked from EugeneKay/README.md
Winode Instructions
@promolic1
promolic1 / iptcheck.py
Last active August 29, 2015 14:06 — forked from ko-zu/iptcheck.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 ko-zu <causeless@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
import urlparse
import argparse
import redis
import sys
from multiprocessing import Pool
import signal
def parse_redis_url(s):
url = urlparse.urlparse(s)
if not url.scheme:
<?php
class InlineImages {
/** IE cannot display inline data larger than 32KiB
also processing large images would take too much time */
const SIZE_LIMIT = 32768;
/** Regular expression to find URL definitions in CSS file */
const REGEXP = '/(background(-image)?|list-style(-image)?|cursor):\ ?url\(([\'\"]?([^\'\)]+)[\'\"]?)\)/im';
const REGIND = 5; //index of matching parenthesis where URL can be found
@promolic1
promolic1 / vpnsetup.sh
Created February 24, 2014 04:09 — forked from hwdsl2/.MOVED.md
#!/bin/sh
#
# Amazon EC2 user-data file for automatic configuration of IPsec/L2TP VPN
# on a Ubuntu server instance. Tested with 12.04.
#
# DO NOT RUN THIS SCRIPT ON YOUR PC OR MAC! THIS IS MEANT TO BE RUN WHEN
# YOUR AMAZON EC2 INSTANCE STARTS!
#
# Copyright (C) 2014 Lin Song
# Based on the work of Thomas Sarlandie (Copyright 2012)
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
var Twit = require("twit");
var config = require('./oauthconfig');
console.log("config:");
console.log(config);
var T = new Twit({
consumer_key: config.consumer_key,
consumer_secret: config.consumer_secret,
access_token: config.access_token,
# Twilio HTTP HAProxy Configuration
# Version: 0.1
global
daemon
log 127.0.0.1 local0 info
maxconn 60000
spread-checks 3