Skip to content

Instantly share code, notes, and snippets.

View santeri3700's full-sized avatar

Santeri Pikarinen santeri3700

View GitHub Profile
@santeri3700
santeri3700 / ad_user_photo_on_linux.md
Created November 9, 2024 21:55
Active Directory User Photos on Linux

I've written a neat little script for synchronizing the local user profile picture (also known as "face") on domain joined Linux workstations from Active Directory (thumbnailPhoto user attribute).

It should work on all GNOME based systems and probably on other desktop environments aswell which utilize the AccountsService.

Read more about this on my website: https://santeri.pikarinen.com/posts/ad_user_photo_on_linux/


Usage manually

@santeri3700
santeri3700 / samba_krb5_printing_debian_and_ubuntu.md
Created July 2, 2024 20:20
Samba Printing with CUPS using Kerberos authentication (Debian & Ubuntu)

Samba Printing with CUPS using Kerberos authentication (Debian & Ubuntu)

This guide goes through the steps of installing and configuring a Windows network printer with CUPS on a Debian/Ubuntu desktop machine using Kerberos authentication.

All of the steps here are to be executed on a Debian/Ubuntu desktop machine. Some commands require sudo/pkexec (explicitly mentioned).

Bugs and caveats

  1. AppArmor prevents usage of smbspool_krb5_wrapper: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=998327
    • The "usr.sbin.cupsd" AppArmor profile must be modified to allow CUPS to execute smbspool_krb5_wrapper
  • The workaround below may be overwritten by future updates to the cups-daemon package!
@santeri3700
santeri3700 / uyuni_invalid_deb_repodata_regen.py
Created January 8, 2024 12:56
A script for regenerating Uyuni DEB channel repodata for channels with invalid Packages files (uyuni#7788)
#!/usr/bin/python3
import datetime
import os
try:
from spacewalk.server import rhnSQL
except ImportError:
print("## Could not import spacewalk.server.rhnSQL! This script needs to be run on the Uyuni Server.")
exit(1)
# This script is published under public domain.
@santeri3700
santeri3700 / uyuni_repodata_packages_filename_validator.py
Created November 30, 2023 14:59
A debugging script for checking Uyuni repodata Packages files for invalid Filename paths (uyuni#7788)
#!/usr/bin/python3
import os
# This script is published under public domain.
# Use at your own risk! No warranties provided!
# Author: Santeri Pikarinen (github.com/santeri3700)
# Get list of channel labels (subdirectories) under the repodata directory
# These directories and Packages files are genereated by Taskomatic DebPackageWriter
repodata_channel_labels = os.listdir("/var/cache/rhn/repodata/")