Skip to content

Instantly share code, notes, and snippets.

View pklaus's full-sized avatar

Philipp Klaus pklaus

  • Frankfurt, Germany
View GitHub Profile
@pklaus
pklaus / enumerate_interfaces.py
Last active March 15, 2024 15:32
Python: List all Network Interfaces On Computer
"""
Determine IPv4 addresses on a Linux machine via the socket interface.
Thanks @bubthegreat the changes to make it Py2/3 compatible and the helpful
code comments: https://gist.github.com/pklaus/289646#gistcomment-2396272
This version has all comments removed for brevity.
"""
import socket
import array
import struct
@pklaus
pklaus / analyseBreakinAttempts.sh
Last active September 20, 2022 10:32
A script that analyses the log files /var/log/auth.log* for illegal break-in attempts and writes all output to $logdir – Check http://blog.philippklaus.de/2010/02/analyse-illegal-ssh-login-attempts/
#!/bin/bash
# This script analyses the log files /var/log/auth.log* for
# illegal break-in attempts and writes all output to $logdir.
# <http://blog.philippklaus.de/2010/02/analyse-illegal-ssh-login-attempts/#comment-12211>
# inspired by <http://goo.gl/QMOhiU>
# and <http://filipivianna.blogspot.com/2009/10/checking-authlog-for-ssh-brute-force.html>
logbasedir=~/logs
@pklaus
pklaus / get_resources.sh
Created February 9, 2010 20:39
Write a Linux Server Resource Report to Log Files Automatically
#!/bin/sh
# /root/bin/get_resources.sh
echo -n "Server Resource Report at `/bin/hostname` on "
date "+%Y/%m/%d %T"
echo
echo "[dmesg Linux version]"
dmesg | grep "Linux version"
@pklaus
pklaus / StatusIcon.py
Created February 15, 2010 20:36
StatusIcon – A Simple Tray Icon Application Using PyGTK
#!/usr/bin/env python
# found on <http://files.majorsilence.com/rubbish/pygtk-book/pygtk-notebook-html/pygtk-notebook-latest.html#SECTION00430000000000000000>
# simple example of a tray icon application using PyGTK
import gtk
def message(data=None):
"Function to display messages to the user."
@pklaus
pklaus / 10-aiptek.fdi
Created February 20, 2010 10:13
Working Configuration File for an Aiptek HP 12000u Tablet on Ubuntu 9.10 karmic
<?xml version="1.0" encoding="UTF-8"?> <!-- -*- SGML -*- -->
<!-- Philipp Klaus (c) 2010 -->
<!-- Aiptek HP 12000U - working with pressure sensitivity in GIMP (activate using Edit -> Preferences -> Input Devices -> Configure Extended Input Devices -> stylus, Mode: Screen ) -->
<!-- installation
Get the required kernel module:
sudo aptitude install xserver-xorg-input-aiptek
and copy this file into 10-aiptek.fdi:
sudo gedit /etc/hal/fdi/policy/10-aiptek.fdi
-->
<deviceinfo version="0.2">
@pklaus
pklaus / keyring.py
Created February 21, 2010 10:51
Use the Gnome Keyring in a Python program
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Gnome Keyring in Python
# Shows how to store credentials of type NETWORK_PASSWORD using python.
# Found on <http://www.rittau.org/blog/20070726-01>
# More on the GNOME Keyring: <http://live.gnome.org/GnomeKeyring>
# alternatively have a look at the new universal and actively developed Python Keyring:
# on <http://pypi.python.org/pypi/keyring> and <http://home.python-keyring.org/>
@pklaus
pklaus / README.md
Last active December 4, 2022 14:33
README and manual page from Intel Linux Driver e1000e v3.0.4.1

e1000e Linux* Base Driver for Intel® Network Connection

================================================================================

January 13, 2014

================================================================================

@pklaus
pklaus / gist:319524
Created March 2, 2010 14:10
Greasemonkey User Script to download PDF files posted in a WebCT class folder
// Frankfurt University WebCT Downloader
// 17-05-2008
// Copyright (c) 2008, Marc Powell <marc DOT powell AT yahoo DOT com>
//
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// Allows Iowa State University distance-education students to download
@pklaus
pklaus / tds-2012.py
Created March 3, 2010 12:44
Python plot display of Tektronix TDS-2012 Digital Sampling Oscilloscope (or other TDS-10xx or TDS-20xx DSO)
#!/usr/bin/env python
# found on <http://www.febo.com/geekworks/data-capture/tds-2012.html>: <ftp://ftp.febo.com/pub/n8ur_programs/tds-2012.py>
# tds-2012.py
# version 0.1 -- 27 Jan 2004
#
# Plot display of Tektronix TDS-2012 (or other TDS-10xx or TDS-20xx DSO)
#
# Copyright 2004 by John R. Ackermann N8UR (jra@febo.com)
@pklaus
pklaus / babelfish.py
Created March 4, 2010 03:07
Babelfish Translator for Symbian Phones (using PyS60).
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
# originally from whitetiger on <http://snippets.dzone.com/posts/show/3047>
# modified 2010 by Philipp Klaus <philipp.l.klaus AT web-dot-de>
import urllib
####################################################################################### <BabelFish>
class BabelFish(object):