Skip to content

Instantly share code, notes, and snippets.

View binwiederhier's full-sized avatar

Philipp C. Heckel binwiederhier

View GitHub Profile
@binwiederhier
binwiederhier / weather_alert.py
Last active November 29, 2023 01:43
Alerts via ntfy.sh with a "pipe freeze alert" when the temperature in the next 3 days falls below a threshold
#!/usr/bin/env python3
import json
from datetime import datetime
import requests
latitude = 25.2510383
longitude = 55.2936404
threshold = -4
ntfy_url = "https://ntfy.sh/mytopic"
import json
import os
import requests
def download_file(url, file_path):
response = requests.get(url)
with open(file_path, 'wb') as file:
file.write(response.content)
def find_new_entries(current_file, previous_file):
module bla
go 1.18
require github.com/urfave/cli/v2 v2.4.8
require (
github.com/BurntSushi/toml v1.1.0 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
#!/bin/bash
PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/phil/.bin"
RSYNC_ROOT_EXCLUDES="
--exclude /cdrom/
--exclude /dev/
--exclude /exports/
--exclude /proc/
--exclude /run/
--exclude /sys/
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
apt-get install debootstrap
fdisk /dev/sdb
o
n
<return>
<return>
<return>
w
# apt-add-repository ppa:zfs-native/stable
# apt-get update
# apt-get install ubuntu-zfs
# apt-get install debootstrap
HOST=vm1
DISKS="/dev/disk/by-id/ata-Samsung_SSD_850_EVO_120GB_S21UNSAG310692M"
zpool create \
-f \
@binwiederhier
binwiederhier / README.md
Created January 13, 2016 00:22
Unattended single disk resize
  1. Create /usr/share/initramfs-tools/hooks/parttools as above
  2. Run update-initramfs -u
  3. Reboot
  4. Type e on the Grub2 boot menu entry
  5. Add break=mount to the kernel line
  6. In initramfs, run this (assuming /dev/sda1 is the to-be-resized disk):
e2fsck -f /dev/sda1
resize2fs /dev/sda1 20G
# ./resilver
[So 4. Okt 22:02:28 BST 2015] Activating slow mirror ... OK
[So 4. Okt 22:02:39 BST 2015] Waiting 60 seconds for resilvering to start ... OK
[So 4. Okt 22:03:39 BST 2015] Waiting for resilvering to finish ..................................... OK
[So 4. Okt 22:05:22 BST 2015] Activating slow mirror ... OK

Keybase proof

I hereby claim:

  • I am binwiederhier on github.
  • I am binwiederhier (https://keybase.io/binwiederhier) on keybase.
  • I have a public key whose fingerprint is 75BE 1D97 01CD E8D3 ECC2 4630 E002 DC57 375E 60F1

To claim this, I am signing this object: