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 / Solutions to Wordle.md
Created February 1, 2022 14:38
How to extract Wordle's solution for every day (SPOILERS)

The following excerpt is for educational purposes only. Wordle is the creation of Josh Wardle.

To begin with, it's not that hard, it was literally encoded in a plain-text list as a constant which was included when you load the page. All we do here is reformat the list into a readable one.

How I extracted it:

  1. Copy the array of words from main.js. Press F12 to open DevTools on Chrome/Edge and you'll find resources that the page loads under the 'Sources' tab. Here you can find a 'minified' version of main.js, which means it's been simplified to only include the important things that keeps the page functional, which means variables and function names are replaced with arbitrary shorter ones and compacted. Wordle Dev Tools

DevTools offers to "prettify" our javascript so it looks more readable. Finding which array is which is easy, just look up a known so

@jogerj
jogerj / zimbra_auto_restart.sh
Last active January 26, 2022 17:08
Auto restart zimbra if something stops working, because some zimbra services likes to stop working randomly. Prevent consecutive restart if last restart didn't fix the problem. Also send a Pushbullet notification on restart. Best to pair this script with crontab!
#!/bin/bash
check=$(su - zimbra -c 'zmcontrol status' | grep Stopped)
fixes_dir="/root"
# run as root only! make sure chmod 500 to keep secret!
access_token="PUSHBULLET_API_TOKEN"
pushbullet () {
msg="$(date -R)\n${2}"
title="${1}"
@jogerj
jogerj / start.sh
Last active November 7, 2021 17:19
Minecraft start.sh script with screen + updater script
#!/bin/sh
MC="paper.jar"
MC_UPDATE="paper_update.jar"
# Replace if update exists
if test -f "$MC_UPDATE"; then
echo "Updating $MC..."
mv $MC $MC.old
mv $MC_UPDATE $MC
@jogerj
jogerj / mc_backup.sh
Last active January 25, 2023 16:53 — forked from renamedquery/backup.sh
RCON bash script to backup minecraft server directory
#!/bin/bash
MCRCON_PATH="/usr/local/bin"
BACKUP_PATH="/home/opc/mc_backup"
MC_PATH="/home/opc/minecraft"
IP="127.0.0.1"
PORT="25575"
PASS="[password]"
@jogerj
jogerj / MusicBot on Oracle Cloud (Oracle Linux 7.9).md
Last active October 28, 2021 20:57
Quick guide on installation of MusicBot on Oracle Cloud

MusicBot on Oracle Cloud with ARM instance

  • Cloned repo (use review branch) + config as per usual
  • sudo yum install python-devel
  • Compiled and installed python 3.9.7 (use this guide https://www.pro-oracle.com/2019/05/oracle-linux-7-install-python-37-from.html)
  • ensure run.py is running on python 3.9.* you just installed
  • sudo yum install opus
  • Install ffmpeg (grab binary here https://johnvansickle.com/ffmpeg/, put/link in /usr/local/bin or configure PATH to the ffmpeg binary)
  • ensure pip -V uses python from 3.9.* otherwise always call pip with python3.9 -m pip
  • pip install -r requirements.txt
@jogerj
jogerj / Members-only Playlist Bookmarklet.md
Last active September 1, 2021 02:15
Javascript bookmarklet that directly links you to membership playlist
@jogerj
jogerj / JP-EN Phasmophobia Cheatsheet.md
Last active November 21, 2020 16:26
From Japanese wiki cheatsheet for evidence, questions, item names, etc.

Evidences

EMF 5 Ghost Orb Writing Freezing Spirit Box Fingerprint
EMFレベル5 ゴーストオーブ ゴーストライティング 氷点下の気温 スピリットボックス 指紋 
Shade シェード
Phantom ファントム
Jinn ジン
Yurei 幽霊
Mare メアー
@jogerj
jogerj / Generate Loginizer IP Blacklist or Whitelist
Last active August 18, 2020 17:52
Simple python script for generating IP address list for blacklist/whitelist on Loginizer plugin for Wordpress
# Loginizer is a WordPress plugin which helps you fight against bruteforce attack by blocking login for the IP
# after it reaches maximum retries allowed. You can blacklist or whitelist IPs for login using Loginizer.
#
# This python script generates config text from a list of ip address ranges.
# The list can be easily copy pasted from any table with 2 ip addresses each row.
#
# To filter by country of origin, use tables from https://lite.ip2location.com/ip-address-ranges-by-country
# The raw_ip.txt included in this gist is taken from https://lite.ip2location.com/china-ip-address-ranges
#
# To use, input ip ranges (separated by newline) in raw_ip.txt