Skip to content

Instantly share code, notes, and snippets.

View ScoreUnder's full-sized avatar

score ScoreUnder

View GitHub Profile
@ScoreUnder
ScoreUnder / lowstate_dep_graph.py
Created November 22, 2017 13:29
Convert salt lowstate to graphviz format
#!/usr/bin/env python3
import itertools
import yaml
import sys
class MultiDict(dict):
def add(self, key, value):
if key not in self:
self[key] = []
self[key].append(value)
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
int chday(int day, int month, int year);
int chmonth(int month);
int chyear(int year);
int leapYear(int y);
int day_of_year(int d, int m, int y);
int chday(int day, int month, int year) {
@ScoreUnder
ScoreUnder / bad-pythons.sh
Created June 26, 2023 06:18
Find bad Python AUR packages on Arch Linux
#!/bin/sh
# Find bad Python AUR packages on Arch Linux
# Simply run the script and it should show you what needs updating
# Non-destructive. Arch Linux only. Will show incorrect results when multiple Python versions are installed side by side.
# Intended to provide tech support to people updating complex python projects from the AUR
real_python_dir=$(pacman -Ql python | grep /usr/lib/python | head -1 | cut -d/ -f-4 | cut -d' ' -f2)
set -- /usr/lib/python3.*
for d do
if [ -e "$d" ] && [ "$d" != "$real_python_dir" ]; then
set -- "$@" "$d"