Skip to content

Instantly share code, notes, and snippets.

View WesleyCh3n's full-sized avatar
😺

WesleyCh3n WesleyCh3n

😺
View GitHub Profile
@WesleyCh3n
WesleyCh3n / invert_mouse_wheel.ps1
Created February 22, 2022 02:46
Windows 10 mouse wheel direction
# open powershell in administrator mode
$mode = Read-host "How do you like your mouse scroll (0 or 1)?"; Get-PnpDevice -Class Mouse -PresentOnly -Status OK | ForEach-Object { "$($_.Name): $($_.DeviceID)"; Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters" -Name FlipFlopWheel -Value $mode; "+--- Value of FlipFlopWheel is set to " + (Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Enum\$($_.DeviceID)\Device Parameters").FlipFlopWheel + "`n" }
# 0: default direction
# 1: invert direction
# Reboot to take effect
@WesleyCh3n
WesleyCh3n / install.ps1
Last active May 16, 2022 04:23
Analyze install script
Write-Host @'
Downloading fuan analyze...
'@
$root_dir = "fuan.analyze"
if (Test-Path $root_dir) {
Remove-Item $root_dir -Force -Recurse
}
@WesleyCh3n
WesleyCh3n / opencv_yolov7_tflite.cpp
Last active September 13, 2022 09:43
Tensorflow Lite (tflite) using cv::Mat as input (Tiny Yolo v7) - C++ / Python
#include "opencv2/opencv.hpp"
#include "tensorflow/lite/interpreter.h"
#include "tensorflow/lite/kernels/register.h"
#include "tensorflow/lite/model.h"
#include "tensorflow/lite/optional_debug_tools.h"
#include <iostream>
int main(int argc, char *argv[]) {
// initailize tflite model
const char *filename = "./best.tflite";
@WesleyCh3n
WesleyCh3n / 01-network-manager-all.yaml
Created November 28, 2023 03:26
iptables forwarding (router setting)
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
enp4s0:
dhcp4: true
enp5s0:
addresses:
- 192.168.80.1/24