sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
# Set the maximum number of open file descriptors
ulimit -n 20000000
# Set the memory size for TCP with minimum, default and maximum thresholds
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
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
for f in *.example; do | |
cp -- "$f" "${f%.example}" | |
done |
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 removeIllegalCharacters = function(input) { | |
return input | |
.replace(/=/g, '') | |
.replace(/\+/g, '-') | |
.replace(/\//g, '_'); | |
}; | |
var base64object = function(input) { | |
var inputWords = CryptoJS.enc.Utf8.parse(JSON.stringify(input)); | |
var base64 = CryptoJS.enc.Base64.stringify(inputWords); |
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
for x in *.js; do mv "$x" "${x%.js}.jsx"; done |
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
def flatten(list, root = []) | |
list.each do |item| | |
item.is_a?(Array) ? flatten(item, root) : root.push(item) | |
end | |
root | |
end | |
test ".flatten" do | |
list = [[1,2,[3]],4, [9], 11] | |
assert_equal list.flatten, flatten(list) |
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
#!/usr/bin/env bash | |
openssl s_client -connect {hostname}:{port} -showcerts |
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
web: MIX_ENV=prod mix phoenix.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
# Mustafa Turan | |
# coded at 30.11.2015 with NO LICENSE | |
# Feel free to use/modify/distribute/reimplement | |
# node.rb | |
class Node | |
attr_accessor :node_ref | |
attr_reader :val | |
def initialize(node_ref, val) |
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
# remove gitignored files | |
git rm . -r --cached | |
git add . | |
git commit -m "fixed untracked files" |
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
#!/usr/bin/env bash | |
cd /usr/local/src | |
version=2.8.19 | |
wget http://download.redis.io/releases/redis-$version.tar.gz | |
tar xzf redis-$version.tar.gz | |
cd redis-$version | |
make |