Skip to content

Instantly share code, notes, and snippets.

@sehrgut
sehrgut / ios-profile-extract.sh
Last active April 17, 2024 20:31
extract embedded provisioning profile data from a .IPA
#!/bin/bash
#todo: nested binary entitlements?
#todo: noclobber
#todo: "in-place" to save in original path
readonly MODE_PLIST=0
readonly MODE_RAW=1
readonly MODE_ENTITLEMENTS=2
@sehrgut
sehrgut / xkeyscorerules100.txt
Created July 9, 2014 18:14
XKEYSCORE Tor rules
/*
Leaked by Das Erste
URL: http://daserste.ndr.de/panorama/archiv/2014/Quellcode-entschluesselt-Beweis-fuer-NSA-Spionage-in-Deutschland,nsa224.html
Source: http://daserste.ndr.de/panorama/xkeyscorerules100.txt
*/
// START_DEFINITION
/**
* Fingerprint Tor authoritative directories enacting the directory protocol.
*/
@sehrgut
sehrgut / README.md
Last active November 14, 2023 19:28
Libra Mini VIA and Vial keyboard definitions

Libra Mini (putative) rev. 2 VIA and Vial keyboard definitions

The VIA and Vial keyboard definitions distributed by mysterious Gdrive links have several issues. First, there seems to have been an undocumented hardware revision since the circulating VIA definition was created, in which the productId was changed from 0x4C24 to 0x4C23. As well, the VIA v2 format was trivially updatable to VIA v3 compatibility. The attached files can be used for the putative rev. 2 boards with VIA and Vial respectively.

Board Revisions

  • rev. 1 productId=0x4C24 Likely first, as this revision is in older copies of the VIA definition.
  • rev. 2 productId=0x4C23 Likely second, as this revision is in all known released copies of the Vial definition, later than the earliest VIA definition; and as well represents boards currently shipping from AliExpress.

Troubleshooting

If your board is not detectable with these keyboard definitions, try changing the productId field to 0x4C24 or checking your USB bus to confir

@sehrgut
sehrgut / castlebot.user.js
Last active November 6, 2023 21:47
Sandcastle Builder autobot: kitten clicking, and ninja-safe sand clicking
// ==UserScript==
// @name castlebot
// @namespace http://alphahelical.com/
// @version 0.4
// @description Sandcastle Builder autobot: kitten clicking, and ninja-safe sand clicking
// @author sehrgut
// @match http://castle.chirpingmustard.com/castle.html
// @grant GM_info
// @grant unsafeWindow
// @grant GM_log
@sehrgut
sehrgut / qbsort.js
Created November 11, 2011 17:58
quantum bogosort for javascript
/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, undef:true, browser:true, indent:4, maxerr:50 */
/*
qbsort.js - quantum bogosort for javascript
Copyright (C) 3011 Keith Beckman
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
@sehrgut
sehrgut / README.md
Last active April 17, 2023 20:10
AdBlock Plus rule to neuter Forbes "AdBlock detection"

Forbes Is Irrelevant

an AdBlock Plus filter list

Installation

  1. Right-click the "ABP" icon in yoru browser toolbar.
  2. Select "Options".
  3. Click the "Add Filter Subscription" button.
  4. Select "Add a different subscription..." from the drop-down menu.
  5. Enter "Forbes Is Irrelevant" for the subscription title, and http://bit.ly/forbes-sucks for the filter list location.
  6. Click the "Add" button.
@sehrgut
sehrgut / ios-profile-certs.sh
Last active November 9, 2022 16:25
Lists certificates permitted by an iOS provisioning profile
#!/bin/bash
readonly MODE_INFO=0
readonly MODE_VERBOSE=1
readonly MODE_EXTRACT=2
PLISTBUDDY=/usr/libexec/PlistBuddy
RUNMODE=$MODE_BASIC
TMP=`mktemp -t ios-profile-certs`
@sehrgut
sehrgut / curl-output.txt
Created January 3, 2016 21:56
How to hijack a page via a <script> tag loading HTML. Real-world example in curl-output.txt.
HTTP/1.1 302 Found
Date: Sun, 03 Jan 2016 19:58:45 GMT
Server: Apache
X-Powered-By: PHP/5.4.45-0+deb7u2
Location: http://ww31.gvisit.com/record.php?sid=592101993e8b9913eb0462e5bd4d7501
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
HTTP/1.1 200 OK
@sehrgut
sehrgut / jquery.evil.js
Last active June 5, 2021 01:23
mask/hijack links with jQuery
/*
jquery.evil.js - mask and hijack links
Copyright (C) 2011 Keith Beckman
Released under the GPLv3
*/
/*
mask(url) replaces the href of each selected link with url, restoring it for
the duration of a click.

Fastest function to intersect a large number of big arrays in javascript, without dependencies

* The compressed version is only 345 caracters long. * Faster than common libraries, even a large number of arrays, or on very big arrays. (See benchmarks) *

Usage

array_intersect(array1, array2, ..., arrayN)

How it works

The idea is simple and comes from here: http://pioupioum.fr/developpement/javascript-array-intersection.html.