git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
/* ******************************************************************************************* | |
* THE UPDATED VERSION IS AVAILABLE AT | |
* https://github.com/LeCoupa/awesome-cheatsheets | |
* ******************************************************************************************* */ | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
var couchUrl = "foobar"; | |
$.getJSON(couch-url + "view-name-here", function(data) { | |
data.rows.forEach(function (doc) { | |
$.ajax({ | |
url: couch-url + doc.value._id + '?rev=' + doc.value._rev, | |
type: 'DELETE', | |
success: function(result) { | |
console.log("Deleted document with id " + doc.value._id); | |
} | |
}); |
# Outbound UDP Flood protection in a user defined chain. | |
iptables -N udp-flood | |
iptables -A OUTPUT -p udp -j udp-flood | |
iptables -A udp-flood -p udp -m limit --limit 50/s -j RETURN | |
iptables -A udp-flood -j LOG --log-level 4 --log-prefix 'UDP-flood attempt: ' | |
iptables -A udp-flood -j DROP |
git
discard all local changes/commits and pull from upstream
git reset --hard origin/master
git pull origin master
local random = math.random | |
local function uuid() | |
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' | |
return string.gsub(template, '[xy]', function (c) | |
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb) | |
return string.format('%x', v) | |
end) | |
end |