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)
@ixs
ixs / ssltest.py
Last active February 28, 2020 21:41
Heartbleed test with data dump functionality.
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
#
# Modified slightly by Andreas Thienemann <[email protected]> for clearer exploit code
# and 64k reads
#
# This version of the exploit does write received data to a file called "dump" in the local directory
# for analysis.
#!/bin/sh
# Wrapper script to run against a CIDR range.
# Andreas Thienemann <[email protected]>
#
# Version 5 (Just for Thijs)
if [ -z "$1" ]; then
echo "$0 <CIDR>"
exit 1
fi
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-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
@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
@ixs
ixs / ipmi_sel_housekeeping.sh
Created November 30, 2015 00:54
Clear the IPMI SEL log before it gets full and synchronize the system time.
#!/bin/sh
# Clear the system event log on the BMC when it is more than 80% full.
THRESH=80
SEL_STATE=$(/usr/bin/ipmitool sel info 2> /dev/null)
if [ $? -ne 0 ]; then
echo Problem fetching SEL info.
#!/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 / cimc_kvm.py
Created November 8, 2018 13:28
Commandline KVM viewer for Cisco UCS CIMC
#!/usr/bin/python
import Crypto.Hash
import Crypto.Hash.HMAC
import Crypto.Hash.SHA512
import Crypto.Random
import Crypto.Cipher
import base64
import collections
import hashlib
#!/usr/bin/python
import bs4 as BeautifulSoup
import collections
import os
import os.path
import requests
import shutil
import subprocess
import sys