Skip to content

Instantly share code, notes, and snippets.

View meee1's full-sized avatar

Michael Oborne meee1

View GitHub Profile
private static void ModifyEXE(string[] args)
{
string fileName = args[0];
ModuleDefinition module = ModuleDefinition.ReadModule(new MemoryStream(File.ReadAllBytes(fileName)));
if (module.Kind == ModuleKind.Windows)
module.Kind = ModuleKind.Console;
MethodReference consoleWriteLine =
module.ImportReference(typeof(Console).GetMethod("WriteLine", new Type[] {typeof(object)}));
foreach (var type in module.Types)
nc -l -u 0.0.0.0 12345 </dev/ttyS2 >/dev/ttyS2
nc -u 192.168.144.5 14550 </dev/ttyS2 >/dev/ttyS2
# hp.apj
cat hp.apj | python3 -c "import sys, json; print (json.load(sys.stdin)['image'])" > hp.txt
base64 -d hp.txt > hp.gz
cat hp.gz | perl -e 'use Compress::Raw::Zlib;my $d=new Compress::Raw::Zlib::Inflate();my $o;undef $/;$d->inflate(<>,$o);print $o;' > hp.bin
repo forall -vpc git tag AAU01210415
repo forall -vpc git push cubepilot refs/tags/AAU01210415
"c:\ProgramData\Mission Planner\gstreamer\1.0\x86_64\bin\gst-launch-1.0.exe" rtspsrc location=rtsp://192.168.144.10:8554/H264Video latency=1 udp-reconnect=1 timeout=0 do-retransmission=false ! application/x-rtp ! rtph264depay ! h264parse ! matroskamux ! filesink location=test.mkv
@meee1
meee1 / Layer 2 VPN’s using SSH
Created December 31, 2020 10:10
Layer 2 VPN’s using SSH
Layer 2 VPN’s using SSH from https://la11111.wordpress.com/2012/09/24/layer-2-vpns-using-ssh/
September 24, 2012
Basics:
OpenSSH running on Linux provides the ability to create a VPN tunnel on-the-fly, which can be useful as a quick hack – it’s simple, stable, not the most efficient thing in the world – (tunneling TCP over TCP is generally considered to be a bad idea) – but way easier than trying to set up something like OpenVPN. For preliminary testing, anyway, you can’t beat it.
How it works:
When the tunnel is established, SSH creates a TAP (virtual ethernet tunnel) device on each computer. This link behaves more like a virtual wire than a NIC. As such, you can’t use it directly – you have to create a virtual bridge and add this TAP device to it, treating the bridge as the NIC.
@meee1
meee1 / gist:cb6d2be2131184a89716cb640dd38fa6
Created December 22, 2020 00:52
aosp remount root /system
mount -o rw,remount /system
@meee1
meee1 / vnc
Created December 15, 2020 07:42
vnc
user="michael"
apt-get update
apt-get -y install sudo nano autossh openssh-server x11vnc net-tools
cat <<EOF >> /etc/sudoers
$user ALL=(ALL) NOPASSWD: ALL
EOF
@meee1
meee1 / ofdm.grc
Created December 10, 2020 05:39
ofdm
<?xml version='1.0' encoding='utf-8'?>
<?grc format='1' created='3.7.13'?>
<flow_graph>
<timestamp>Wed Jul 9 15:53:31 2014</timestamp>
<block>
<key>options</key>
<param>
<key>author</key>
<value></value>
</param>
@meee1
meee1 / kcachegrind.txt
Last active March 14, 2022 10:52
valgrind profile
valgrind --tool=callgrind build/sitl/bin/arducopter -M+ --disable-fgview
kcachegrind callgrind.out.*
COMPlus_PerfMapEnabled=1 perf_4.18 record dotnet LogDownload.dll /dev/ttyACM0 1 1
dotnet-trace collect -- dotnet LogDownload.dll /dev/ttyACM0 1 1
https://github.com/brendangregg/FlameGraph
sudo perf script | FlameGraph/stackcollapse-perf.pl | FlameGraph/flamegraph.pl > flamegraph.svg
./nc -l -u 5060 | aplay -r 8000 -f S16_LE -t raw -c 2
speaker-test -c 2
ffmpeg -f s16le -ar 8000 -ac 1 -i udp://localhost:5060 -acodec pcm_s16le -f s16le -ac 2 -ar 8000 - | aplay -r 8000 -f S16_LE -t raw -c 2
ffmpeg -f s16le -ar 8000 -ac 1 -i udp://localhost:5060 -acodec pcm_s16le -f s16le -ac 2 -ar 8000 -listen 1 unix:/tmp/ff.socket