Skip to content

Instantly share code, notes, and snippets.

@cuppster
cuppster / node-express-cors-middleware.js
Created April 9, 2012 16:02
express.js middleware to support CORS pre-flight requests
app.use(express.methodOverride());
// ## CORS middleware
//
// see: http://stackoverflow.com/questions/7067966/how-to-allow-cors-in-express-nodejs
var allowCrossDomain = function(req, res, next) {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
res.header('Access-Control-Allow-Headers', 'Content-Type, Authorization');
@Nikolay-st
Nikolay-st / config
Created April 20, 2024 10:54 — forked from etoosamoe/config
SSH Client configuration example | ssh config example
Host *.com
StrictHostKeyChecking no
User etoosamoe
ForwardAgent yes
IdentityFile /Users/username/.ssh/id_rsa
IdentitiesOnly yes
UserKnownHostsFile=/dev/null
UseKeychain yes
AddKeysToAgent yes
ServerAliveInterval 60
@mattmc3
mattmc3 / stdin2args.zsh
Created January 3, 2024 03:15
convert piped input to args
# convert piped input to args
if [[ ! -t 0 ]] && [[ -p /dev/stdin ]] && (( $# == 0 )); then
set -- "${(@f)$(cat)}"
fi
@mattmc3
mattmc3 / plugin-load.zsh
Last active April 20, 2024 10:47
Zsh Unplugged Enhanced
#!/usr/bin/env zsh
##? plugin-load - load plugins without a fancy plugin manager
##?
##? usage: plugin-load [-h|--help]
##? plugin-load [-n|--no-source] [-d|--defer] [-f|--fpath] [-p|--path]
##? [-u|--use-dir <plugin-subdir>] [<repo...>]
function plugin-load {
local use_dir flag_no_source flag_fpath flag_path flag_defer repos=()
@TarlogicSecurity
TarlogicSecurity / kerberos_attacks_cheatsheet.md
Created May 14, 2019 13:33
A cheatsheet with commands that can be used to perform kerberos attacks

Kerberos cheatsheet

Bruteforcing

With kerbrute.py:

python kerbrute.py -domain <domain_name> -users <users_file> -passwords <passwords_file> -outputfile <output_file>

With Rubeus version with brute module:

@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 20, 2024 10:43
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@eatonphil
eatonphil / server.ml
Last active April 20, 2024 10:42
A simple threaded web server in SML
(*
* Tested on PolyML. `polyc server.ml && ./a.out`
*)
fun println s =
(print (s ^ "\n"); TextIO.flushOut TextIO.stdOut)
fun readAll conn req =
let val ntoread = Socket.Ctl.getNREAD conn in
if ntoread > 0
@idriszmy
idriszmy / code.py
Last active April 20, 2024 10:41
Maker Pi RP2040 Mobile Robot: Part 2 - Line Following
#
# Maker Pi RP2040 Mobile Robot: Part 2 - Line Following
#
# Tutorial
# - https://tutorial.cytron.io/
#
# Raspberry Pi Pico
# - Maker Pi Pico https://my.cytron.io/p-maker-pi-pico?tracking=idris
# - LiPo 3.7V 1300mAH https://my.cytron.io/p-lipo-rechargeable-battery-3.7v-1300mah?tracking=idris
# - Maker Line https://my.cytron.io/p-maker-line-simplifying-line-sensor-for-beginner?tracking=idris
@brettohland
brettohland / 1.0 FormatStyle in Excruciating Detail.md
Last active April 20, 2024 10:41
FormatStyle in Excruciating Detail
@bradtraversy
bradtraversy / mongodb_cheat_sheet.md
Last active April 20, 2024 10:39
MongoDB Cheat Sheet

MongoDB Cheat Sheet

Show All Databases

show dbs

Show Current Database