Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcin Chwedczuk marcin-chwedczuk

View GitHub Profile
@nstarke
nstarke / resize-ghidra-gui.md
Last active Nov 30, 2021
Resize Ghidra GUI for High DPI screens
View resize-ghidra-gui.md

Resize Ghidra for High DPI screens

If you run Ghidra on a high DPI screen, you will probably find the GUI to be scaled down so small to be almost of no use.

There is a setting that you can adjust to scale the Ghidra GUI:

in $GHIDRA_ROOT/support is a file named launch.properties. In this launch.properties file is the following configuration key:

VMARGS_LINUX=-Dsun.java2d.uiScale=1
View gist:081e4386bea3a4a428b87ff7e0532b1b
brew install gmp
brew install mpfr
brew install libmpc
pip install gmpy2
@yellowbyte
yellowbyte / compiling_asm.md
Last active Nov 30, 2021
how to assemble assembly with NASM assembler to 32-bit or 64-bit ELF binary with or without libc
View compiling_asm.md

32-bit ELF binary

how to assemble and link:

nasm -f elf32 -o <filename>.o <filename>.asm
ld -m elf_i386 -o <filename> <filename>.o

template code (hello world):

section .text
global _start
@henfiber
henfiber / KB-Buying-gude-EU.md
Last active Nov 30, 2021
Buying keyboards and keyboard components from EU
View KB-Buying-gude-EU.md

Europe

@MightyPork
MightyPork / usb_hid_keys.h
Last active Dec 2, 2021
USB HID Keyboard scan codes
View usb_hid_keys.h
/**
* USB HID Keyboard scan codes as per USB spec 1.11
* plus some additional codes
*
* Created by MightyPork, 2016
* Public domain
*
* Adapted from:
* https://source.android.com/devices/input/keyboard-devices.html
*/
View we-are-the-cure.md

Explaining Miles's Magic

Miles Sabin recently opened a pull request fixing the infamous SI-2712. First off, this is remarkable and, if merged, will make everyone's life enormously easier. This is a bug that a lot of people hit often without even realizing it, and they just assume that either they did something wrong or the compiler is broken in some weird way. It is especially common for users of scalaz or cats.

But that's not what I wanted to write about. What I want to write about is the exact semantics of Miles's fix, because it does impose some very specific assumptions about the way that type constructors work, and understanding those assumptions is the key to getting the most of it his fix.

For starters, here is the sort of thing that SI-2712 affects:

def foo[F[_], A](fa: F[A]): String = fa.toString
@jewelsea
jewelsea / JavaFXTrayIconSample.java
Last active Sep 3, 2021
Demonstrate using the System Tray (AWT) to control a JavaFX application.
View JavaFXTrayIconSample.java
import javafx.application.*;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
import javafx.scene.paint.Color;
import javafx.stage.*;
import javax.imageio.ImageIO;
import java.io.IOException;
@roxlu
roxlu / install_cygwin_sshd.txt
Last active Sep 11, 2021
Installing CYGWIN + SSHD for remote access through SSH on windows
View install_cygwin_sshd.txt
Installing CYGWIN with SSH
1) Download cygwin setup.exe from http://www.cygwin.com
- Execute setup.exe
- Install from internet
- Root directory: `c:\cygwin` + all users
- Local package directory: use default value
- Select a mirror to download files from
- Select these packages:
- editors > xemacs 21.4.22-1
- net > openssh 6.1-p