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/bash | |
cd / | |
tar cvpzf system-backup.tgz --exclude=/proc --exclude=/lost+found --exclude=/system-backup.tgz --exclude=/mnt --exclude=/tmp --exclude=/sys / |
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/bash | |
echo "Baned last log" | |
awk '($(NF-1) = /Ban/){print $NF}' /var/log/fail2ban.log | sort | uniq -c | sort -n | |
echo "------------ Baned in all files --------------" | |
zgrep -h "Ban " /var/log/fail2ban.log* | awk '{print $NF}' | sort | uniq -c | |
echo "------------ Baned by subnet --------------------" | |
zgrep -h "Ban " /var/log/fail2ban.log* | awk '{print $NF}' | awk -F\. '{print $1"."$2"."}' | sort | uniq -c | sort -n | tail | |
echo "------------ Baned by date -------------------------" | |
zgrep -h "Ban " /var/log/fail2ban.log* | awk '{print $5,$1}' | sort | uniq -c |
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
// Constructor | |
var Class = function (value1, value2) { | |
this.value1 = value1; | |
}; | |
// properties and methods | |
Class.prototype = { | |
value1: 'default_value', | |
method: function (argument) { | |
this.value2 = argument + 100; |
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
// Constructor | |
var Class = function(value1, value2) { } | |
// Factory | |
Class.factory(value1) { | |
return new Class(value1, 'aaa'); | |
}; | |
// properties and methods | |
Class.prototype = { ... }; |
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 Singleton = (function () { | |
var privateVariable = 'value'; | |
function privateFunction() { | |
} | |
function publicFunction() { | |
} | |
return { |
-
https://blog.nodeswat.com/implement-access-control-in-node-js-8567e7b484d1#.kmx6akt2a
-
https://www.nginx.com/blog/5-performance-tips-for-node-js-applications/
-
https://www.owasp.org/images/f/fa/AppSecIL2016_NodeJS-Security_LiranTal.pdf
-
https://nodesource.com/blog/nine-security-tips-to-keep-express-from-getting-pwned/
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
const bodyParser = require('body-parser'); | |
const express = require('express'); | |
const app = express(); | |
const multer = require('multer'); | |
const upload = multer(); | |
app.use(bodyParser.json()); | |
var router = express.Router(); |
OlderNewer