Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Add this script to your crontab (crontab -e)
# */15 * * * * /path/to/check_adsense.sh
# don't forget to chmod 744
result=$(cat /var/log/nginx/access.log | grep Mediapartners-Google)
if [ -n "$result" ]; then
python send.py
fi
### Keybase proof
I hereby claim:
* I am themvffinman on github.
* I am themuffinman (https://keybase.io/themuffinman) on keybase.
* I have a public key whose fingerprint is CA98 2157 BC23 6E40 1410 7BD7 126D 9DE5 1754 D665
To claim this, I am signing this object:
@THEMVFFINMAN
THEMVFFINMAN / RedComDeleter.py
Last active December 21, 2015 02:36
Reddit-Comment-Deleter
#This will edit all of your reddit comments to be blank and then delete them so the originals will be erased forever
# This gist is now deprecated, go here for the updated version: https://github.com/THEMVFFINMAN/Reddit-History-Eraser
@THEMVFFINMAN
THEMVFFINMAN / BigIntegerRandom
Created January 12, 2015 18:04
BigInteger uniformNumber Random
public BigInteger uniformNumber(BigInteger max) {
// Get the bit count of a number (rounding up)
double bit_count = BigInteger.Log(max, 2);
int length = (int)Math.Ceiling(bit_count);
// Grab some random int from the persisted random instance
int random_int = random.Next();
// Generate some BigInt with at least bit_count above
BigInteger random_number = 0;
@THEMVFFINMAN
THEMVFFINMAN / negcommentdeleter.py
Created May 31, 2015 20:17
Deletes comments with karma below 1
import praw, time
USERNAME = "blendt"
PASSWORD = "MYPASSWORD"
WAIT = 60
WAITS = str(WAIT)
r = praw.Reddit("Comment Deleter")
r.login(USERNAME, PASSWORD)
@THEMVFFINMAN
THEMVFFINMAN / FileValidation
Created June 12, 2015 23:00
Python file validation snippet
def validateFile():
if len(sys.argv) == 2:
filename = sys.argv[1]
if not os.path.isfile(filename):
print '[-] ' + filename + ' does not exist.'
exit(0)
if not os.access(filename, os.R_OK):
print '[-] ' + filename + ' access denied.'
exit(0)
print '[+] Reading Vulnerabilities From: ' + filename
@THEMVFFINMAN
THEMVFFINMAN / PySSHBotnet
Created June 15, 2015 02:08
A not real Py SSH Botnet
import argparse, pxssh
class Client:
def __init__(self, host, user, password):
self.host = host
self.user = user
self.password = password
self.session = self.connect()
@THEMVFFINMAN
THEMVFFINMAN / FTPAnonChecker.py
Created June 15, 2015 02:30
FTP anonymous checker
import ftplib
def anonLogin(hostname):
try:
ftp = ftplib.FTP(hostname)
ftp.login('anonymous', '[email protected]')
print '\n[*] ' + str(hostname) + ' FTP Anonymous Logon Succeeded.'
ftp.quit()
@THEMVFFINMAN
THEMVFFINMAN / PipUpdater.py
Last active August 29, 2015 14:23
Updates all pip libraries
import pip
from subprocess import call
for dist in pip.get_installed_distributions():
call("pip install --upgrade " + dist.project_name, shell=True)
@THEMVFFINMAN
THEMVFFINMAN / PyRecover
Created June 20, 2015 18:10
Find out who deleted what in the Windows Recycle Bin
import os
from _winreg import *
def returnDir():
dirs=['C:\\Recycler\\','C:\\Recycled\\','C:\\$Recycle.Bin\\']
for recycleDir in dirs:
if os.path.isdir(recycleDir):
return recycleDir