Skip to content

Instantly share code, notes, and snippets.

View jogerj's full-sized avatar
🟢
Online

Jonathan Joewono jogerj

🟢
Online
View GitHub Profile
@jogerj
jogerj / fileinto_subfolder_by_date.sieve
Created September 23, 2025 19:52
Files incoming messages into subfolders of Inbox by YYYY-MM
require ["date", "fileinto", "variables"];
if date :matches "date" "year" "*" {
set "year" "${1}";
}
if date :matches "date" "month" "*" {
if string :matches "${1}" "?" {
set "month" "0${1}";
} else {
@jogerj
jogerj / autodiscover-email-redirects.worker.js
Last active September 11, 2025 21:45
Cloudflare Worker for redirecting autodiscovery/autoconfiguration of email servers
/**
* Handle redirects with cloudflare worker to avoid duplication
* https://forum.sympl.io/t/configure-auto-discover-for-mail-setup/94/6
*/
export default {
async fetch(request) {
const url = new URL(request.url);
if (url.pathname === "/.well-known/autoconfig/mail/config-v1.1.xml") {
const targetUrl = `https://autoconfig.${url.hostname}/mail/config-v1.1.xml`;
return fetch(targetUrl, request);
@jogerj
jogerj / fix-paimon-moe.user.js
Last active September 23, 2024 10:24
Runtime patches for paimon.moe
// ==UserScript==
// @name fix-paimon-moe
// @namespace https://jogerj.com
// @version 0.2.1
// @description Fixes for paimon.moe!
// @author JogerJ
// @match https://paimon.moe/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=paimon.moe
// @downloadUrl https://gist.github.com/jogerj/985b6d3112f96027eee599f91f87a211/raw/fix-paimon-moe.user.js
// @run-at document-start
@jogerj
jogerj / paimon-moe-fix-wish-import.user.js
Last active July 30, 2024 09:17
(DEPRECATED -- No longer needed) Replaces the old hoyoverse API called on paimon.moe with new version
// ==UserScript==
// @name Paimon.moe Wish Import fix
// @namespace https://jogerj.com
// @version 0.3.0
// @description (DEPRECATED) Modify request body to api.paimon.moe/corsproxy on paimon.moe
// @author JogerJ
// @match https://paimon.moe/wish/import*
// @downloadUrl https://gist.github.com/jogerj/5ab40acfb77e0fd3c89de7c798a3b4b8/raw/paimon-moe-fix-wish-import.user.js
// @grant none
// @license MIT
@jogerj
jogerj / add-illegal-windows-filename-check-pre-commit.sh
Created February 15, 2024 14:57
This script adds a pre-commit hook to your Git repository that checks for any filenames that contain characters illegal in Windows. Whenever you attempt to commit changes, this hook will run and prevent commits that include such filenames.
#!/bin/bash
# add-illegal-windows-filename-check-pre-commit.sh: Sets up a pre-commit hook to check for illegal Windows filename characters
# Author: Jonathan Joewono (jogerj)
# Date: 12 Feb 2024
# Version: 0.1.0
# DESCRIPTION:
# This script adds a pre-commit hook to your Git repository that checks for any filenames that contain
# characters illegal in Windows. Whenever you attempt to commit changes, this hook will run and prevent
@jogerj
jogerj / check_nextcloud.sh
Last active May 16, 2023 22:17
Check nextcloud for aliveness using tcp ping with lft, send notification to telegram if it's dead. See https://gist.github.com/jogerj/47eca63335c93b214c9bc72347139756
#!/bin/bash
source /root/telegram.sh
fixes_dir="/root"
check_website="nextcloud.acme.com"
ip_address="$(dig +short @1.1.1.1 $check_website)"
if [ "x$ip_address" == "x" ]; then
@jogerj
jogerj / open-in-txtify.js
Created January 24, 2023 07:49
Save as bookmark and click when the ads/images annoy you. Opens the website you have open on txtify.it
javascript:(function()%7Bwindow.location.href %3D 'https%3A%2F%2Ftxtify.it%2F' %2B window.location.href%7D)()
@jogerj
jogerj / importer.ps1
Last active July 31, 2024 08:23 — forked from MadeBaruna/importer.ps1
Paimon.moe Local Importer (Windows)
Add-Type -AssemblyName System.Web
Write-Host "Paimon.moe Wish Importer" -ForegroundColor Cyan
Write-Host "1. Open Genshin Impact in this PC"
Write-Host "2. Then open the wish history and wait it to load"
Write-Host "3. When you are ready press [ENTER] to continue! (or any key to cancel)"
Write-Host "Waiting..."
$keyInput = [Console]::ReadKey($true).Key
if ($keyInput -ne "13") {
@jogerj
jogerj / telegram-http.sh
Last active October 7, 2022 17:37 — forked from dideler/bot.rb
Send Telegram messages from bash
#!bin/bash
TELEGRAM_BOT_TOKEN="botid:token"
CHAT_ID="1234567890"
send_telegram () {
title="$1"
timestamp="$(date -R)"
msg="$title\n$timestamp\n\n$(echo "$2" | sed -z -e 's|\\|\\\\|g' -e 's|\n|\\n|g' -e 's|\t|\\t|g' -e 's|\"|\\"|g')"
entities="[{\"offset\":0,\"length\":${#title},\"type\":\"bold\"},{\"offset\":$((${#title}+1)),\"length\":${#timestamp},\"type\":\"italic\"}]"
@jogerj
jogerj / download_zextras.sh
Last active September 28, 2022 04:15
Download Zextras open source Zimbra builds according to OS version
#!/usr/bin/env bash
OS="$(cat /etc/os-release)"
if [[ $(echo -e $OS | grep "Ubuntu 18") ]]; then
wget -N download.zextras.com/zcs-9.0.0_OSE_UBUNTU18_latest-zextras.tgz;
elif [[ $(echo -e $OS | grep "Ubuntu 20") ]]; then
wget -N download.zextras.com/zcs-9.0.0_OSE_UBUNTU20_latest-zextras.tgz;
elif [[ $(echo -e $OS | grep -e "Red Hat Enterprise Linux" -e "CentOS") ]]; then
if [[ $(cat /etc/redhat-release | grep "release 7") ]]; then