Skip to content

Instantly share code, notes, and snippets.

@charlie-x
charlie-x / gist:8b2a9e2d1ebaa11554be0ffc6871a0bb
Created Aug 11, 2021
windows 10 install.wim extraction and using it for MSU
View gist:8b2a9e2d1ebaa11554be0ffc6871a0bb
notes on dism etc
download matching windows 10 ISO matching winver.exe, mount the iso or extract it
@powershell
Mount-DiskImage -ImagePath "c:\temp\Windows-10x64.iso"
(Get-DiskImage "c:\temp\Windows-10x64.iso" | Get-Volume).DriveLetter
if htere is no install.wim and its an install.esd instead
and change to the directory where it is, show the types of windows that are available
@charlie-x
charlie-x / gist:96a92aaaa04346bdf1fb4c3621f3e392
Created Jul 28, 2021
recompile wsl2 kernel, add modules and CAN modules + can utils.
View gist:96a92aaaa04346bdf1fb4c3621f3e392
mines ubuntu 20.04 based, WSL2
in windows
wsl --list -v
* Ubuntu-20.04 Stopped 2
in wsl
# the old update routine
sudo apt-get update -y
# add tools to build kernel, apologies if i missed anything as i already have a bunch of dev stuff setup
sudo apt-get install -y autoconf bison build-essential flex libelf-dev libncurses-dev libssl-dev libtool libudev-dev
@charlie-x
charlie-x / gist:b61719cf09bc07e3c83aae28fe781933
Created Jan 7, 2021
build hackrf/windows msvc 2019 static
View gist:b61719cf09bc07e3c83aae28fe781933
git clone https://github.com/mossmann/hackrf
vcpkg install libusb:x64-windows-static
vcpkg install pthreads:x64-windows-static
cmake-gui
select hackrf/host/libhackrf/
select build folder
if cmake isn't integrated
View gist:ad4b891092d872e71163b7142364a0bb
#windows10 admin powershell
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=22 connectaddress=YOUR_WSL2IP connectport=22
netsh advfirewall firewall add rule name="Open Port 22 for WSL2" dir=in action=allow protocol=TCP localport=22
netsh interface portproxy show v4tov4
#wsl2
#first time
sudo apt-get install -y openssh-server
sudo ssh-keygen -A
@charlie-x
charlie-x / setup_gnuais.sh
Last active Jan 2, 2021
gnuradio + ais sim for WSL2 ubuntu 20.xx
View setup_gnuais.sh
# ubuntu 20+
sudo apt-get install -y gnuradio
sudo apt-get install -y git
sudo apt-get install -y doxygen
sudo apt-get install -y swig-dev
sudo apt-get install -y swig
sudo apt-get install -y libswig-dev
sudo apt-get install -y liborc-dev
sudo apt-get install -y libhackrf-dev
sudo apt-get install -y libbladerf-dev
View ais-simulator-file2.grc
options:
parameters:
author: Mictronics
category: Custom
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
View ais-simulator-file.grc
options:
parameters:
author: Mictronics
category: Custom
cmake_opt: ''
comment: ''
copyright: ''
description: ''
gen_cmake: 'On'
gen_linking: dynamic
View gist:c42655120e81716e4ff580bec0b3d205
#include "stdafx.h"
#define DIRECTINPUT_VERSION 0x0700
#include <wbemidl.h>
#include <dinput.h>
#include <xinput.h>
#pragma comment(lib,"xinput.lib")
#define SAFE_RELEASE(x) if(x) { x->Release(); x = NULL; }
View gist:36fc55d80ad1f00c06cfb7e068a83aff
#include <iostream>
using std::cout, std::endl;
#include <string>
using std::string, std::to_string;
struct eat { constexpr eat(auto...){} };
constexpr auto Tree(auto left, long val, auto right) {
return [=](auto f) { return f(left, val, right); };
}
View gist:d3b265ccb427139ee39619ae5736ebb9
int vasprintf(char** strp, const char* format, va_list ap)
{
int len = _vscprintf(format, ap);
if (len == -1)
return -1;
char* str = (char*)malloc((size_t)len + 1);
if (!str)
return -1;
int retval = vsnprintf(str, len + 1, format, ap);