Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄

Tjark Saul tjarksaul

🦄
View GitHub Profile
@tjarksaul
tjarksaul / Readme.md
Last active Nov 17, 2021
Slack Status Automatization
View Readme.md
  1. Copy this Zap into your Zapier account and connect your Slack account: https://zapier.com/shared/532ac667d67cd8fceefccc83cc2169488679056d
  2. Copy both files above into your Mac's $HOME/Library/LaunchAgents
  3. Replace the hoook URL in slackstatus.sh with the hook URL you get from Zapier, and replace [OFFICE NETWORK SSID] with your office's network SSID. Also update status emojis and text as you see fit
  4. Replace [USERNAME] in local.slackstatus.plist with your user account name
  5. Run launchctl load -w ~/Library/LaunchAgents/local.slackstatus.plist
  6. ???
  7. Profit
View convert_lsb.py
#!/usr/bin/env python3
import sys
import os
import csv
import xlsxwriter # pip3 install xlsxwriter
from typing import List
def convert_row(row: List[str]) -> List[str]:
row[3] = convert_gender(row[3])
@tjarksaul
tjarksaul / certbot.sh
Last active Nov 10, 2020
Certbot with DNS validation and tinydns
View certbot.sh
#!/bin/bash
DOMAIN="example.tld"
certbot certonly -n --preferred-challenges dns --manual --manual-public-ip-logging-ok --manual-auth-hook /usr/local/bin/tinydns-certbot-enable --manual-cleanup-hook /usr/local/bin/tinydns-certbot-disable -d $DOMAIN -d \*.$DOMAIN
@tjarksaul
tjarksaul / setup.sh
Last active Jan 29, 2022 — forked from lgreenlee/tinydns.service
TinyDNS/DJBDNS setup for Ubuntu/Debian
View setup.sh
#!/bin/bash -e
apt install -y ucspi-tcp build-essential
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
tar xf djbdns-1.05.tar.gz
cd djbdns-1.05/
echo gcc -O2 -include /usr/include/errno.h > conf-cc
wget https://www.fefe.de/dns/djbdns-1.05-test28.diff.xz
xz -d djbdns-1.05-test28.diff.xz
View URLSession Calls in Swift 4.swift
func makeGetCall() {
// Set up the URL request
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")
return
}
let urlRequest = URLRequest(url: url)
// set up the session
@tjarksaul
tjarksaul / pliim-turnOff.scpt
Last active Jan 21, 2018 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
View pliim-turnOff.scpt
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
View apache_serviceproxy_customsites_letsencrypt.conf
# file path: /Library/Server/Web/Config/Proxy/apache_serviceproxy_customsites_letsencrypt.conf
ProxyPass /.well-known/acme-challenge http://127.0.0.1:34543/.well-known/acme-challenge
ProxyPassReverse /.well-known/acme-challenge http://127.0.0.1:34543/.well-known/acme-challenge
View style.scss
.responsiveCheckerClass {
float: left;
display: none;
}
@media only screen and (max-width: 699px) {
/* dummy-Klasse zur Erkennung des responsiven Layouts */
.responsiveCheckerClass {
float: none;
display: none;
View lol.php
<?php
/**
* Encryptes a plain text password
* @param string Password
*/
function encryptPassword($password) {
global $config;
return md5($config->encryptionCode . $password . $config->encryptionCode);
}
View dspam-learn.sh
#!/bin/bash
set -euo pipefail
# normally this is a good idea, but in this case it messes with $BE_NICE
#IFS=$'\n\t'
########################################################################
# 2015-02-23 Christopher Hirschmann c.hirschmann@jonaspasche.com
# 2016-02-11 Tjark Saul dev@tjarksaul.de
########################################################################
#
# This program is free software: you can redistribute it and/or modify