Skip to content

Instantly share code, notes, and snippets.

View JanJastrow's full-sized avatar

Jan Jastrow JanJastrow

View GitHub Profile
@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'
@avarayr
avarayr / altermail.sh
Created January 30, 2022 08:08
Fix AltPlugin.mailbundle after MacOS updates
#!/bin/sh
# Check if running as root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
token=`cat /System/Applications/Mail.app/Contents/Info.plist | grep -A1 "PluginCompatibilityUUID" | grep string | sed 's/<string>//' | sed 's/<\/string>//'`
path="/Library/Mail/Bundles/AltPlugin.mailbundle/Contents/Info.plist"
@rphl
rphl / incidence.js
Last active December 18, 2023 12:33 — forked from kevinkub/incidence.js
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪 (Kreis/Stadt + Bundesland + Trend)
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: briefcase-medical;
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
// Alte version siehe: https://gist.github.com/rphl/0491c5f9cb345bf831248732374c4ef5/revisions
WIDGET WURDE IN EIN REPO VERSCHOBEN, SIEHE:
https://github.com/rphl/corona-widget
@kevinkub
kevinkub / incidence.js
Last active June 27, 2023 12:53
COVID-19 Inzidenz-Widget für iOS innerhalb Deutschlands 🇩🇪
// Licence: Robert Koch-Institut (RKI), dl-de/by-2-0
class IncidenceWidget {
constructor() {
this.previousDaysToShow = 31;
this.apiUrlDistricts = (location) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/arcgis/rest/services/RKI_Landkreisdaten/FeatureServer/0/query?where=1%3D1&outFields=RS,GEN,cases7_bl_per_100k,cases7_per_100k,BL&geometry=${location.longitude.toFixed(3)}%2C${location.latitude.toFixed(3)}&geometryType=esriGeometryPoint&inSR=4326&spatialRel=esriSpatialRelWithin&returnGeometry=false&outSR=4326&f=json`
this.apiUrlDistrictsHistory = (districtId) => `https://services7.arcgis.com/mOBPykOjAyBO2ZKk/ArcGIS/rest/services/Covid19_hubv/FeatureServer/0/query?where=IdLandkreis%20%3D%20%27${districtId}%27%20AND%20Meldedatum%20%3E%3D%20TIMESTAMP%20%27${this.getDateString(-this.previousDaysToShow)}%2000%3A00%3A00%27%20AND%20Meldedatum%20%3C%3D%20TIMESTAMP%20%27${this.getDateString(1)}%2000%3A00%3A00%27&outFields=Landkreis,Meldedatum,AnzahlFall&outSR=4326&f=json`
this.stateToAbbr = {
@geek-at
geek-at / trash.sh
Created August 13, 2020 07:27
The script used to trash a banking phishing site
#!/bin/bash
while :; do
verf=$(cat /dev/urandom | tr -dc '0-9' | fold -w 8 | head -n 1)
pin=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
ip=$(printf "%d.%d.%d.%d\n" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))" "$((RANDOM % 256))")
@dhh
dhh / tracker_blocking.rb
Last active July 27, 2023 14:19
Current list of spy pixels named'n'shamed in HEY, as of April 23, 2020
module Entry::TrackerBlocking
extend ActiveSupport::Concern
included do
has_many :blocked_trackers
end
email_service_blockers = {
"ActiveCampaign" => /lt\.php(.*)?l\=open/,
"AWeber" => "openrate.aweber.com",
@JohnyWS
JohnyWS / Start-RequiredServices.ps1
Created January 3, 2019 15:06
Helper file to spin up various required services
# Helper method
function StartService($ServiceName) {
$arrService = Get-Service -Name $ServiceName
while ($arrService.Status -ne 'Running')
{
Start-Service $ServiceName
write-host $arrService.status
write-host 'Service starting'
Start-Sleep -seconds 5
@zoonderkins
zoonderkins / awesome-dns-resolver.md
Last active May 13, 2023 14:57
awesome-dns-resolver
@giodamelio
giodamelio / outline-bookmarklet.js
Last active April 4, 2022 13:01
A bookmarklet to process the current page to Outline.com and redirect afterwards.
fetch(
"https://outlineapi.com/v3/parse_article?source_url=" +
encodeURIComponent(window.location)
)
.then(res => res.json())
.then(body => {
if (body.error) {
return alert(`Outline Bookmarklet Error: ${body.error}`);
}
window.location.href = `https://outline.com/${body.data.short_code}`
#!/usr/bin/python
import binascii
import hashlib
import hmac
import sys
def GetHash(GameID):
byte_key = binascii.unhexlify('AD62E37F905E06BC19593142281C112CEC0E7EC3E97EFDCAEFCDBAAFA6378D84')
hash = hmac.new(byte_key, 'np_%s' % GameID, digestmod=hashlib.sha256)