Skip to content

Instantly share code, notes, and snippets.

View nam20485's full-sized avatar

Nathan Miller nam20485

View GitHub Profile
@nam20485
nam20485 / cursor-extension-importer.sh
Created September 13, 2025 00:39 — forked from kigster/cursor-extension-importer.sh
Import VSCode Extensions into Cursor via CLI
#!/usr/bin/env bash
# vim: ft=bash
#
# © 2025 Konstantin Gredeskoul
# http://github.com/kigster | https://kig.re
#
# This script allows you to export the list of your VSCode
# extensions and import them into, eg. Cursor IDE. Or the
# other way around. By the default the script continues on
# import errors because there are typically quite a few.
@nam20485
nam20485 / wsl2-network.ps1
Created April 21, 2025 03:30 — forked from daehahn/wsl2-network.ps1
WSL 2 TCP NETWORK FORWARDING
# WSL2 network port forwarding script v1
# for enable script, 'Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser' in Powershell,
# for delete exist rules and ports use 'delete' as parameter, for show ports use 'list' as parameter.
# written by Daehyuk Ahn, Aug-1-2020
# Display all portproxy information
If ($Args[0] -eq "list") {
netsh interface portproxy show v4tov4;
exit;
}
@nam20485
nam20485 / NonCopyable.h
Last active October 26, 2024 21:50
NonCopyable base class so you can inherit instead of implementing in every class
#pragma once
class NonCopyable
{
protected:
// 1. provide default ctor so it doesn't have to be explicitly defined in inherited classes
// 2. make NonCopyable class abstract so it can't be instantiated
NonCopyable() {}
/*virtual*/ ~NonCopyable() {}
@nam20485
nam20485 / gen_secret_key.py
Last active June 15, 2023 03:13
Python 3 generate secret key
python -c 'import random; result = "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)]); print(result)'
#python -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'
@nam20485
nam20485 / gist:e1ddd0bf141fd12ca14b0b022a50f5d8
Created February 27, 2021 18:31
Windows Installer (.msi) Command Line Arguments
Windows ® Installer. V 5.0.18362.1
msiexec /Option <Required Parameter> [Optional Parameter]
Install Options
</package | /i> <Product.msi>
Installs or configures a product
/a <Product.msi>
Administrative install - Installs a product on the network
/j<u|m> <Product.msi> [/t <Transform List>] [/g <Language ID>]
@nam20485
nam20485 / gist:e5eab6ed2fdc12aab26e96275eda6f82
Created February 21, 2021 02:40
~ Ubuntu vs. Debian Releases
https://askubuntu.com/a/445496
From 10.04 up to 20.04:
Ubuntu Debian
20.04 focal bullseye/ sid - 11
19.10 eoan buster / sid - 10
19.04 disco buster / sid
18.10 cosmic buster / sid
18.04 bionic buster / sid
@nam20485
nam20485 / Dockerfile
Last active February 21, 2021 02:37
Download & install VS Buildtools in Dockerfile
###
# https://docs.microsoft.com/en-us/visualstudio/install/build-tools-container?view=vs-2019
###
# escape=`
# Use the latest Windows Server Core image with .NET Framework 4.8.
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
# Restore the default Windows shell for correct batch processing.
@nam20485
nam20485 / Dockerfile
Created February 21, 2021 02:35
Download and install .MSI installer in Dockerfile
RUN Write-Host 'Downloading iisnode' ; \
$MsiFile = $env:Temp + '\iisnode.msi' ; \
(New-Object Net.WebClient).DownloadFile('https://github.com/tjanczuk/iisnode/releases/download/v0.2.21/iisnode-full-v0.2.21-x64.msi', $MsiFile) ; \
Write-Host 'Installing iisnode' ; \
Start-Process msiexec.exe -ArgumentList '/i', $MsiFile, '/quiet', '/norestart' -NoNewWindow -Wait
@nam20485
nam20485 / Dockerfile
Created February 21, 2021 02:34
HEALTHCHECK command in Dockerfile
HEALTHCHECK CMD powershell -command `
try { `
$response = iwr http://localhost:80 -UseBasicParsing; `
if ($response.StatusCode -eq 200) { return 0} `
else {return 1}; `
} catch { return 1 }
@nam20485
nam20485 / Dockerfile
Created February 20, 2021 22:12
Installing node (& npm) on a mongo:4.0-xenial docker base image
# base image uses node latest minor version of 12.m
#FROM node:12-stretch-slim
FROM mongo:4.0-xenial
# create and set cwd
WORKDIR /code
# copy npm's package state files
COPY package.json .
COPY package-lock.json .