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
<html> | |
<body> | |
<strong> Hello </strong> | |
</body> | |
</html> |
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
db.currentOp().inprog.ForEach( | |
function(operation) { | |
if(operation.secs_running > 30) db.killOp(operation.opid)) | |
}) |
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
// kills long running ops in MongoDB (taking seconds as an arg to define "long") | |
// attempts to be a bit safer than killing all by excluding replication related operations | |
// and only targeting queries as opposed to commands etc. | |
killLongRunningOps = function(maxSecsRunning) { | |
currOp = db.currentOp(); | |
for (oper in currOp.inprog) { | |
op = currOp.inprog[oper-0]; | |
if (op.secs_running > maxSecsRunning && op.op == "query" && !(/^local/.exec(op.ns))) { | |
print("Killing opId: " + op.opid |
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 Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
require 'sinatra' | |
set :port, 8080 | |
get '/*' do | |
puts "[ECHO] #{request.host}:#{request.port}#{request.path}?#{request.user_agent}" | |
end | |
# redirect port 80 traffic with | |
# sudo iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080 |
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
Xvfb :89 -ac -noreset | |
export DISPLAY=:89 |
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
sudo kill -SIGSTOP 21758 | |
sudo kill -SIGCONT 21758 |
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
# /etc/haproxy.cfg | |
global | |
log 127.0.0.1 local0 | |
... |
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
while true; do STATUS=`curl --output /dev/null -s -w '%{http_code}' https://example.com`; echo "`date` status: $STATUS"; sleep 1; 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
sudo apt-get install git vim terminator tmux aptitude vagrant meld ruby mongodb-server mysql-server redis-server |
NewerOlder