Skip to content

Instantly share code, notes, and snippets.

View ixs's full-sized avatar
👋

Andreas Thienemann ixs

👋
View GitHub Profile
@ixs
ixs / gist:8917626
Created February 10, 2014 15:13
Fetch battery charge values from iCloud
#!/usr/bin/python
from pyicloud import PyiCloudService
api = PyiCloudService('user', 'password')
for dev in api.devices:
print "%-20s %-15s %3i%%" % (dev.content["deviceDisplayName"], dev.content["batteryStatus"], dev.content["batteryLevel"] * 100)
#!/bin/sh
# Wrapper script to run against a CIDR range.
# Andreas Thienemann <athienemann@schubergphilis.com>
#
# Version 5 (Just for Thijs)
if [ -z "$1" ]; then
echo "$0 <CIDR>"
exit 1
fi
#!/usr/bin/python
# Super cheap IGH activity parser.
# GPLv3 or newer.
# Copyright 2017 Andreas Thienemann
#
# Go to the ihg page to the "Account Activity" field. Select "All activity" and "365 days".
# Then click on "Print my account activity". This should open a new window, copy and paste
# everything into a text file called ihg-data.txt.
@ixs
ixs / ssh-blocks-firewalld.sh
Created November 27, 2015 14:02
Download a public blocklist of SSH brute scanning hosts and drop their connection attempts via firewalld
#!/bin/sh
curl -s http://lists.blocklist.de/lists/ssh.txt > /tmp/ssh-ips.txt
if [ "$1" == "--force" ]; then
firewall-cmd --direct --remove-chain ipv4 filter AUTO_BLACKLIST
firewall-cmd --direct --add-chain ipv4 filter AUTO_BLACKLIST
fi
# Create Chains if not available already
The Puri_sm Librem13 mousedriver is available as part of a large kernel source drop at https://github.com/purism/linux.
Unfortunately the git tree there has exactly one commit, containing _everything_, which is rather unfortunate.
This gist has the driver for the BYD BTP-10463 touchpad split out into a separate patch.
Kconfig | 10 +
Makefile | 2
byd.c | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
byd.h | 31 ++++
@ixs
ixs / ssh-blocks-pure-iptables.sh
Created November 27, 2015 14:06
Download a public blocklist of SSH brute scanning hosts and drop their connection attempts via pure iptables
#!/bin/sh
curl -s http://lists.blocklist.de/lists/ssh.txt > /tmp/ssh-ips.txt
if [ "$1" == "--force" ]; then
iptables -F AUTO_BLACKLIST
iptables -A AUTO_BLACKLIST -j RETURN
fi
/usr/sbin/iptables -L AUTO_BLACKLIST -n | awk '/^DROP / { print $4 }' > /tmp/ip_ssh_blocked
#!/usr/bin/python
import bs4 as BeautifulSoup
import collections
import os
import os.path
import requests
import shutil
import subprocess
import sys
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: t -*-
# vi: set ft=python sts=4 ts=4 sw=4 noet :
# (c) Andreas Thienemann 2017
#
# Fail2Ban is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@ixs
ixs / smtpd-multi-proxy.py
Created March 3, 2019 17:53
aio multi backend smtp proxy.
#!/usr/bin/python3
import asyncio
from aiosmtpd.controller import Controller
from aiosmtpd.smtp import SMTP
from pprint import pprint
import email
import smtplib
import string
import random
@ixs
ixs / sample_milter.c
Created April 3, 2019 12:23
setmlreply test
/*
* Copyright (c) 2006 Proofpoint, Inc. and its suppliers.
* All rights reserved.
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the sendmail distribution.
*
* $Id: example.c,v 8.5 2013-11-22 20:51:36 ca Exp $
*/