Skip to content

Instantly share code, notes, and snippets.

View pklaus's full-sized avatar

Philipp Klaus pklaus

  • Frankfurt, Germany
View GitHub Profile
KartikTalwar /
Last active December 9, 2023 16:53
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
pklaus /
Last active December 2, 2023 20:09 — forked from andreif/Simple DNS server (UDP and TCP) in Python using
Simple DNS server (UDP and TCP) in Python using
#!/usr/bin/env python
import argparse
import datetime
import sys
import time
import threading
pklaus /
Last active November 26, 2023 18:58 — forked from larsch/
Install Arch Linux ARM for Raspberry Pi Zero W on SD Card (with commands to configure WiFi before first boot).
#!/bin/sh -exu
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
# RPi1/Zero (armv6h):
pklaus /
Last active November 19, 2023 07:24
Read your Bash history into a Pandas DataFrame with this Python script.
#!/usr/bin/env python
# -*- encoding: UTF8 -*-
""" Read all entered bash commands ('the history') into a Pandas dataframe
import pandas as pd
import matplotlib.pyplot as plt
from IPython import embed
pklaus /
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 <>: <>
# 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 (
pklaus /
Last active November 3, 2023 15:41
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:
This version has all comments removed for brevity.
import socket
import array
import struct
pklaus /
Last active October 25, 2023 18:21 — forked from shirriff/
Example of controlling a Rigol oscilloscope via Python. Fetch a 1 MB "Long Memory" trace from the oscilloscope and graph it using matplotlib.
#!/usr/bin/env python
Download data from a Rigol DS1052E oscilloscope and graph with matplotlib.
By Ken Shirriff,
Based on
by Cibo Mahto.
pklaus / arduino-due_high-speed-ADC.ino
Last active October 4, 2023 02:20
Arduino Due: ADC → DMA → USB @ 1MSPS
View arduino-due_high-speed-ADC.ino
// Arduino Due ADC->DMA->USB 1MSPS
// by stimmer
// from
// Input: Analog in A0
// Output: Raw stream of uint16_t in range 0-4095 on Native USB Serial/ACM
// on linux, to stop the OS cooking your data:
// stty -F /dev/ttyACM0 raw -iexten -echo -echoe -echok -echoctl -echoke -onlcr
RobbieClarken / EPICS over Flask
Last active September 23, 2023 20:19
EPICS over WebSockets with Flask
View EPICS over Flask


pip install Flask Flask-Sockets gunicorn pyepics


gunicorn -k flask_sockets.worker index:app
pklaus /
Created January 25, 2011 01:08
Automates the steps to set up LXC containers with virtualized environments on Ubuntu Linux
### Bash Script that automates the steps to set up an LXC (Linux Container) boxed environment on Ubuntu Linux
### <>
### More inspiration can be found in <> and in
### <> and
### <>.
### Written by Philipp Klaus <philipp.l.klaus @>