This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Copyright 2018, Florent Thiery | |
import gi | |
import sys | |
gi.require_version('Gst', '1.0') | |
from gi.repository import Gst, GLib | |
Gst.init(None) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import argparse | |
import os | |
import sys | |
parser = argparse.ArgumentParser( | |
formatter_class=argparse.ArgumentDefaultsHelpFormatter | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
add-apt-repository universe | |
apt update | |
apt full-upgrade -y | |
apt install -y cockpit packagekit ifupdown | |
apt purge --auto-remove -y netplan.io | |
mkdir -p /etc/NetworkManager/conf.d | |
touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# run this a local checkout of https://github.com/LineageOS/lineage_wiki/tree/master/_data/devices | |
import yaml | |
import glob | |
import datetime | |
def get_year(d): | |
if isinstance(d, list): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from gi.repository import Gio, GLib | |
import shlex | |
import signal | |
priority = GLib.PRIORITY_DEFAULT | |
class ProcessLauncher: | |
def run(self, cmd): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import sys | |
import telnetlib | |
class SMP351: | |
commands = ['get_state', 'start_record', 'stop_record'] | |
def __init__(self, args): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# you can add an alias to your bashrc to check that packages build | |
# alias makepkg_check = 'docker build -f /path/to/this/Dockerfile.archtest .' | |
FROM archlinux:latest | |
RUN pacman -Sy && pacman -S --noconfirm --noprogressbar --quiet --needed \ | |
base-devel sudo | |
RUN useradd --create-home build --home-dir /build && echo "build ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/build | |
USER build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# ripoff of https://github.com/RoryMearns/Windsurf_Calculator/blob/master/javascript/windcalc.js | |
weight_kg = 70 | |
sail_alpha = 1.34 | |
fin_alpha = 4.9383 | |
fin_extra = 3.0988 | |
def get_sail(wind): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
if [ $# -lt 1 ]; then | |
echo 1>&2 "$0: Need zip file argument, e.g. sudo ./arch_install.sh nudgis-obs-plugin-linux-ubuntu-20.04-64_27.2.4_1.0.0.zip" | |
exit 2 | |
fi | |
DIR=tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import requests | |
import json | |
from datetime import datetime, timedelta | |
url = 'https://cfp.pass-the-salt.org/pts2022/schedule/export/schedule.json' | |
d = requests.get(url).json() |