Skip to content

Instantly share code, notes, and snippets.

View hackery's full-sized avatar

James Beckett hackery

View GitHub Profile
@hackery
hackery / gist:a1ed35d1df858a44bca3
Last active August 29, 2015 14:06
LD_PRELOAD trick to neuter the Shellshock bug CVE-2014-6271 if for some reason you can't patch bash.
// gcc -Wall -fPIC -shared -Wl,-init,anti_shellshock_init -o preload.so preload.c
// env EXPLOIT_CVE_2014_6271='() { :;}; echo WE ARE VULNERABLE' bash -c id
// env EXPLOIT_CVE_2014_6271='() { :;}; echo WE ARE VULNERABLE' LD_PRELOAD=$PWD/preload.so bash -c id
#include <stdio.h>
#include <string.h>
extern char **environ;
void anti_shellshock_init()
@hackery
hackery / rtl2838.eeprom.txt
Last active December 9, 2016 00:38
RTL2838 corrupted EEPROM
For some unknown reason, the NESDR Mini running one of my ADS-B receivers
(outside, on the antenna mast) packed in at the start of December 2016.
It had started to show the wrong USB vid:pid and other descriptor errors.
Some of the descriptor is kept in an external EEPROM, which is readable
and writable through USB commands - but I had to hack in the bad vendor
ID to the rtl-sdr library in order to get rtl_eeprom to even attempt to
dump the data.
static rtlsdr_dongle_t known_devices[] = {
{ 0xffda, 0x2838, "Generic RTL2832U OEM with corrupt descriptor" },
@hackery
hackery / gist:261932d8726298156acfc00c395e0f9e
Last active November 19, 2018 16:37
Elasticsearch: reindexing to replace null value
#DELETE jmb-test
PUT jmb-test/transactions/1
{
"user" : "jamie"
}
PUT jmb-test/transactions/2
{
"user" : "kay"
}
jmb@zen:~/xfer$ time sudo strace -tT -o /tmp/strace.hdparm hdparm -t /dev/mapper/sys0-root /dev/mapper/sys0-root: HDIO_DRIVE_CMD(identify) failed: Inappropriate ioctl for device Timing buffered disk reads: 3394 MB in 3.00 seconds = 1131.26 MB/sec real 8m26.623s user 0m0.100s
@hackery
hackery / gist:590f507973fbb30aa0dcff434cb76b86
Created March 12, 2021 14:45
raspbian img file discrepancy after write to sd card
007f4570 74 00 78 00 74 00 00 00 ff ff 00 00 ff ff ff ff |t.x.t...........|
007f4580 49 53 53 55 45 20 20 20 54 58 54 20 00 29 1a 69 |ISSUE TXT .).i|
007f4590 2b 52 2b 52 01 00 1a 69 2b 52 81 69 91 00 00 00 |+R+R...i+R.i....|
007f45a0 e5 54 41 52 54 5f 7e 31 4e 48 4e 20 00 2e 15 69 |.TART_~1NHN ...i| ***
007f45b0 2b 52 2b 52 00 00 15 69 2b 52 00 00 00 00 00 00 |+R+R...i+R......|
007f45c0 e5 43 4d 32 37 31 7e 31 4d 4e 5a 20 00 c2 14 69 |.CM271~1MNZ ...i|
007f45d0 2b 52 2b 52 00 00 14 69 2b 52 00 00 00 00 00 00 |+R+R...i+R......|
007f45e0 42 2d 00 72 00 65 00 76 00 31 00 0f 00 59 2e 00 |B-.r.e.v.1...Y..|
007f45f0 64 00 74 00 62 00 00 00 ff ff 00 00 ff ff ff ff |d.t.b...........|
@hackery
hackery / luminosus-build-jammy.sh
Last active June 23, 2023 16:07
Build Luminosus for Ubuntu 22.04
# https://github.com/ETCLabs/LuminosusEosEdition is an open source companion app for ETC EOS lighting consoles
# but is rather out of date. It requires libvlc-qt, which is not available as a package in Ubunto 22.04 jammy
#
# src/audio/AudioPlayerVlc.h will complain of missing include file VLCQtCore/Common.h
git clone https://github.com/vlc-qt/vlc-qt.git
cd vlc-qt
dpkg-buildpackage -us -uc
# debian/rules build
# fakeroot debian/rules binary
@hackery
hackery / usercss-amazon.css
Created December 18, 2023 09:45
UserCSS extension: dim out Amazon sponsored search results
DIV.s-featured-result-item {
opacity: 30%
}