Skip to content

Instantly share code, notes, and snippets.

View iainlane's full-sized avatar
🔫
gg nextmap

Iain Lane iainlane

🔫
gg nextmap
View GitHub Profile
#!/usr/bin/python3
import apt
import apt_pkg
def list_esm_package_updates():
""" Find updates which you can install if you enable ESM. """
cache: apt.Cache = apt.Cache()
#!/usr/bin/python3
# Copyright 2021 Canonical Ltd
""" Update all gnome-team repositories to use the given webhooks.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
#!/usr/bin/python3
import lzma
import urllib.request
import yaml
SERIES = "hirsute"
URL = "https://people.canonical.com/~ubuntu-archive/proposed-migration/update_excuses.yaml.xz"
#!/usr/bin/python3
import sys
from gi.repository import Gio, GLib, GObject
SYSTEM_BUS = Gio.bus_get_sync(Gio.BusType.SYSTEM)
class SystemdUnitWatcher:
@iainlane
iainlane / release_ge.sh
Created November 9, 2020 17:41
release_ge shell
#!/bin/sh
distro-info --all | mawk "
/^$1\$/ { l = NR };
/^$2\$/ { r = NR };
END {
if (!l) {
print \"Unknown release $1\" > \"/dev/stderr\";
exit 1;
#!/usr/bin/python3
# Copyright (C) 2020 Canonical Ltd.
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation; version 3
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
#include <stdio.h>
#include <sys/capability.h>
#include <sys/types.h>
#include <unistd.h>
int
main ()
{
pid_t pid;
cap_t caps;
#!/usr/bin/python3
from collections import defaultdict
import lzma
import os
import pprint
import yaml
NEW = "update_excuses_new.yaml.xz"
OLD = "update_excuses_old.yaml"
@iainlane
iainlane / desktop.vala
Created May 1, 2020 13:11
am I in...?
using GLib;
private bool in_desktop (string desktop) {
var env = GLib.Environment.get_variable("XDG_CURRENT_DESKTOP");
if (env == null)
return false;
var desktop_parts = env.split(":");
@iainlane
iainlane / shoulduninstall.py
Last active April 15, 2020 11:54
should we remove this?
#!/usr/bin/python3
import apt
import sys
def should_we_remove(pkg_name):
cache = apt.cache.Cache()
try: