Skip to content

Instantly share code, notes, and snippets.

View watbulb's full-sized avatar
:shipit:

Dayton watbulb

:shipit:
  • Calgary, Canada
  • 04:40 (UTC -06:00)
View GitHub Profile
@Niakr1s
Niakr1s / cmake_windows_icon.txt
Created November 23, 2019 19:55
How to add icon to cmake app in windows
1. Put app.ico in directory.
2. Create app.rc in same directory with one line:
IDI_ICON1 ICON DISCARDABLE "app.ico"
3. Run command (Warning: it's app.o, not app.res, how it is mentioned in other manuals!)
windres app.rc -o app.o
4. add_executable(app
...
@psifertex
psifertex / keybindings.json
Last active October 11, 2022 19:23
simple VIM style motion keys for Binary Ninja
{
"Back" : "Escape; Back; Ctrl+[; Meta+O",
"Forward" : "Forward; Ctrl+[; Meta+I",
"Change Type..." : "Shift+Y; ",
"Close Window" : "Ctrl+W; X",
"Command Palette" : "Ctrl+P; Space",
"Copy" : "Ctrl+C; Y",
"Disassembly Graph" : "G, L",
"Display as\\Binary" : "D",
"Display as\\Default" : "D",
@yifanlu
yifanlu / Ghidra-OSX-Launcher-Script.scpt
Last active April 4, 2024 21:00
Ghidra.app launcher for OSX
@gmpreussner
gmpreussner / archlinux-install-nvme-luks-lvm-btrfs-usb
Last active March 23, 2023 09:31
Minimal instructions for installing a fully encrypted ArchLinux with USB boot on Lenovo Yoga 920.
# Install a fully encrypted ArchLinux on NVMe with detached LUKS
# headers and LUKS encrypted UEFI boot partition on a USB dongle.
#
# Full tutorial can be found here:
# https://headcrash.industries/reference/fully-encrypted-archlinux-with-secure-boot-on-yoga-920/
#
# Written by Gerke Max Preussner <info@headcrash.industries>
# Overview ############################################################
@mikeanthonywild
mikeanthonywild / betterthreads.py
Last active December 22, 2021 17:14
betterthreads provides an enhanced replacement for the threading.Thread class geared towards cleanly stopping blocking threads. See http://mikeanthonywild.com/stopping-blocking-threads-in-python-using-gevent-sort-of.html for writeup.
""" betterthreads provides an enhanced replacement for the
threading.Thread class geared towards cleanly stopping blocking
threads.
"""
import gevent
import uuid
from gevent.event import Event
@gutoandreollo
gutoandreollo / arch_setup.sh
Last active April 6, 2022 18:18
Installing Arch Linux with an encrypted btrfs root, with GPT and UEFI support
# Install arch linux in an encrypted btrfs partition with GPT and UEFI support, gummiboot and hibernate/resume support
# sources:
# http://hole.tuziwo.info/install-arch-linux-on-uefi-gpt-computer-with-btrfs-support.html
# http://www.brunoparmentier.be/blog/how-to-install-arch-linux-on-an-encrypted-btrfs-partition.html
# https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption
# Take note of this:
# - The first thing you need is to identify which disk you're going to use. For the purpose of this guide, it will be /dev/sda
# Be VERY CAREFUL if you have more than one disk on your computer, and DOUBLE CAREFUL if one of them is the one with your backups
# - Since btrfs does not support swapfiles (yet), we'll create a swap partition. In this guide, it will NOT be encrypted

Encrypted laptop setup

  • Btrfs on main drive, replacing GPT/MBR
  • Encrypted main drive using key file on flash drive. Add backup passphrase
  • No swap, swap files (limitation of Btrfs) or swap partition (so no suspend-to-disk)
  • Boot directory and grub on flash drive
  • 1st flash drive partition is Vfat partition to allow for cross-platform file transfers
  • Ext4 ISO partition for Linux-only data/ISO files, if desired.
  • TODO - edit grub to allow booting ISOs stored on the flash drive.
@vukicevic
vukicevic / Draw Bitmap From Int Array
Last active October 31, 2023 08:50
Generate a monochrome bitmap image in JavaScript using a byte-array. The image is generated such that every bit in the array is shown as either a black (1) or white (0) pixel.
/**
* depth: 1 - monochrome
* 4 - 4-bit grayscale
* 8 - 8-bit grayscale
* 16 - 16-bit colour
* 32 - 32-bit colour
**/
function drawArray(arr, depth) {
var offset, height, data, image;
; Comments start with semicolons.
; Clojure is written in "forms", which are just
; lists of things inside parentheses, separated by whitespace.
;
; The clojure reader assumes that the first thing is a
; function or macro to call, and the rest are arguments.
;
; Here's a function that sets the current namespace:
(ns test)