Skip to content

Instantly share code, notes, and snippets.

View sagittarius-a's full-sized avatar
👀

Sagittarius-a sagittarius-a

👀
View GitHub Profile
@sagittarius-a
sagittarius-a / binja_ui_template.py
Created February 6, 2025 15:12 — forked from icecr4ck/binja_ui_template.py
Template for writing Binary Ninja UI plugins.
import sys
from PySide2.QtWidgets import (QApplication, QDialog, QPushButton, QLabel, QHBoxLayout)
from PySide2.QtCore import Qt
from binaryninjaui import (UIAction, UIActionHandler, Menu)
class GreatUI(QDialog):
def __init__(self, parent=None):
super(GreatUI, self).__init__(parent)
self.setWindowModality(Qt.NonModal)
@sagittarius-a
sagittarius-a / fish_right_prompt.fish
Created January 6, 2025 14:48
Fish right prompt: Display battery level (Linux)
# Requires `inxi` package to be installed
function fish_right_prompt -d "Write out the right prompt"
# Get battery percentage and status
set level (inxi --battery | python -c "import sys, re; input = sys.stdin.read(); line = input.split()[6]; print(re.sub('[()]', '', line))")
set battery_status (upower -i /org/freedesktop/UPower/devices/battery_BAT0 | grep "state:" | awk '{ print $2 }')
# Define colors
# Normal colors
for f in /usr/share/figlet/*
do
fs=$(basename $f)
fname=${fs%%.tlf}
toilet -f $fname $fname
done
@sagittarius-a
sagittarius-a / idapython_cheatsheet.md
Created August 23, 2022 17:51 — forked from icecr4ck/idapython_cheatsheet.md
Cheatsheet for IDAPython
@sagittarius-a
sagittarius-a / keychron_linux.md
Created June 22, 2022 08:13 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@sagittarius-a
sagittarius-a / NOTES.md
Created April 19, 2022 20:36
FreeBSD CURRENT installation in QEMU

Default STABLE installation

See the handbook if need be.

Post installation

As root:

pkg update
pkg install sudo vim git
@sagittarius-a
sagittarius-a / proc_mem.py
Created March 13, 2022 12:16 — forked from gamozolabs/proc_mem.py
IDA Python loader for /proc/pid/mem without debugging a process
import re, subprocess, idaapi, ida_segment, ida_kernwin
# To install this, simply put it in your ida_install/loaders folder and open
# a `/proc/<pid>/mem` file!
#
# You might need to set `echo 0 > /proc/sys/kernel/yama/ptrace_scope` if you
# want to be able to dump processes depending on your system configuration.
# Check if the file is supported by our loader
def accept_file(li, filename):
@sagittarius-a
sagittarius-a / nginx.conf
Created April 14, 2020 09:51 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@sagittarius-a
sagittarius-a / mysql-docker.sh
Created August 24, 2017 08:04 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@sagittarius-a
sagittarius-a / ARMDebianUbuntu.md
Created June 2, 2017 15:43 — forked from Liryna/ARMDebianUbuntu.md
Emulating ARM on Debian/Ubuntu

You might want to read this to get an introduction to armel vs armhf.

If the below is too much, you can try Ubuntu-ARMv7-Qemu but note it contains non-free blobs.

Running ARM programs under linux (without starting QEMU VM!)

First, cross-compile user programs with GCC-ARM toolchain. Then install qemu-arm-static so that you can run ARM executables directly on linux