Skip to content

Instantly share code, notes, and snippets.

@dp7k
dp7k / socket-server.py
Created February 20, 2017 21:42
A simple socket server written in Python. Edit the '_do_stuff' function in the 'Client_Thread' class to play with the received data.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import signal
import socket
import threading
class Client_Thread:
def __init__(self, c_socket, addr, debug=False):
@dp7k
dp7k / amazon-price-fetcher.py
Last active February 16, 2017 18:50
Simple script to watch Amazon.de prices. Optionally store them in your database and make crazy shit.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import requests
'''
URLs
https://www.amazon.de/gp/aw/d/B003SGEPRW
https://www.amazon.de/dp/B003SGEPRW
@dp7k
dp7k / mail.py
Created October 30, 2015 19:37
simple mail function
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from smtplib import SMTP
from email.utils import formatdate
import socket # catch socket.error
def send_mail(recipent, sender, subject, body, server_addr='127.0.0.1', server_port=25):
"""
Send a simple email
@dp7k
dp7k / brute-force-dictionary-generator.py
Created September 12, 2015 13:26
wordlist/dictionary generator for brute-force attacks
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import hashlib
import itertools
import string
# generator
def brute_force_generator(chars, max_length):
# yyyy-mm-dd_$
[1-4{[exifExif.Image.DateTime]}]-[6-7{[exifExif.Image.DateTime]}]-[9-10{[exifExif.Image.DateTime]}]_$
@dp7k
dp7k / gist:dd4a1460a57aeec46764
Created May 10, 2015 11:12
disable indexing of Tracker
gsettings set org.freedesktop.Tracker.Miner.Files crawling-interval -2
gsettings set org.freedesktop.Tracker.Miner.Files enable-monitors false
tracker-control -r
-c 'aäbcdefghijklmnoöpqrstuüvwxyzAÄBCDEFGHIJKLMNOÖPQRSTUÜVWXYZ0123456789-_/@'
@dp7k
dp7k / gist:c66b695b0c51bf36bf0e
Created April 30, 2015 17:18
cli Lotto ("6aus49")/Eurojackpot lottery random number generator
alias eurojackpot='echo $(shuf -i 1-50 -n 5|sort -n|tr "\n" " ") \| $(shuf -i 1-10 -n 2|sort -n|tr "\n" " ")'
alias lotto='echo $(shuf -i 1-49 -n 6|sort -n|tr "\n" " ")'
@dp7k
dp7k / bitcoin-exchange-rate.py
Created April 2, 2015 23:57
bitcoin exchange rate
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import requests, json
API_URL_BASE = 'https://api.bitcoinaverage.com/ticker/global/'
CURRENCY = 'EUR'
r = requests.get(API_URL_BASE + CURRENCY, verify=True)
j = r.json()
@dp7k
dp7k / axfr.sh
Last active August 29, 2015 14:18
query domain's nameservers for zone/axfr
#!/bin/sh
ME="${0}"
FAIL='Transfer failed.'
count=$#
help() {
echo "USAGE:
${ME} domain[s]