Skip to content

Instantly share code, notes, and snippets.

View dorianim's full-sized avatar
📚
Studying

Dorian Zedler dorianim

📚
Studying
View GitHub Profile
@dorianim
dorianim / README.md
Last active January 19, 2023 15:33
Scripts for Linuxmuster import of custom E-Mail Adresses.

Scripts for Linuxmuster import of custom E-Mail Adresses.

CAUTION!

This may break your LDAP, use at your own risk and only if you know what you are doing!

Usage

  • Put initializeUsersCreatedInLastImport.py, ldapHelper.py and lmnListImportFilterScript.py into /root/scripts on the school server.
  • Link initializeUsersCreatedInLastImport.py to /etc/linuxmuster/sophomorix/hooks/sophomorix-add.d/50-set-firstpassword-and-email.py
  • Go to the WebUI in Globale Einstellungen > Listenimport > Pfad zum Filterskript (at the very bottom)
  • Enter /root/scripts/lmnListImportFilterScript.py into the students.csv field and save
@dorianim
dorianim / README.md
Last active November 30, 2022 12:24
Super simple Huffman text compression in Python and c

Huffman from Python to C

This can be used to encode a string using huffman compression in Python and decode it in Python or c.

@dorianim
dorianim / Dockerfile
Last active February 21, 2022 22:35
Tenda4g09 rebooter
FROM python:3-alpine
RUN pip install tenda4g09
COPY ./run.py /run.py
COPY ./reboot.py /reboot.py
CMD ["/usr/local/bin/python3", "-u", "/run.py"]
@dorianim
dorianim / rmAllDockerContainers.sh
Created February 1, 2022 14:33
Remove all docker containers
for i in $(docker ps -a | cut -f 1 -d ' ' | xargs); do docker rm $i; done
@dorianim
dorianim / UptimeRobotNginxReverseProxy.conf
Created May 6, 2021 08:04
A config for the Nginx reverse proxy for proxying a UptimeRobot status page
server {
set $monitorId <YOUR_ID>;
server_name status.<YOUR_DOMAIN>;
listen 80;
location / {
proxy_set_header Host "stats.uptimerobot.com";
proxy_set_header Accept-Encoding "";
proxy_pass_request_headers on;
#!/usr/bin/python3
import subprocess
import os
import xml.etree.ElementTree as ET
import csv
from datetime import datetime, timedelta
def listWorkstations(school):
"""
Generate a dict with workstations and parameters out of devices file
#!/bin/bash
certificateFile="SomeCert.crt"
certificateName="Some Name"
for certDB in $(find ~/.mozilla* ~/.thunderbird -name "cert9.db")
do
certDir=$(dirname ${certDB});
#log "mozilla certificate" "install '${certificateName}' in ${certDir}"
certutil -A -n "${certificateName}" -t "TCu,Cuw,Tuw" -i ${certificateFile} -d sql:${certDir}
done
@dorianim
dorianim / replaceTRwithQTTRID.py
Created January 19, 2021 16:34
A small python script to switch a Qt .cpp file from "normal" to ID-based translation
#!/usr/bin/python3
import subprocess
inFile = "./frontend/linboosselectionrow.cpp"
with open(inFile, "rt") as fin:
with open("tmp.cpp", "wt") as fout:
translationId = ""
translationIdPrefix = ""
for line in fin: