Skip to content

Instantly share code, notes, and snippets.

View adepasquale's full-sized avatar

Andrea De Pasquale adepasquale

View GitHub Profile
@adepasquale
adepasquale / Dockerfile.postfix-catchall
Last active February 22, 2021 08:43
Dockerfile for Postfix server with catch-all configuration
FROM alpine:latest
RUN apk add --no-cache postfix postfix-pcre rsyslog
RUN postconf -e "myhostname=localhost" \
&& postconf -e "mynetworks_style=host" \
&& postconf -e "mail_spool_directory=/var/mail/" \
&& postconf -e "virtual_alias_maps=pcre:/etc/postfix/virtual" \
&& echo "/.*/ root" > /etc/postfix/virtual \
&& postmap /etc/postfix/virtual \
@adepasquale
adepasquale / snort.gp
Last active August 29, 2015 14:22
Gnuplot script for snort.stats file
set title 'Snort dropped packets'
set xlabel 'time'
set ylabel 'dropped packets %'
set grid
set term png
set output 'snort_dropped_packets.png'
set datafile separator ','
plot 'snort.stats' using 1:2 with line lt -1 lw 2
<html>
<head>
<meta charset="UTF-8"/>
<title>XSS</title>
<script>alert("XSS")</script>
</head>
<body>
</body>
</html>
@adepasquale
adepasquale / mailman_tools.py
Created September 28, 2014 17:18
Determine last post sent from each mailman list
#!/usr/bin/env python
'''
http://benjaminjchapman.wordpress.com/2010/06/02/determining-last-post-sent-from-each-mailman-list/
~mailman/bin/withlist -a -r mailman_tools.last_post > mailman_last_posts.csv
'''
import os
import time
print '"Name","Last","Owners"'
@adepasquale
adepasquale / image2spectrogram.py
Created August 30, 2014 18:30
image2spectrogram
#!/usr/bin/python
import cv2
import numpy as np
import wave
import struct
import sys
# usage instructions:
# ./image2spectrogram.py input.png
#!/usr/bin/python
# This script will query a name server nonrecursively
# RFC 1912 recommends that the $TTL value on the name server
# be set to 1 day or longer
# -*- coding: utf-8 -*-
import sys
import dns
from dns.exception import DNSException
from dns.rdataclass import *
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
cmd_name
getenforce
uname
kill
touch
find
unset;rm
la
./screen
ll
@adepasquale
adepasquale / tanawifiew.py
Last active December 22, 2015 20:19
Ever hda a Skyp friendw ho loves typos?
from random import random, choice
import sys
import Skype4Py
class Tanawifiew:
# error probabilities:
p_reorder = 0.01 # wrong key order
p_miss_key = 0.03 # no key press
p_near_key = 0.005 # near key press