Skip to content

Instantly share code, notes, and snippets.

View TheOnlyWayUp's full-sized avatar
📰
Democratizing information

Dhanush R TheOnlyWayUp

📰
Democratizing information
View GitHub Profile
function memfrob(str) {
var out = "";
for (var i = 0; i < str.length; i++) {
out += String.fromCharCode(str.charCodeAt(i) ^ 42);
}
return out;
}
function apply(id, frobbed) {
document.getElementById(id).href = memfrob(atob(frobbed));
@thesamesam
thesamesam / xz-backdoor.md
Last active April 7, 2025 09:15
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@Geczy
Geczy / readme.md
Last active April 17, 2025 05:03
Migrate Coolify to a new server
@fardjad
fardjad / considerations-for-running-postgres-on-nfs.md
Last active April 9, 2025 23:44
[Considerations for Running Postgres on NFS] Considerations for running a Postgres database on an NFS share #blog #postgres #nfs #fsync #fsexport #mount

Considerations for Running Postgres on NFS

Background

Over the weekend, I decided to try running a Postgres database in my Homelab. In my current setup, the most convenient option for storage is NFS. However, NFS is especially tricky for databases. A misconfigured setup can lead to performance or data corruption issues.

After watching

// ==UserScript==
// @name Photopea Premium
// @namespace http://tampermonkey.net/
// @version 2024-02-03
// @description Unlock Photopea Premium by patching their JS
// @author mat
// @match https://www.photopea.com/
// @match https://www.photopea.com/?utm_source=homescreen
// @icon https://www.google.com/s2/favicons?sz=64&domain=photopea.com
// @grant GM_webRequest
@TheOnlyWayUp
TheOnlyWayUp / Dockerfile
Last active February 10, 2024 22:24
Dockerfile for projects with Python Backends and Javascript Frontends. Star if useful, thanks!
FROM node:20
WORKDIR /build
COPY src/frontend/package*.json .
RUN rm -rf node_modules
RUN rm -rf build
RUN npm install
COPY src/frontend/. .
RUN npm run build
# Thanks https://stackoverflow.com/q/76988450
DELAY 1000
GUI r
DELAY 500
STRING cmd
SHIFT CTRL ENTER
DELAY 1000
LEFT
ENTER
DELAY 1000
@TheOnlyWayUp
TheOnlyWayUp / imageFunctions.py
Last active March 6, 2022 14:01
Example of BytesIO and PIL for modifying images without saving them
domain = 'watermark' # just an example of how to use bytesio with PIL, works better if you know more about the images you're using instead of using random ones which can have random dimensions.
import aiohttp
from urllib.parse import unquote
from io import BytesIO
from PIL import Image, ImageDraw, ImageFont
async def returnRandomCat():
async with aiohttp.ClientSession() as session:
async with session.get("https://aws.random.cat/meow") as resp:
@JeyyGit
JeyyGit / modal_implementation_example.py
Last active March 4, 2022 20:32
Rough implementation of modal in discord.py 2
import discord, secrets
class TextInput:
"""for storing our text input data"""
def __init__(self, payload):
self.type = payload['type']
self.custom_id = payload['custom_id']
self.style = payload['style']
self.label = payload['label']
self.min_length = payload.get('min_length')
@jcubic
jcubic / cdn.md
Last active April 25, 2025 06:58
How to setup a literally free CDN