This file contains hidden or 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 | |
| COPYRIGHT="© Karsten Kroesch - www.kroesch.ch" | |
| for file in *.jpeg | |
| do | |
| # Get the height of the image | |
| height=$(identify -format "%h" "$file") | |
| # Calculate the pointsize as 5% of the image height |
This file contains hidden or 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
| # in /etc/fail2ban/jail.conf | |
| # ... | |
| [nginx-4xx] | |
| enabled = true | |
| port = http,https | |
| filter = nginx-4xx | |
| logpath = /var/log/nginx/access.log | |
| bantime = 3600 |
This file contains hidden or 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
| a# /etc/systemd/system/webconsole.service | |
| # | |
| # Install with: | |
| # # install https://github.com/yudai/gotty | |
| # # systemctl daemon-reload | |
| # # systemctl enable --now patchstatus.service | |
| # | |
| [Unit] | |
| Description=Provide an ephemeral container with web console |
This file contains hidden or 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
| global | |
| log /dev/log local0 | |
| log /dev/log local1 notice | |
| chroot /var/lib/haproxy | |
| stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners | |
| stats timeout 30s | |
| user haproxy | |
| group haproxy | |
| daemon |
This file contains hidden or 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
| ### Requests for Kix API | |
| @base_url = http://localhost:20000/api/v1 | |
| ### Authorization | |
| # @name request_auth_token | |
| POST {{base_url}}/auth | |
| { |
This file contains hidden or 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
| input { | |
| http_poller { | |
| urls => { | |
| wunderground => "https://api.weather.com/v2/pws/observations/current?stationId=IDULLI1&format=json&units=m&apiKey={{ api_key }}" | |
| } | |
| request_timeout => 60 | |
| schedule => { cron => "0,15,30,45 * * * * UTC"} | |
| codec => "json" | |
| # A hash of request metadata info (timing, response headers, etc.) will be sent here | |
| metadata_target => "http_poller_metadata" |
This file contains hidden or 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 yaml | |
| from dotmap import DotMap as DD | |
| class DataManager: | |
| """ Manages YAML data representation where members are accessible with dot notation. | |
| """ | |
| data_map = DD() |
This file contains hidden or 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
| def qs(k : int) -> int: | |
| s = 0 | |
| while k: | |
| s = s + k % 10 | |
| k = k // 10 | |
| return s |
This file contains hidden or 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
| from math import gcd | |
| def φ(z): | |
| return sum([gcd(z,k)==1 for k in range(1, z+1)]) |
This file contains hidden or 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
| from dataclasses import dataclass | |
| from numbers import Number | |
| from unittest import TestCase | |
| class Expression: | |
| def derive(self, variable): | |
| return self |