Skip to content

Instantly share code, notes, and snippets.

cat file | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*"*
curl http://host.xx/file.js | grep -Eo "(http|https)://[a-zA-Z0-9./?=_-]*"*
@n3s7or
n3s7or / test_port.sh
Last active February 5, 2021 18:13
Simple bash script to check if a port is opened, and alert over Telegram if it is not.
#!/bin/bash
delay=10
app=$0
usage() {
printf "$app -h HOST -p PORT -i ID -t TOKEN
-i ID : 'chat_id' to send notification to
-t TOKEN : bot TOKEN to send notification from
# Run the last command as root
sudo !!
# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer
# Save a file you edited in vim without the needed permissions
:w !sudo tee %
# change to the previous working directory
cd -
# Runs previous command but replacing
^foo^bar