This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Safer way to edit cron so you don't mistakenly REMOVE the entire crontab | |
# with crontab -r when you meant to type crontab -e | |
# Also provides useful diff of your changes | |
ts=$(date +%s) | |
before=/tmp/`whoami`_crontab_before_$ts | |
after=/tmp/`whoami`_crontab_after_$ts | |
crontab -l > $before |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Example: find /path/ -type f -mtime +5 | xargs ls -l | sumls | |
awk '{ sum += $5 } END { print "total: " (sum / 1024 / 1024) " MB" } ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
df -Ph | column -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alphabet = { | |
'0': 'e', | |
'00':'i', | |
'000':'s', | |
'0000':'h', | |
'00000':5, | |
'00001':4, | |
'0001':'v', | |
'00011':3, | |
'001':'u', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# crontab example: | |
# 30 20 * * * echo "" > /tmp/bar ; /data/network-debugging/ls-logger.sh | |
# 30 08 * * * echo 1 > /tmp/bar | |
INPUT_DIR=/data/foobar/input | |
DTM="$(date +%Y-%m-%d-%H-%M)" | |
LOGFILE="/data/network-debugging/ls.log-$DTM" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ seddiff 's/redcarpet/magiccarpet/;s/pygments/rouge/' _config.yml | |
Result of s/redcarpet/magiccarpet/;s/pygments/rouge/ against _config.yml: | |
7,8c7,8 | |
< markdown: magiccarpet | |
< highlighter: rouge | |
--- | |
> markdown: redcarpet | |
> highlighter: pygments | |
54c54 | |
< - magiccarpet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msf> search foobar | |
1 post/windows/foobar Blaa blaa desc here | |
2 post/multi/kek/buufar Another exploit | |
3 exploit/solaris/mcfoo For solaris | |
msf> use 1 | |
post/windows/foobar> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<folders> | |
<folder> | |
<title>oscp</title> | |
<snippets> | |
<snippet> | |
<title>spawn tty</title> | |
<content>python -c 'import pty;pty.spawn("/bin/bash")'</content> | |
</snippet> | |
<snippet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Host *.labs.overthewire.org | |
SendEnv WECHALLTOKEN | |
SendEnv WECHALLUSER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SimpleHTTPServer | |
import SocketServer | |
import logging | |
import cgi | |
import sys | |
if len(sys.argv) > 2: | |
PORT = int(sys.argv[2]) |