Skip to content

Instantly share code, notes, and snippets.

@p-fruck
p-fruck / apt-cve-checker.sh
Created March 26, 2022 21:24
APT CVE checker script
#!/bin/bash
# A minimal CVE checker script for apt
# License: GPL-3.0
while read package version; do
offset=$(apt changelog ${package} 2>/dev/null | grep -n '(${version})' | cut -d ':' -f 1)
cves=$(apt changelog ${package} 2>/dev/null | head -${offset} | grep -o 'CVE-[0-9]\+-[0-9]\+')
[[ ! -z "$cves" ]] && echo ${package} ${cves} || echo "x: ${package} ${version}"
done <<< $(apt list --upgradable 2> /dev/null | sed -e 's|/.*from:||g' -e 's|\]$||g' | tail +2)
@p-fruck
p-fruck / dualis.sh
Last active October 7, 2021 06:02
Bash script for fetching DHBW Dualis grades
#!/bin/bash
# Dualis notification script by p-fruck <dev@p-fruck.de>
# License: Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0)
#
# This script is intended to be used within a cronjob and will use the
# notify-send command once it detects new grades. However you can simply
# modify the code and use e.g. email notification instead. Have fun.
username=user@dhbw.de
password=Password1!
baseurl="https://dualis.dhbw.de/scripts/mgrqispi.dll"