Skip to content

Instantly share code, notes, and snippets.

@caseyavila
caseyavila / hdhr-listings-to-m3u.py
Last active December 8, 2023 03:13 — forked from aaearon/hdhr-listings-to-m3u.py
Convert HDHomeRun Prime Listings to M3U Format
#!/usr/bin/env python3
#
# this script will convert the hdhomerun listings (channels) to
# m3u format for use with external media players. before running
# this script, be sure to modify the <<config>> variable settings
# below.
#
# Suggested Usage: This script should be run on a cron to keep
# the channel lineup to date. Below is an example of how to execute this script:
# python /path/to/script/hdhomerun-prime-listings-to-m3u.py > /path/to/playlist.m3u
@mohakshah
mohakshah / Instructions.md
Last active July 15, 2023 04:58
Building ZFS on Raspberry Pi 3 running Rasbpian

Introduction

This is a tutorial for building and installing the latest release version (0.7.3 as of writing) of "ZFS on Linux" on a Raspberry Pi 3 running Raspbian Stretch. Specifically, we'll be building the dkms version of ZoL, which saves you the hassle of re-compiling the kernel modules after every kernel update. Even though ZoL added support for building dkms packages for debian in version 0.7.3, the build process on a Raspberry Pi 3 is not quite straight-forward. Hopefully, these instructions will make it easier.

Steps

  1. Install the build dependencies.
$ sudo apt-get update
$ sudo apt-get install build-essential autoconf libtool gawk alien fakeroot
$ sudo apt-get install dkms zlib1g-dev uuid-dev libattr1-dev libblkid-dev libselinux-dev libudev-dev libssl-dev parted lsscsi wget ksh
@subhacom
subhacom / cpmd5.sh
Last active September 25, 2023 16:59
rsync and md5sum: Use rsync to copy a directory and then generate a file containing the md5sum of all the files in source directory. Finally do a check of the md5sum of the target.
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: $0 source dest [md5file]"
echo "Copy source directory into dest directory and put md5 sum of the files in source in md5file. "
echo "If no md5 file is unspecified it is created in current directory"
echo
exit 0
fi
source=$1
target=$2
@amroamroamro
amroamroamro / README.md
Last active January 12, 2024 22:12
[Python] Fitting plane/surface to a set of data points

Python version of the MATLAB code in this Stack Overflow post: https://stackoverflow.com/a/18648210/97160

The example shows how to determine the best-fit plane/surface (1st or higher order polynomial) over a set of three-dimensional points.

Implemented in Python + NumPy + SciPy + matplotlib.

quadratic_surface

category value sector
UK production emissions 632 UK
Carbon flows from EU 88 EU
Carbon flows to EU -61 EU
Carbon flows from other Annex 1 82 Annex 1
Carbon flows to other Annex 1 -39 Annex 1
Carbon flows from non-Annex 1 104 Other non-Annex 1
Carbon flows from non-Annex 1 64 China
Carbon flows to non-Annex 1 -25 Non-Annex 1
UK consumption emissions 845 UK