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
/** | |
* Copy-pasted from here: | |
* https://lomma.se/utbildning-och-barnomsorg/grundskola/terminer-och-lov.html | |
*/ | |
const text_from_lomma_se = `; | |
Vårterminen 2024 | |
2024-01-10 - 2024-06-13 | |
Studiedagar* | |
2024-01-08 (även fritidshemmet stängt) | |
2024-01-09 |
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
[Path] | |
MakeDirectory=true | |
PathChanged=%h/Drive | |
[Install] | |
WantedBy=paths.target |
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/sh | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 FILENAME" | |
exit 1 | |
fi | |
mimetype=$(file -bN --mime-type "$1") | |
content=$(base64 -w0 < "$1") | |
echo "url('data:$mimetype;base64,$content')" |
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
# systemd unit to record DNS and DHCP requests | |
# | |
# Setup: | |
# sudo systemctl edit tcpdump --full --force | |
# # copy-paste the code below | |
# sudo systemctl enable tcpdump | |
# sudo systemctl status tcpdump # should show "loaded" and "active" | |
# | |
# Usage: | |
# # reboot your workstation |
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 | |
sudo echo "Sudo successful" | |
echo "== START user info ==" | |
echo "Username: $USER" | |
echo "Fullname: $(getent passwd $USER | cut -d: -f5 | cut -d, -f1)" | |
echo "== END user info ==" | |
echo "== START laptop info ==" | |
sudo dmidecode -t system | grep 'Manufacturer:' |
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 ubuntu:22.04 | |
RUN apt-get update && apt-get install -y \ | |
socat \ | |
&& rm -rf /var/lib/apt | |
COPY x-www-browser /usr/bin/x-www-browser | |
RUN chmod +x /usr/bin/x-www-browser |
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
# List of namespaced resources in a namespace | |
kubectl get $(kubectl api-resources --namespace=true -o name | paste -sd,) | |
# Actually delete them | |
kubectl delete $(kubectl api-resources --namespace=true -o name | paste -sd,) --all |
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 | |
ansible all -i inventory.ini --become --become-user=root -m shell -a 'hostname; rm -rf /var/lib/rook; umount /mnt; sgdisk --zap-all /dev/sdb; dd if=/dev/zero of="/dev/sdb" bs=1M count=100 oflag=direct,dsync; ls /dev/mapper/ceph-* | xargs -I% -- dmsetup remove %; rm -rf /dev/mapper/ceph-*; rm -rf /dev/ceph-*; partprobe /dev/sdb; ls -l /dev/mapper; lsblk' |
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 | |
set -e | |
IMAGE_URL=https://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img | |
IMAGE_FILE=$(basename $IMAGE_URL) | |
if [ ! -e $IMAGE_FILE ]; then | |
wget $IMAGE_URL | |
fi |
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
#!/usr/bin/env python3 | |
from flask import Flask | |
from flask_restful import fields, reqparse, Api, Resource, marshal | |
import time | |
app = Flask(__name__) | |
api = Api(app) | |
items_fields = { | |
'info': fields.String, |
NewerOlder