Skip to content

Instantly share code, notes, and snippets.

Cybso / stylebot-noz.css
Last active February 1, 2024 15:50
Stylebot-CSS für als Listenanzeige
* Quick-and-dirty CSS-Anweisungen für Stylebot, um das
* neue mehrspaltige Layout der NOZ ( in eine Listenanzeige
* umzuformen.
* Chrome:
* Firefox:
.grid {
#!/usr/bin/env python3
Exports group addresses from ETS Inside project. Usage:
python3 path/to/project
import sys
import json
import xml.etree.ElementTree as ET
Cybso / sort-access-log
Last active April 11, 2024 11:10
Sort apache access logs and convert 'common' into 'combined'. The output of this script can be used as input for awffull or webalizer.
# Sorts the rows of one or multiple apache access_log files
# by date (ascending) and converts them from 'common' log format
# into 'combined' (if you switched the log file format meanwhile).
# This is useful when you want to merge multiple log files, e.g. when
# you have different files for HTTP and HTTPS.
# Usage:
Cybso /
Created April 3, 2017 14:40
Put a stamp on the last page of a PDF document using PDFTK
if [ "$1" == "" -o "$2" == "" -o "$3" == "" -o "$4" != "" -o "$1" == "-h" -o "$1" == "--help" ]; then
echo "Puts a stamp (as PDF file) onto the last page of the input" >&2
echo "file using PDFTK". >&2
echo "" >&2
echo "Usage: $0 INPUT.pdf STAMP.pdf OUTPUT.pdf" >&2
exit 1
Cybso / suspend-on-idle.service
Last active March 4, 2017 20:23
Suspend system on inactivity
# /etc/systemd/system/suspend-on-idle.service
# call "systemctl daemon-reload" after creation / modification
# call "systemctl status suspend-on-idle.service" to see last log line
# call "journalctl -b0 -u suspend-on-idle" to see all log line
Description=Suspend on idle
Cybso /
Last active May 23, 2020 10:38
PAM helper script in python to allow migration of user accounts stored in LDAP (with SSHA hashed passwords) to regular unix system users. This script will be executed is pam_unix failed and will try to verify the user password stored in /etc/shadow using SSHA algorithm.
#!/usr/bin/env python
# Takes a username from environment variable PAM_USER, a password from STDIN
# and tries to verify the shadow's password using LDAP's SSHA algorithm:
# {SSHA}...base64encodedString...
# If used within PAM auth this provides a compatibility layer that allows
# to migrate LDAP user into Unix user accounts. When the user's password
#!/usr/bin/env python
# - Sync user accounts from an LDAP or Active Directory to Redmine
# Usage: <database.yml> [environment]
# Where database.yml is the database configuration file for a redmine instance,
# and environment is the rails environment that should be used (defaults to
# 'production').
# Author:
Cybso /
Last active September 3, 2021 18:07 — forked from teffalump/
#Put in /etc/
#Script to grab and sort a list of adservers and malware
#Check proper DHCP config and, if necessary, update it
uci get dhcp.@dnsmasq[0].addnhosts > /dev/null 2>&1 || uci add_list dhcp.@dnsmasq[0].addnhosts=/etc/block.hosts && uci commit
#Leave crontab alone, or add to it
grep -q "/etc/" /etc/crontabs/root || echo "0 4 * * 0,3 sh /etc/" >> /etc/crontabs/root