- 进入你的
home
目录
cd ~
- 编辑
.bashrc
文件
How Port Knocking Maker - Mikrotik Script RouterOS | |
In computer networking, port knocking is a method of externally opening ports on a firewall by generating a connection attempt on a set of prespecified closed ports. Once a correct sequence of connection attempts is received, the firewall rules are dynamically modified to allow the host which sent the connection attempts to connect over specific port(s). A variant called single packet authorization (SPA) exists, where only a single "knock" is needed, consisting of an encrypted packet. | |
The primary purpose of port knocking is to prevent an attacker from scanning a system for potentially exploitable services by doing a port scan, because unless the attacker sends the correct knock sequence, the protected ports will appear closed | |
########################################################### | |
# Mikrotik Port Knocking Generator with Icmp + Packet Size | |
# Date/Time: 2/14/2021, 12:14:10 PM | |
# https://fb.me/buananet.pbun | |
################################################## |
# delete local tag '12345' | |
git tag -d 12345 | |
# delete remote tag '12345' (eg, GitHub version too) | |
git push origin :refs/tags/12345 | |
# alternative approach | |
git push --delete origin tagName | |
git tag -d tagName |
function $dataAttr (nameWithData) { | |
const originAttr = nameWithData.replace(/[A-Z]/g, $0 => '-' + $0.toLowerCase()) | |
return originAttr.replace(/^data-/, '').replace(/-([a-z])/g, ($0, $1) => $1.toUpperCase()) | |
} | |
// nameWithData ----> dataSetName | |
// originAttr ----> data-set-name | |
// return ----> setName |
// Map 是 构造函数是 var a = new Map([ [key1, value1], [key2, value2] ]) | |
// key1只要与key2不是同一个引用就不会覆盖。 key1 与key2 可以是任何类型。 | |
// WeakMap 不会进入到垃圾回收机制,当key值清空会自动回收,不进入垃圾回收(垃圾回收里面只要存在引用就不可以被回收,这样可以防止内存泄漏) |
使用::和es5的bind&&call&&apply的区别。 | |
使用call bind apply 不是一种面向oo的编程方式,所以会导致什么问题呢? 无法链式调用,这就很蛋疼了。 | |
所以::操作符的一部分作用就是可以面向oo编程,可以链式调用。 | |
example | |
fn2.bind(fn1.bind(this, a1)(argu1))(argu2) 恶心不?很恶心 | |
this::fn1(argu1)::fn2(argu2) OK,链式调用。 |
function express() { | |
var middlewares = []; | |
var app = function(req, res) { | |
var i = 0; | |
function next() { | |
var task = middlewares[i++]; | |
if (!task) { | |
return; |
function Event() { | |
this.fnMap = {}; | |
} | |
Event.prototype.on = function(type, fn) { | |
var fns = this.fnMap[type] || (this.fnMap[type] = []) | |
fns.push(fn); | |
return this; | |
}; |
function addListener(element, type, handler) { | |
if (element.addEventListener) { | |
element.addEventListener(type, handler, false); | |
return handler; | |
} else if (element.attachEvent) { | |
var wrapper = function() { | |
var event = window.event; | |
event.target = event.srcElement; | |
handler.call(element, event); | |
} |
function deepClone(obj) { | |
var o = obj instanceof Array ? [] : {}; | |
for (var name in obj) { | |
o[name] = typeof obj[name] === 'object' ? deepClone(obj[name]) : obj[name]; | |
} | |
return o; | |
} |