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
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB | |
#/32 = 496630545 = 473MB | |
#/64 = 248315272 = 236MB | |
#/128 = 124157636 = 118MB | |
#/256 = 62078818 = 59MB | |
#/512 = 31039409 = 29MB | |
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762 | |
#/25165760 = 623 # half of max_connections = 1993.6MB | |
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608 | |
#*(3/4) #default innodb pool size = 11922309120 |
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
server { | |
listen [::]:80; | |
listen 80; | |
server_name app.example.com; | |
return 301 https://$server_name$request_uri; | |
} | |
server { |
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
<?php | |
use Illuminate\Console\Command; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Input\InputArgument; | |
class ClearBeanstalkdQueueCommand extends Command { | |
/** |
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
var CPF = (function () { | |
var eleven = 11; | |
function mod(n) { | |
var t = eleven, | |
a = n % t; | |
return (a < 2 ? 0 : t - n % t) + ''; | |
} |
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
function type(e) { | |
var t = Object.prototype.toString.call(e), | |
r = /\[object (\w+)\]/i.exec(t); | |
return r && r[1].toLowerCase(); | |
} | |
[1,"2", true, null, [], {}, function() {}, undefined].forEach(function(e){ | |
console.log(type(e)) | |
}); |
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
#!/bin/sh | |
# Laravel 5 new project setup bash script. | |
# Inspired by Mitchell van Wijngaarden | |
# Extended by John in 't Hout | |
projectname=$1 | |
git clone -o laravel -b develop https://github.com/laravel/laravel.git ${projectname} >/dev/null | |
cd ${projectname} | |
git checkout --orphan master |
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
{ | |
"title": "collectd-post", | |
"services": { | |
"query": { | |
"list": { | |
"0": { | |
"query": "plugin: \"cpu\" AND plugin_instance: \"0\"", | |
"alias": "cpu1", | |
"color": "#7EB26D", | |
"id": 0, |
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
search-files() { | |
local folder=$(test $# -eq 2 && echo "$1" || echo .) | |
local query=$(test $# -eq 2 && echo "$2" || echo "$1") | |
local IFS=$'\n' | |
for f in $(find "$folder" -type f); do | |
local result=$( | |
cat "$f" | | |
GREP_COLOR='01;32' egrep --color=always -n "$query" | | |
GREP_COLOR='01;33' egrep --color=always "^\d+:" |
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
function subsetSum(numbers, target, partial) { | |
var s, n, remaining; | |
partial = partial || []; | |
// sum partial | |
s = partial.reduce(function (a, b) { | |
return a + b; | |
}, 0); |
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
wget -qO- https://check.torproject.org/exit-addresses | grep ExitAddress | cut -d ' ' -f 2 | sed "s/^/deny /g; s/$/;/g" > /etc/nginx/conf.d/tor-block.conf; systemctl reload nginx |
OlderNewer