Skip to content

Instantly share code, notes, and snippets.

View WesleyCh3n's full-sized avatar
😺

WesleyCh3n WesleyCh3n

😺
View GitHub Profile
@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";
package main
import (
"fmt"
"strings"
"gopkg.in/ldap.v2"
)
const (
ldapServer = "ad.example.com:389"
@font-face {
font-family: 'VictorMono Nerd Font Mono';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Regular/complete/Victor%20Mono%20Regular%20Nerd%20Font%20Complete%20Mono.ttf') format('truetype');
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: 'VictorMono Nerd Font Mono';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Bold/complete/Victor%20Mono%20Bold%20Nerd%20Font%20Complete%20Mono.ttf') format('truetype');
@font-face {
font-family: 'VictorMono NF';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Medium/VictorMonoNerdFont-Medium.ttf') format('truetype');
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: 'VictorMono NF';
src: url('https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/VictorMono/Italic/VictorMonoNerdFont-Italic.ttf') format('truetype');
@WesleyCh3n
WesleyCh3n / tmuxv3.2a.sh
Created July 8, 2023 03:41
compile and install tmux v3.2a on ubuntu
#!/usr/bin/env bash
sudo apt install libevent-dev ncurses-dev build-essential bison pkg-config
wget https://github.com/tmux/tmux/releases/download/3.2a/tmux-3.2a.tar.gz
tar -zxf tmux-3.2a.tar.gz
cd tmux-3.2a
./configure
make && sudo make install
@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
@WesleyCh3n
WesleyCh3n / netplan.yaml
Created December 15, 2023 06:26
netplan ip client
network:
version: 2
renderer: NetworkManager
ethernets:
enp0s31f6:
addresses:
- 192.168.11.2/24
nameservers:
addresses:
- 8.8.8.8
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
# Check ssh client/server availability
Get-WindowsCapability -Online | Where-Object Name -like 'OpenSSH*'
# Install Client if not present
Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0
# Install Server if not present
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
# Start ssh server
@WesleyCh3n
WesleyCh3n / vs_cpp_winget.md
Created January 17, 2025 15:34 — forked from robotdad/vs_cpp_winget.md
Installing VS C++ workloads with winget

This is a short outline of how to install the C++ workload with Visual Studio or the build tools using winget.

To find VS releases with winget use search. winget search buildtools

The install command will install the VS installer with the core of the selected product installed. That isn't much. So if you use either of these commands to insll VS or the build tools you will need to launch the VS installer afterwards and select the relevant C++ workloads you need.

winget install Microsoft.VisualStudio.2022.BuildTools

winget install Microsoft.VisualStudio.2022.Community