Skip to content

Instantly share code, notes, and snippets.

@EDVTAZ
EDVTAZ / ira-dl.py
Last active January 17, 2025 13:14
Download all images from irasutoya.com
import requests
import os, io
from PIL import Image
import sys
output_dir = "output"
if not os.path.exists(output_dir):
os.makedirs(output_dir)
index = 0
@EDVTAZ
EDVTAZ / _helltaker-solve.py
Last active August 30, 2023 19:43
Helltaker solution for the level I couldn't figure out :'(
from copy import deepcopy
from queue import Queue as qq
def mergem(inmap):
lasers(inmap)
res = ''
for row in inmap:
res += ''.join(row) + '\n'
return res
@EDVTAZ
EDVTAZ / pinggraph.sh
Last active August 30, 2023 18:55
Display graph of average and maximum ping rtt. One datapoint is the max/avg of 20 pings, and 25 datapoints are displayed on the graph.
set -e
if [ -z "$1" ]; then echo "Example usage: bash pinggraph.sh google.com"; exit; fi
touch pings.txt
while true; do
clear;
cat pings.txt |tail -n 25 |awk -F '/' '{print $5, $6}' |\
feedgnuplot --lines --points --legend 0 "avg" --legend 1 "max" --title "PING avg/max" \
--terminal 'dumb 200,50' --exit;
@EDVTAZ
EDVTAZ / image-viewer.html
Last active September 24, 2023 20:22
view images in a folder, move by left/a-right/d keyboard buttons or clicking left/right side of page, a/s to adjust brightness
<img id="imgdisplay" style="margin: auto; display: block" src="file:///C:/data/memes/greentext-work00.png">
<div id="base-div" style="position: fixed; top: 0; left: 0; height: 100vh; width: 100vw; display: flex">
<button id="left" style="height: 100%; width:50%; background-color: transparent; border: 0"/>
<button id="right" style="height: 100%; width:50%; background-color: transparent; border: 0"/>
</div>
<script>
if (location.hash === "") location = `${location}#0;file:///C:/data/memes/greentext-work00.png`;
# uncomment if you are using python2
# from __future__ import print_function
import sys
# Use it like this:
# ncat 8.8.8.8 1337 -e "/usr/bin/python3 script.py"
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
@EDVTAZ
EDVTAZ / functioncall-trace-debug.md
Last active June 7, 2018 13:52
functioncall trace debug

source

#define BEGIN_FUNC(X) printf("Function %s Entered\n",X)
#define END_FUNC(X)  printf("Function %s End\n",X)

foo()
{
BEGIN_FUNC(__func__);

//Your code here
alias ll="ls -lah"
alias xc="xclip -selection c"
alias t="gnome-terminal `pwd`"
# fuzzy cd
. /home/ed/me/git/z-zsh/z.sh
@EDVTAZ
EDVTAZ / .vimrc
Last active July 18, 2018 20:12
vimrc
set autoindent
set number
set hlsearch
" start maximized
" Use ~x on an English Windows version or ~n for French.
au GUIEnter * simalt ~x
"set termguicolors
if has('gui_running')
set guioptions-=T " no toolbar
@EDVTAZ
EDVTAZ / macros.ahk
Last active June 8, 2018 21:31
custom shortcuts for windows
CapsLock::Esc
RAlt::
Return
<^>!x::
>!x::
Send, {Del}
Return
@EDVTAZ
EDVTAZ / snc.sh
Created May 5, 2018 22:45
ssl ncat commands
#!/bin/bash
# socat is much better if you want to tunnel
# socat -v openssl-listen:4444,cert=b.crt,key=b.key,verify=0,reuseaddr,fork tcp4:localhost:5555
# socat -v tcp4-listen:6666,reuseaddr,fork ssl:localhost:4444,cafile=b.crt
#DEBUG_LVL="-vvvvvvvvvvvvvvvvvvvvvv"
BP_NAME="backpipe"
usage(){