This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref http://stackoverflow.com/questions/3297196/how-to-set-up-a-squid-proxy-with-basic-username-and-password-authentication | |
# first install apache: | |
# $ sudo apt-get install -y apache2-utils | |
# add these five lines to /etc/squid3/squid.conf | |
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwords | |
auth_param basic realm proxy | |
acl authenticated proxy_auth REQUIRED | |
http_access allow authenticated | |
http_port 3128 # or whatever you like |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["f12"], "command": "htmlprettify"}, | |
{ "keys": ["f1"], "command": "fold" }, | |
{ "keys": ["f2"], "command": "unfold" }, | |
{ "keys": ["ctrl+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": "@"} }, | |
{ "keys": ["ctrl+space"], "command": "auto_complete" }, | |
{ "keys": ["ctrl+space"], "command": "replace_completion_with_auto_complete", "context": | |
[ | |
{ "key": "last_command", "operator": "equal", "operand": "insert_best_completion" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set $posting 0; # Make sure to declare it first to stop any warnings | |
if ($request_method = POST) { # Check if request method is POST | |
set $posting N; # Initially set the $posting variable as N | |
} | |
if ($geoip_country_code ~ (BR|CN|KR|RU|UA) ) { # Here we're using the Nginx GeoIP module to block some spammy countries | |
set $posting "${posting}O"; # Set the $posting variable to itself plus the letter O | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var elasticsearch = require('elasticsearch'); | |
var Promise = require('bluebird'); | |
var log = console.log.bind(console); | |
var client = new elasticsearch.Client({ | |
host: 'localhost:9200', | |
log: 'trace' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<style>pre { white-space: inherit }</style> | |
<pre id="log"></pre> | |
<div id="ports" style="visibility: hidden; height: 0; width: 0;"></div> | |
<iframe src="about:blank" name="x" id="x" style="display: none;"></iframe> | |
</body> | |
<script> | |
var electrum = { | |
logbreak: function() { e = document.createElement('br'); document.getElementById('log').appendChild(e); }, | |
log: function(s) { e = document.createElement('span'); e.innerText = s+" "; document.getElementById('log').appendChild(e); }, |