Skip to content

Instantly share code, notes, and snippets.

View u1i's full-sized avatar

Uli u1i

View GitHub Profile
@u1i
u1i / doit.sh
Created April 4, 2024 01:12
shred
find . -type f -exec openssl enc -aes-256-cbc -pass pass:mypassword -nosalt -in {} -out {}.tmp \; -exec mv {}.tmp {} \;
@u1i
u1i / info.txt
Created March 2, 2024 02:06
writing style
"Write in a conversational and engaging style that mirrors a friendly chat. Use descriptive language to vividly convey ideas, choosing action verbs and thoughtful adjectives for depth. Incorporate provocative phrases to spark curiosity and human-centered words to emphasize emotions and connections.
Avoid excessive jargon, fluff, and clichés. Prioritize clear, specific language over formal or ambiguous terms. Steer clear of negative tones and overly complex expressions, aiming for approachable and relatable wording."
@u1i
u1i / info.txt
Created February 15, 2024 01:44
TURD Stack
T - Terrible user interfaces
U - Unreliable databases
R - Redundant frameworks
D - Dated infrastructure
@u1i
u1i / l.py
Created October 25, 2023 14:00
HTTP Listener
from flask import Flask, request
app = Flask(__name__)
@app.route('/', defaults={'path': ''}, methods=["GET", "POST", "PUT", "DELETE"])
@app.route('/<path:path>', methods=["GET", "POST", "PUT", "DELETE"])
def catch_all(path):
# Print the incoming request and payload
print(f"Incoming Request: {request.method} {request.url}")
if request.data:
@u1i
u1i / sl.py
Created October 23, 2023 07:34
Selenium Test
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.service import Service
# Replace with the URL of your Selenium Grid hub on localhost.
grid_hub_url = "http://localhost:4444/wd/hub"
# Set the Chrome browser options.
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--headless") # Example: Run Chrome in headless mode.
@u1i
u1i / doit.sh
Created October 23, 2023 07:33
Selenium Docker
docker run -d -p 4444:4444 -v /dev/shm:/dev/shm selenium/standalone-chrome
import time
from locust import HttpUser, task, between
class QuickstartUser(HttpUser):
wait_time = between(1, 2)
@task
def index_page(self):
self.client.get("/")
@u1i
u1i / 2048.py
Created July 2, 2023 08:09
2048 Game in Python
import curses
from random import randrange, choice
from collections import defaultdict
# Initialize the game
actions = ['Up', 'Down', 'Left', 'Right']
keys = [ord('w'), ord('s'), ord('a'), ord('d')]
actions_dict = dict(zip(keys, actions))
@u1i
u1i / doit.sh
Created May 17, 2023 11:18
Chrome Watcher - what files does it read and write
#!/bin/bash
# Array to store the filenames from the previous loop
previous_files=()
# Infinite loop
while :
do
# Run the lsof command and filter for Google Chrome process
files=$(lsof -c "Google Chrome" | awk '{print $9}' | sed '1d')
@u1i
u1i / doit.sh
Created May 16, 2023 11:16
Open URL in existing Chrome instance
osascript -e 'tell application "Google Chrome" to open location "https://www.sotong.io"'