Skip to content

Instantly share code, notes, and snippets.

@3lpsy
3lpsy / x-resize
Last active April 10, 2024 17:26
Manual Implementation of Auto Resizing For Non-Gnome Environments (like XFCE) running under Spice/Libvirt
#!/bin/bash
# SPDX-License-Identifier: MIT License
# Steps:
# 1) Make sure bash is available
# 2) Create udev rule
# - path to new udev rule: /etc/udev/rules.d/50-x-resize.rules
# - udev rule content:
# ACTION=="change",KERNEL=="card0", SUBSYSTEM=="drm", RUN+="/usr/local/bin/x-resize"
# 3) Create /var/log/autores directory
# 4) Create script /usr/local/bin/x-resize (this file) and make executable
@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 / 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 / hp_ilo_create_admin_account.py
Last active August 3, 2022 19:07
2017-12542: Create Admin Account HP ILO Exploit (Metasploit Port to Python)
import sys
import argparse
import requests
import random
import string
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
@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 / shellpy.py
Created October 23, 2019 00:09
Convernt a binary to python shell code
#!/usr/bin/env python
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
print "usage: %s file.bin\n" % (sys.argv[0],)
sys.exit(0)
shellcodes = []
ctr = 1
maxlen = 15
@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())