Skip to content

Instantly share code, notes, and snippets.

@3lpsy
3lpsy / account.ts
Created August 2, 2021 03:37
Svelte Store with Custom Class in Typescript
/*
I recently jumped into svelte programming and wanted to create a class/singleton that could double as a reactive writable store.
I did things very wrong until people on the discord confirmed how wrong my implementation was so I wanted to provide a simple example.
So below is a simple account store you can use. I'm not sure if it's optimal or even correct, but it's better than my first attempt.
Feel free to provide feedback.
*/
```
import { writable } from "svelte/store";
// fake stuff for example
@3lpsy
3lpsy / genscope.py
Created July 25, 2021 10:05
Immunefi Program Data Generator
#!/usr/bin/env python3
from typing import List
from sys import argv, exit, stderr
from enum import Enum
from argparse import ArgumentParser
import json
try:
import requests
@3lpsy
3lpsy / readme.md
Created June 11, 2021 17:55
How to automatically launch apps in certain workspaces in SwayWM

Fun Stuff

I recently figured out how to launch applications in sway on login (or config reload) in specific workspaces. I tried doing this a year or so ago using procedural calls to swaymsg with manual changes to workspaces but it failed due to the delay in launching apps (the workspace would change too quickly). However, I recently figured out how to actually do it by combining swaymsg with assign.

First, you'll want to get the app_id, class or title of window you want to launch. Then you'll want to add it to the your sway config file.

The syntax looks like:

@3lpsy
3lpsy / convert-docx-pdf.md
Created June 10, 2021 22:12
Converting Docx to PDFs via the CLI on Linux using Docker/Podman

I want to be able to convert docx files to PDFs. I also don't want to install libreoffice on my host. Mostly because it's fairly large and has a lot of dependencies. If you don't care about installing libreoffce, just install it and use the command from the Dockerfile. Using a container makes it easy to "clean up" in my opinion. Although, there are 100 other options.

I use podman as root here but docker would work. You can just substitute in docker for podman. However, running rootless docker/podman may have implications on file ownership.

Building Image

@3lpsy
3lpsy / resources.md
Created June 6, 2021 07:03 — forked from muff-in/resources.md
A curated list of Assembly Language / Reversing / Malware Analysis -resources
@3lpsy
3lpsy / .vimrc
Created April 29, 2021 19:31
Vimrc
" syntax highlighting
filetype plugin indent on
syntax on
" Be better
set nocompatible
" Fast shortcuts
let mapleader = " " " map leader to Space
@3lpsy
3lpsy / zipit.py
Created March 24, 2021 20:55
Create Zip File
#!/usr/bin/python3
import zipfile
from io import BytesIO
import sys
def _build_zip(outpath, filepath, filecontents):
mp = BytesIO()
with zipfile.ZipFile(mp, "w", zipfile.ZIP_DEFLATED) as zf:
zf.writestr(filepath, filecontents.encode())
@3lpsy
3lpsy / localhosts.txt
Created January 25, 2021 17:34
List of alternative ways to specify localhost
localhost
127.0.0.1
127.0.0.2
127.1
127.0.000000000000000000000000001
0177.0.01
0000177.000.00.00001
0x7f.0x0.0x0.0x1
0x7f000001
0xDEADBEEF7f000001
@3lpsy
3lpsy / starship.toml
Created November 19, 2020 16:46
Starship Config
add_newline = false
# [line_break]
# disabled = true
# $cmd_duration\
format = """
$username\
$hostname\
$shlvl\
@3lpsy
3lpsy / blind.py
Last active February 25, 2021 23:20
Scuffed Blind SQL Injection for Burp's Web Sec Academy
import requests
from pathlib import Path
from urllib.parse import quote, urlencode
import argparse
from string import ascii_lowercase, printable, ascii_uppercase
import os
from urllib3.exceptions import InsecureRequestWarning
# This actually a pretty bad implementation. I wrote it in about an hour and then