Skip to content

Instantly share code, notes, and snippets.

View antiops's full-sized avatar

Anti Ops antiops

View GitHub Profile
@antiops
antiops / human_readable.sh
Last active May 22, 2024 07:36 — forked from agunnerson-ibm/human_readable.sh
Bash function to convert bytes to human readable size
# Copyright 2015 Andrew Gunnerson <[email protected]>
# Copyright 2024 antiops@github
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@antiops
antiops / console.js
Created July 7, 2023 12:41
Get total amount of Discord servers youre in
fetch('https://discord.com/api/users/@me/guilds', {
headers: {
authorization: 'YOUR_TOKEN'
}
})
.then(res => res.json())
.then(data => {
console.log(`[info] Total Server Count: ${data.length}`)
// Display object with all guild metadata
// console.log(data)
@antiops
antiops / DisableKeys.ahk
Created April 5, 2023 03:25
AutoHotkey script to disable the CapsLock, ScrollLock, & Insert buttons
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
CapsLock::
ScrollLock::
Ins::
@antiops
antiops / Dockerfile
Created March 16, 2023 23:56
zlib-searcher docker
FROM ubuntu:22.04
WORKDIR /
# Download archived library index and binary
RUN apt update && apt install -y wget unzip \
&& wget "https://archive.org/download/zlib-searcher_index_0.6-repackaged/index_0.6.zip" -O /index.zip \
&& unzip /index.zip -d / \
&& wget "https://archive.org/download/zlib-searcher_index_0.6-repackaged/zlib-searcher" -O /zlib-searcher \
&& chmod +x /zlib-searcher
@antiops
antiops / notes.md
Last active March 11, 2023 04:03
Jellyfin API Notes
HOST="localhost:8096"
API_KEY=""

Running tasks

http://$HOST/ScheduledTasks
@antiops
antiops / rclone-proxy.md
Created March 11, 2023 04:00
Set up SOCKS proxy for rclone

SOCKS5 Proxy for rclone CLI/Mount using Docker

Docker Image: https://github.com/serjs/socks5-server

  • YourUsername: Unique username for SOCKS proxy
  • YourPassword: Unique password for SOCKS proxy
  • RemoteSocksHost: IP or hostname of remote server running the proxy

SOCKS Server

@antiops
antiops / notes.sh
Created March 11, 2023 03:49
Mastodon User Posts API values with URLs
jq -r '.[].account.avatar'
jq -r '.[].account.avatar_static'
jq -r '.[].account.header'
jq -r '.[].account.header_static'
jq -r '.[].account.emojis[].url'
jq -r '.[].account.emojis[].static_url'
jq -r '.[].emojis[].url'
jq -r '.[].emojis[].static_url'
jq -r '.[].media_attachments[].url'
jq -r '.[].media_attachments[].preview_url'
@antiops
antiops / notes.md
Last active February 5, 2023 08:19
Revry.tv Notes
@antiops
antiops / LEGO_set_api.md
Created January 20, 2023 12:49
LEGO Set Metadata API
  • Replace SET_ID_HERE with the LEGO set ID (Example: 30624)
  • The x-api-key worked for all the sets I tested, dunno if it changes

All the stuff

The API call used on the Building Instructions webpages. It returns all sorts of metadata

curl 'https://services.slingshot.lego.com/api/v4/lego_historic_product_read/_search' \
  -H 'content-type: application/json' \
@antiops
antiops / DiscordLite-mod.py
Last active March 2, 2023 00:53
DiscordLite + Amoled CSS & Wide GIF Picker
import webview
def on_loaded():
#webview.windows[0].evaluate_js('document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend", `<style type="text/css">${atob("BASE64_ENCODED_CSS_HERE")}</style>`)', callback=None)
webview.windows[0].evaluate_js('document.getElementsByTagName("head")[0].insertAdjacentHTML("beforeend", `<style type="text/css">${atob("OnJvb3QsCi50aGVtZS1kYXJrOm5vdCgudXNlclByb2ZpbGVPdXRlclRoZW1lZC0zRWZIbXYpLAoudGhlbWUtbGlnaHQ6bm90KC51c2VyUHJvZmlsZU91dGVyVGhlbWVkLTNFZkhtdiksCi50aGVtZS1hbW9sZWQ6bm90KC51c2VyUHJvZmlsZU91dGVyVGhlbWVkLTNFZkhtdikgewogICAgLS1iYWNrZ3JvdW5kLXByaW1hcnk6IGhzbCgwLCBjYWxjKHZhcigtLXNhdHVyYXRpb24tZmFjdG9yLCAxKSAqIDAlKSwgMCUpOwogICAgLS1iYWNrZ3JvdW5kLXNlY29uZGFyeTogaHNsKDAsIGNhbGModmFyKC0tc2F0dXJhdGlvbi1mYWN0b3IsIDEpICogMCUpLCA4JSk7CiAgICAtLWJhY2tncm91bmQtc2Vjb25kYXJ5LWFsdDogaHNsKDAsIGNhbGModmFyKC0tc2F0dXJhdGlvbi1mYWN0b3IsIDEpICogMCUpLCAxMCUpOwogICAgLS1iYWNrZ3JvdW5kLXRlcnRpYXJ5OiBoc2woMCwgY2FsYyh2YXIoLS1zYXR1cmF0aW9uLWZhY3RvciwgMSkgKiAwJSksIDQlKTsKICAgIC0tYmFja2