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 / pg_test_fsync
Created June 3, 2018 21:07
PostgreSQL Benchmarks with pg_test_fsync on a Samsung 970 Evo 1TB PCIe M.2 2280 SSD
$ uname -a
Linux jay 4.16.12-1-ARCH #1 SMP PREEMPT Fri May 25 23:30:31 UTC 2018 x86_64 GNU/Linux
$ cat /etc/issue
Arch Linux \r (\l)
$ pg_config --version
PostgreSQL 10.4
$ cd /var/lib/postgres/data/
$ pg_test_fsync
5 seconds per test
@pklaus
pklaus / fix_exif_timestamps.py
Last active August 28, 2019 09:56
fix_exif_timestamps
corrected and now to be found at:
https://github.com/pklaus/pklaus/blob/master/pklaus/images/exif/fix_datetime.py
@pklaus
pklaus / LTSpice_RawRead.md
Last active February 19, 2020 21:01
Modified LTSpice_RawRead.py

Modified LTSpice_RawRead.py

Modified LTSpice_RawRead.py found on https://github.com/nunobrum/PyLTSpice as of 2018-04-25.

Changed to support exports like this:

python3 LTSpice_RawRead.py danitest.raw "V(vin),V(vc2),V(n001)" outfile.csv
@pklaus
pklaus / pg_test_fsync
Last active March 12, 2020 15:21
PostgreSQL Benchmarks with pgbench and pg_test_fsync on an Intel Optane 900P 480GB PCIe SSD (w/ Ryzen 3600X amd X570 chipset)
$ uname -a
Linux owl 5.4.8-arch1-1 #1 SMP PREEMPT Sat, 04 Jan 2020 23:46:18 +0000 x86_64 GNU/Linux
$ cat /etc/issue
Arch Linux \r (\l)
$ pg_config --version
PostgreSQL 12.1
$ cd /var/lib/postgres/data/
$ pg_test_fsync
5 seconds per test
@pklaus
pklaus / pg_test_fsync
Last active February 24, 2018 20:07
PostgreSQL Benchmarks with pgbench and pg_test_fsync on a SanDisk Ultra II 240GB SSD
$ uname -a
Linux owl 4.15.3-2-ARCH #1 SMP PREEMPT Thu Feb 15 00:13:49 UTC 2018 x86_64 GNU/Linux
$ cat /etc/issue
Arch Linux \r (\l)
$ pg_config --version
PostgreSQL 10.2
$ cd /var/lib/postgres/data/
$ pg_test_fsync
5 seconds per test
@pklaus
pklaus / README.md
Last active March 13, 2021 14:11
FHEM Auto FileLogConvert - A Python utility to convert all your logfiles one-by-one automatically with 98_FileLogConvert.pm

fhem_auto_import2DbLog

If you want to convert the logs of your FHEM installation from FileLog to DbLog, you may use the excellent 98_FileLogConvert.pm.

What's a bit inconvenient is that each logfile conversion needs to be started by hand. This is the issue, this Python tool solves: You provide it a list of logfiles and the conversion is done one by one automatically.

Why was this tool written in Python (not Perl as FHEM itself)? Because the

@pklaus
pklaus / install-arch-linux-rpi-zero-w.sh
Last active March 13, 2024 23:23 — forked from larsch/install-arch-linux-rpi-zero-w.sh
Install Arch Linux ARM for Raspberry Pi Zero W on SD Card (with commands to configure WiFi before first boot).
#!/bin/sh -exu
dev=$1
cd $(mktemp -d)
function umountboot {
umount boot || true
umount root || true
}
# RPi1/Zero (armv6h):
@pklaus
pklaus / README.md
Last active August 28, 2017 08:58

LUFFT_OPUS20 - EPICS IOC

Installation / Requirements

For this to work, you need some requirements as mentioned here:

  • Python 2.6+ including 3.x
  • Python headers (package name "python-dev" or similar)
  • SWIG 1.3.29+ (package name "swig")
@pklaus
pklaus / simplenote_backup.py
Last active June 14, 2020 00:51
A Python script for backing up your simplenote notes.
#!/usr/bin/env python
import simplenote
import os, json
from datetime import date, datetime as dt
def main():
import argparse, getpass
parser = argparse.ArgumentParser()
@pklaus
pklaus / rpi3-arch-linux-to-sdcard.sh
Last active February 3, 2023 01:58
Raspberry Pi 3: Arch Linux ARM 64bit to SDcard Script. This is for the Rapsberry Pi 3. For the RPi 2 (or the 3 32bit), see https://gist.github.com/pklaus/9dd4a7bf040788cda501 . For the RPi 1, see https://gist.github.com/pklaus/b92dfc72136d1509c2ed .
#!/bin/bash
# <https://archlinuxarm.org/platforms/armv8/broadcom/raspberry-pi-3>
echo -e "\n\nArch Linux ARM to SD Card"
echo -e "For the Raspberry Pi 3, if you want to use the unofficial arm64 variant."
echo -e "(Otherwise use the Raspberry Pi 2 version of this script!)\n\n"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2