Skip to content

Instantly share code, notes, and snippets.

View rurban's full-sized avatar

Reini Urban rurban

View GitHub Profile
@nverno
nverno / shellcheck.el
Created October 7, 2023 01:43
Shellcheck compile
;;; shellcheck.el --- shellcheck compilation -*- lexical-binding: t; -*-
;;; Commentary:
;;
;; Compilation output for .sh and .bat files using shellcheck
;;
;; Provides:
;; - font-locking in the output buffer via `xterm-color'
;; - links b/w shellcheck output and source locations
;; - converts 'SC****' warnings/errors to buttons that link to their documentation
@moyix
moyix / killbutmakeitlooklikeanaccident.sh
Created February 5, 2022 22:51
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@s4y
s4y / naive_utf8.c
Last active October 15, 2017 09:28
A simple UTF-8 parser that happens to be fast.
#include <inttypes.h>
typedef enum {
UTF8_OK = 0,
UTF8_ERROR = 4,
} utf8_decode_state_t;
typedef struct {
utf8_decode_state_t state;
uint32_t codepoint;
@sneves
sneves / ct32.c
Last active December 28, 2021 19:43
/*
Constant-time integer comparisons
Written in 2014 by Samuel Neves <sneves@dei.uc.pt>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
/*
SSSE3/XOP bit reversal
Written in 2014 by Samuel Neves <sneves@dei.uc.pt>
To the extent possible under law, the author(s) have dedicated all copyright
and related and neighboring rights to this software to the public domain
worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication along with
#!/usr/bin/env perl
use strict;
use LWP::Simple;
sub pick { $_[rand @_] }
my $text = get "https://gist.github.com/shanselman/5422230/raw/9863d88bde2f9dcf6b2e7a284dd4a428afdc8c8b/gistfile1.txt";
my @samples = split /\|\n/, $text;
my $template = pick @samples;
@gerdr
gerdr / cygwin-fix.bat
Created January 19, 2012 17:29
Batch file to rebase Parrot DLLs
@echo off
setlocal
if "%CYGWIN_ROOT%" == "" set CYGWIN_ROOT=C:\cygwin
if not exist "%CYGWIN_ROOT%"\ (
echo directory %CYGWIN_ROOT% does not exist
echo please set the variable CYGWIN_ROOT
exit /B 1
)