This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import csv | |
import argparse | |
import re | |
from datetime import datetime | |
def extract_data(log_data, domain, poi): | |
# Adjust the regex to better handle the log line format | |
pattern_str = r'.*?\[(\d{2}/\w{3}/\d{4}:\d{2}:\d{2}:\d{2} \+\d{4})\]' # Match timestamp | |
pattern_str += r'\s"GET\s(.*?)\sHTTP/.*?"' # Capture requested resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# put this to /usr/local/bin/dc | |
command="$(which docker-compose) -f /opt/services/docker-compose.yaml" | |
for f in $(find /opt/services -maxdepth 1 -type f -name "*.yaml" 2>/dev/null); do | |
[[ ${f} =~ "docker-compose.yaml" ]] && continue | |
command="${command} -f ${f}" | |
done | |
${command} "${@}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
from datetime import datetime | |
import csv | |
import os | |
from geopy.geocoders import Nominatim # pip install geopy | |
def convert_date(date_str): | |
# Parse the ISO 8601 format date string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set the e-mail address that submission should be sent to. | |
$address = '[email protected]'; | |
// Set the e-mail subject prefix. | |
$prefix = 'Website feedback'; | |
// DO NOT EDIT ANYTHING BELOW UNLESS YOU KNOW WHAT YOU ARE DOING. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cp -a $1 /tmp/kmdb.dump | |
sudo su postgres <<EOF | |
cd ~ | |
dropdb db | |
createdb db --owner=kmdb --encoding=UTF8 | |
pg_restore -l /tmp/kmdb.dump | sed '/MATERIALIZED VIEW DATA/d' > restore.lst | |
pg_restore -L restore.lst -d db /tmp/kmdb.dump > /dev/null 2>&1 | |
pg_restore -l /tmp/kmdb.dump | grep 'MATERIALIZED VIEW DATA' > refresh.lst | |
psql -d db -c 'REFRESH MATERIALIZED VIEW unique_lexeme;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
web_service='nginx' | |
config_files=( "/home/tim/le-renew-webroot.ini" "/home/tim/le-renew-webroot-mk.ini" "/home/tim/le-renew-webroot-hackman.ini" "/root/le-renew-webroot.ini" ) | |
le_path='/opt/letsencrypt' | |
exp_limit=30; | |
for config_file in "${config_files[@]}" | |
do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# put this file in /etc/network/if-up.d/ | |
if iwconfig wlp4s0 | grep -c "ESSID:\"WIFIonICE\"" | |
then | |
curl -s "https://www.ombord.info/hotspot/hotspot.cgi?connect=&method=login&realm=db_advanced_wifi" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# automagically downloads the newest stable mediawiki and it's php dependencies | |
MW_PATH="/export/home/wwwfsr/fachschaft/wiki" # set your mediawiki path here | |
MW_stable_branch_number=$(curl -s "https://www.mediawiki.org/w/api.php?action=expandtemplates&text=\{\{MW%20stable%20branch%20number\}\}&prop=wikitext&formatversion=2&format=json" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["expandtemplates"]["wikitext"]') | |
MW_stable_release_number=$(curl -s "https://www.mediawiki.org/w/api.php?action=expandtemplates&text=\{\{MW%20stable%20release%20number\}\}&prop=wikitext&formatversion=2&format=json" | python -c 'import json,sys;obj=json.load(sys.stdin);print obj["expandtemplates"]["wikitext"]') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
su postgres -c 'pg_dump db --clean' | gzip --rsyncable --best > /data/export/KM/backup/kmdb/"$(date +"%Y-%m-%d")".gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# PURPOSE: Script to check LOCKBASE online services availability | |
LOG_FILE="/var/log/online_services_health.log" | |
EMAIL_ADDRESS="[email protected]" | |
HetznerURL="https://lockbase.net/cgi-bin/" | |
BackupURL="https://lockbase.org/cgi-bin/" | |
OnlineCheckURL="https://www.google.com/" | |
WebsiteURL="https://koertner-muth.de/koertner-muth/Navi.cgi" |
NewerOlder