Skip to content

Instantly share code, notes, and snippets.

@Schnouki
Schnouki / popcorntime-vpn.sh
Last active November 12, 2024 00:33
OpenVPN for a single application using network namespaces -- helper scripts
#!/usr/bin/env zsh
# Initialize VPN
sudo vpnns up
sudo vpnns start_vpn
# Popcorn time!
sudo ip netns exec frootvpn sudo -u $USER popcorntime
# Cleanup
@lodalo
lodalo / re-sign iOS IPA
Last active December 6, 2023 05:06
Steps to re-sign an IPA file with a new provisioning profile
#Unzip the IPA
unzip Application.ipa
#Remove old CodeSignature
rm -R "Payload/Application.app/_CodeSignature"
#Replace embedded mobile provisioning profile
cp "path-to-provisioning-profile/MyEnterprise.mobileprovision" "Payload/Application.app/embedded.mobileprovision"
#If you are resigning to submit to the AppStore you need to extract the entitlements to use later
@natevw
natevw / notes.md
Last active October 10, 2022 22:09
Using Bus Blaster v4 with STM32F4x SWD

Using Bus Blaster v4 with STM32F4x SWD

For SWD (instead of normal JTAG) you need a different CPLD "buffer logic" image on the Bus Blaster, the KT-Link compatible ones seem like the recommended means.

# with buffer logic at https://github.com/dergraaf/busblaster_v4/blob/master/ktlink/ktlink.svf
# via http://dangerousprototypes.com/forum/viewtopic.php?f=37&t=5954 from https://github.com/mchck/mchck/wiki/Getting-Started#wiki-bus-blaster
curl -O https://github.com/dergraaf/busblaster_v4/raw/master/ktlink/ktlink.svf
openocd -f board/dp_busblaster_v3.cfg -c "adapter_khz 1000; init; svf /Users/natevw/Downloads/ktlink.svf; shutdown"
@Cr4sh
Cr4sh / sprintf.c
Last active April 26, 2018 05:03
Position independent sprintf without dependencies
/**
* Declaration
*/
/*
'tfp_format' really is the central function for all tinyprintf. For each output character
after formatting, the 'putf' callback is called with 2 args:
- an arbitrary void* 'putp' param defined by the user and passed unmodified from 'tfp_format';
- the character;
@nedos
nedos / read_saleae.py
Last active April 6, 2018 15:44
This script parses a saleae csv export to generate a verilog simulation file (in picoseconds)
#!/usr/bin/python
import sys
import csv
def print_usage():
print "Usage: {} <csv_file>".format(sys.argv[0])
if len(sys.argv) != 2:
print "Not enough arguments"
print_usage()
@SeanCline
SeanCline / windbg-comcall.md
Last active April 25, 2022 17:10
WinDbg: Getting COM Call target from SendReceive2 stack frame.

Looking at a callstack that is making a COM call to another apartment, look for the SendReceive2 stack frame.

  0:053> kb
  # ChildEBP RetAddr  Args to Child              
  00 1532ed98 752e0ca9 00000002 1532ef44 00000001 ntdll!NtWaitForMultipleObjects+0xc
  01 1532ef1c 756dc2a0 1532eef4 1532ef44 00000000 KERNELBASE!WaitForMultipleObjectsEx+0xdc
  02 1532ef74 75bec1db 00000000 1532efcc 000003e8 user32!MsgWaitForMultipleObjectsEx+0x159
  03 1532efac 75beb438 1532efcc 00000001 1532efd0 combase!CCliModalLoop::BlockFn+0x101
 04 (Inline) -------- -------- -------- -------- combase!ModalLoop+0x50
@bijanebrahimi
bijanebrahimi / cross-compiler.sh
Last active October 17, 2024 13:56
build a linux cross compiler for FreeBSD targets
#!/bin/bash
export TARGET=amd64-marcel-freebsd9.2
export PREFIX=/usr/cross-build
export TARGET_PREFIX=$PREFIX/$TARGET
export PATH=$PATH:$PREFIX/bin
mkdir -p $TARGET_PREFIX{,/lib,/include}
mkdir build-{binutils,gmp,mpfr,mpci,gcc}
@moshekaplan
moshekaplan / PatchExtract125.ps1
Created November 15, 2016 23:27 — forked from anonymous/PatchExtract125.ps1
Patch Extract v1.25 by Greg Linares (@Laughing_Mantis)
<#
================
PATCHEXTRACT.PS1
=================
Version 1.25 Microsoft MSU Patch Extraction and Patch Organization Utility by Greg Linares (@Laughing_Mantis)
This Powershell script will extract a Microsoft MSU update file and then organize the output of extracted files and folders.
Organization of the output files is based on the patch's files and will organize them based on their archicture (x86, x64, or wow64)
as well as their content-type, ie: resource and catalog files will be moved to a JUNK subfolder and patch binaries and index files will
@nathanchrs
nathanchrs / set-proxy
Created February 23, 2017 12:52
Bash script to set proxy on Linux
#!/usr/bin/env bash
# Sets proxy settings.
# Run using `source` command. apt-get proxy settings requires sudo privileges.
# By nathanchrs.
# Configuration
# PROXY_HOST=""
# PROXY_USER=""
# PROXY_PASSWORD=""
@reyramos
reyramos / speed_gps.js
Created March 3, 2017 19:34
Get the speed differential from 2 Longitude and Latitude points.
/**
* Created by ramor11 on 3/3/2017.
*/
function distance_on_geoid(lat1, lon1, lat2, lon2) {
// Convert degrees to radians
lat1 = lat1 * Math.PI / 180.0;
lon1 = lon1 * Math.PI / 180.0;