Skip to content

Instantly share code, notes, and snippets.

@gurpal2000
gurpal2000 / Using VPS as an extension to home intranet.md
Last active December 4, 2023 08:35
Using VPS as an extension to home intranet

Using VPS as extension to home intranet v1

Using Wireguard show how VPS hardware can be used as an extension to your homelab. I am not interested in exposing services to the internet from the VPS. It is not intended to be a way for a user to VPN into the homelab from the internet.

  • Refer to the diagram at: https://i.imgur.com/n5elXC4.png
  • Server = a host inside your homelab (assume it is NOT a router already).
  • VPS = external cloud host.
  • Assume Ubuntu 18.04 LTS for all hosts involved.
  • Should be able to scale this easily. So if I had numerous VPSs, I could link them (mesh?)
  • I don't know much about OpenVPN, but that may be more suited to the goal. You tell me.
@ecnerwala
ecnerwala / download_prob.py
Last active January 2, 2025 07:58
ecnerwala's CP template system
#!/usr/bin/env python3
"""Download and setup problems from Competitive Companion
Usage:
download_prob.py --echo
download_prob.py [<name>... | -n <number> | -b <batches> | --timeout <timeout>] [--dryrun]
Options:
-h --help Show this screen.
--echo Just echo received responses and exit.
@bla-rs
bla-rs / gist:c439daa0aaa5dea899056bc0b7d34ead
Last active December 19, 2020 01:43 — forked from rgs/gist:7370406
A vim status line item to display git branch name and status of the currently edited file. To be put in the ~/.vimrc.
" returns a string <branch/XX> where XX corresponds to the git status
" (for example "<master/ M>")
function! CurrentGitStatus()
let gitoutput = systemlist('cd '.expand('%:p:h:S').' && git status --porcelain -b 2>/dev/null')
if len(gitoutput) > 0
let b:gitstatus = strpart(get(gitoutput,0,''),3) .'/'. strpart(get(gitoutput,1,' '),1,2)
else
let b:gitstatus = ''
endif
endfunc
@TheJLifeX
TheJLifeX / 00-hand-gesture-recognition.gif
Last active August 15, 2024 10:33
Simple Hand Gesture Recognition Code - Hand tracking - Mediapipe
00-hand-gesture-recognition.gif
@tzvsi
tzvsi / gist:222b3b22a847004a729744f89fe31255
Last active October 17, 2024 04:32
Installing CUDA 10.2, CuDNN 7.6.5, TensorRT 7.0, Ubuntu 18.04

Step 1: Installing CUDA (~5.5 minutes)

You can also install CUDA directly from the offline installer, but this is a little easier.

sudo apt update
sudo apt upgrade -y

mkdir install ; cd install
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-ubuntu1804.pin
import torch
from collections import OrderedDict
from typing import List
checkpoints_weights_paths: List[str] = ... # sorted in descending order by score
model: torch.nn.Module = ...
def average_weights(state_dicts: List[dict]):
everage_dict = OrderedDict()
@caseywatts
caseywatts / 0-self-publishing.md
Last active May 11, 2025 03:30
Self-Publishing via Markdown
@myounus96
myounus96 / convert_voc_to_yolo.md
Last active February 3, 2022 22:27 — forked from vdalv/convert_voc_to_yolo.md
convert pascal voc dataset to yolo format

Convert PascalVOC Annotations to YOLO

This script reads PascalVOC xml files, and converts them to YOLO txt files.

Note: This script was written and tested on Ubuntu. YMMV on other OS's.

Disclaimer: This code is a modified version of Joseph Redmon's voc_label.py

Instructions:

  1. Place the convert_voc_to_yolo.py file into your data folder.
@ryanhanwu
ryanhanwu / Brewfile
Last active October 10, 2024 00:19
New Mac Setup Script 2021
# Taps
tap 'homebrew/cask-fonts'
tap 'homebrew/cask-versions'
tap 'heroku/brew'
# Install CLI Tools
## Shell Utilities
brew 'coreutils'
brew 'findutils'
brew 'autojump'
@docPhil99
docPhil99 / opencv_qt_label.md
Last active April 18, 2025 08:39
How to display opencv video in pyqt apps

The code for this tutorial is here

Opencv provides are useful, but limited, method of building a GUI. A much more complete system could be acheived using pyqt. The question is, how do we display images. There are quite a few possible routes but perhaps the easiest is to use QLabel since it has a setPixmap function. Below is some code that creates two labels. It then creates a grey pixmap and displays it one of the labels. code: staticLabel1.py

from PyQt5.QtWidgets import QWidget, QApplication, QLabel, QVBoxLayout
from PyQt5.QtGui import QPixmap, QColor
import sys