Skip to content

Instantly share code, notes, and snippets.

🐍
Taming Python

Philipp Klaus pklaus

🐍
Taming Python
Block or report user

Report or block pklaus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@pklaus
pklaus / tunnelbroker-net.sh
Last active Oct 11, 2019
tunnelbroker.net automatic tunnel IP update and tunnel setup (on Mac OS X)
View tunnelbroker-net.sh
#!/bin/bash
#### This script is published by Philipp Klaus <philipp.l.klaus@web.de>
#### on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/>
#### It is originally by freese60 and modified by limemonkey.
#### Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0>
### Uncomment this line to debug the script:
#set -x
@pklaus
pklaus / embedding_in_qt5.py
Last active Oct 7, 2019
Embedding Matplotlib Plots in PyQt5
View embedding_in_qt5.py
#!/usr/bin/env python
# embedding_in_qt5.py --- Simple Qt4 application embedding matplotlib canvases
#
# Copyright (C) 2005 Florent Rougon
# 2006 Darren Dale
# with Updates from @boxcontrol
# <http://www.boxcontrol.net/embedding-matplotlib-plot-on-pyqt5-gui.html>
# <https://github.com/boxcontrol/matplotlibPyQt5>
#
@pklaus
pklaus / README.md
Last active Oct 3, 2019
Generating Random MAC Addresses with Python
View README.md

The mini-tool has a CLI-Interface with the following options:

  • Unicast or Multicast? Default: Unicast
  • Locally Administered or Globally Unique? Default: Locally Administered
  • Prescribe specific OUI (overwrites the above two)

TODO

  • Add an option to generate a number of MACs without collisions.
@pklaus
pklaus / ping.py
Created Mar 5, 2011
A pure python ping implementation using raw socket.
View ping.py
#!/usr/bin/env python2
"""
Other Repositories of python-ping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* https://github.com/l4m3rx/python-ping supports Python2 and Python3
* https://bitbucket.org/delroth/python-ping
@pklaus
pklaus / brother_ql - Related and Unrelated Software.md
Last active Sep 24, 2019
brother_ql - Related and Unrelated Software
View brother_ql - Related and Unrelated Software.md
@pklaus
pklaus / sphinx_to_github.sh
Created Jul 11, 2012 — forked from brantfaircloth/sphinx_to_github.sh
Sphinx documentation to github gh-pages without submodules
View sphinx_to_github.sh
# assume the following directory structure where contents of doc/
# and source/ are already checked into repo., with the exception
# of the _build directory (i,e. you can check in _themes or _sources
# or whatever else).
#
# proj/
# source/
# doc/
# remove doc/_build/html if present
@pklaus
pklaus / clearRAM.sh
Last active Sep 18, 2019
A Script to Clear Cached RAM on Linux
View clearRAM.sh
#!/bin/bash
## Bash Script to clear cached memory on (Ubuntu/Debian) Linux
## By Philipp Klaus
## see <http://blog.philippklaus.de/2011/02/clear-cached-memory-on-ubuntu/>
if [ "$(whoami)" != "root" ]
then
echo "You have to run this script as Superuser!"
exit 1
fi
@pklaus
pklaus / remove-orphaned-raw-images.py
Last active Sep 11, 2019
Do you own a DSLR? If so, do you transfer your images to your computer, then look at the JPEGs and delete the crappy ones? If you do, your RAW images may be leftover. This Python script helps you cleaning up your image folders after deleting unwanted JPEGs. See http://blog.philippklaus.de/2012/12/cleaning-leftover-raw-images-after-selecting-imag…
View remove-orphaned-raw-images.py
#!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
"""
This script was moved to
https://github.com/pklaus/pklaus/blob/master/pklaus/images/orphans/remove.py
Here's the original content left for you as a reference:
Do you own a DSLR? If so, do you transfer your images to your computer,
then look at the JPEGs and delete the crappy ones? If you do, your RAW
@pklaus
pklaus / balzerspkg020.py
Last active Sep 9, 2019
Balzers PKG 020 Vacuum Gauge Controller : Analog Out
View balzerspkg020.py
#!/usr/bin/env python
tables = {
'ikr': [
[0.09, 5.00E-008],
[0.24, 1.00E-007],
[0.34, 1.50E-007],
[0.45, 2.00E-007],
[0.67, 3.00E-007],
[0.86, 4.00E-007],
@pklaus
pklaus / StatusIcon.py
Created Feb 15, 2010
StatusIcon – A Simple Tray Icon Application Using PyGTK
View StatusIcon.py
#!/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."
You can’t perform that action at this time.