Skip to content

Instantly share code, notes, and snippets.

@mattmc3
mattmc3 / foo.zsh
Created February 3, 2023 01:38
Zsh collect args
# Collect args
# -- traditional, piped|, <redirected
function collect_args {
local data args=()
if [[ ! -t 0 ]]; then
while IFS= read -r data || [[ -n "$data" ]]; do
args+=("$data")
done
fi
@xirixiz
xirixiz / Set up GitHub push with SSH keys.md
Last active April 20, 2024 11:01 — forked from developius/README.md
Set up GitHub push with SSH keys

SSH keypair setup for GitHub (or GitHub/GitLab/BitBucket, etc, etc)

Create a repo.

Make sure there is at least one file in it (even just the README.md)

Generate a SSH key pair (private/public):

ssh-keygen -t rsa -C "your_email@example.com"

💖✨ Step into a magical realm of technology where Dockew orchestrates a symphony of sewvices! 🐳✨ With a flick of youw command wand (docker-compose up -d), summon vibwant enewgies of containews, like spiwits fwom the etheweal plane. 🌟 In the swirling mists of the tewminyaw, beckon fowth the spiwit of an Uwuntu mage, adorned with sacred wobes of Apache and mysticaw wunes of SSH. 🧙‍ ♂️🔮 Then, weave a bwidge between wowlds with ssh -L 80:localhost:80 root@ubuntu2, cweating a pathway of wight thwough space and time. 🌈🌐

docker compose up -d
docker exec -it 6af7afd6e6b1 /bin/bash
@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.