Skip to content

Instantly share code, notes, and snippets.

View maxisam's full-sized avatar
💭
I may be slow to respond.

Sam Lin maxisam

💭
I may be slow to respond.
View GitHub Profile
$origNvm = Get-Command nvm -CommandType Application -ErrorAction SilentlyContinue
if ($origNvm) { Set-Alias nvm_external $origNvm.Path }
function nvmFunc {
param(
[string]$Argument,
[string]$Version = ""
)
@maxisam
maxisam / nx+19.8.2.patch
Created November 1, 2024 20:06 — forked from Jordan-Hall/nx+19.8.2.patch
Community remote cache support
diff --git a/node_modules/nx/src/tasks-runner/cache.js b/node_modules/nx/src/tasks-runner/cache.js
index 36a7089..a1b7809 100644
--- a/node_modules/nx/src/tasks-runner/cache.js
+++ b/node_modules/nx/src/tasks-runner/cache.js
@@ -110,7 +110,8 @@ class DbCache {
}
}
else {
- return ((await this.getPowerpackS3Cache()) ??
+ return ((await this.getPowerpackCache(nxJson.communityCache)) ??
@maxisam
maxisam / README.md
Created September 29, 2022 15:40 — forked from magnetikonline/README.md
NSSM - the Non-Sucking Service Manager cheatsheet.
@maxisam
maxisam / dockerfile
Created July 15, 2022 19:59
Debezium Connector Dockerfile
ARG STRIMZI_VERSION="0.28.0"
ARG KAFKA_VERSION="3.1.0"
ARG DEBEZIUM_VERSION="1.9.5.Final"
FROM quay.io/debezium/connect:${DEBEZIUM_VERSION} as connectors
FROM quay.io/strimzi/kafka:${STRIMZI_VERSION}-kafka-${KAFKA_VERSION}
USER root:root
ARG DEBEZIUM_CONNECTOR="sqlserver"
COPY --from=connectors /kafka/connect/debezium-connector-${DEBEZIUM_CONNECTOR}/ /opt/kafka/plugins/debezium-connector-${DEBEZIUM_CONNECTOR}/
@maxisam
maxisam / ddns-start
Created May 22, 2022 03:08 — forked from ql-owo-lp/ddns-start
Asus-Merlin-DuckDNS
#!/bin/sh
# register a subdomain at https://www.duckdns.org/ to get your token
# put 'hostname|token' in the 'Host Name' field under DDNS
# e.g. myhost|abcdefgh-1234-5678-9876-f71b0ed7a7fe
DDNS_HOSTNAME_FIELD=$(nvram get ddns_hostname_x)
SUBDOMAIN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $1}')
TOKEN=$(echo "$DDNS_HOSTNAME_FIELD" | awk -F'|' '{print $2}')
IPV4=$(nvram get wan0_ipaddr)
@maxisam
maxisam / from.yaml
Created February 7, 2022 17:04 — forked from Daniel-ltw/from.yaml
Github Actions repository_dispatch example
name: Build Artifacts
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
@maxisam
maxisam / export_workflow_runs_to_md.py
Last active February 3, 2022 18:28 — forked from bauergeorg/export_workflow_runs_to_md.py
Print a Markdown-Page for more details of your workflow_dispatched Workflow Runs
from github import Github
import tomark
import datetime
from dateutil import tz
class pipeline_mngt_adv():
''' Class for pipeline management '''
def __init__(self, token, org):
''' Init function
@maxisam
maxisam / 2015-11-yadm.md
Created November 16, 2021 17:43 — forked from ben-axnick/2015-11-yadm.md
How to manage dotfiles with YADM

Background

Solutions I've tried

  • Git repo directly checked out in home directory

    • Noisy
    • Have to ignore *, everything is a --force
    • Juggling machine variations is a pain
  • Homesick / Homeshick

# Start SSH Service.
wsl sudo service ssh start
# 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") {
@maxisam
maxisam / WSL-ssh-server.md
Created November 4, 2021 10:11 — forked from dentechy/WSL-ssh-server.md
A step by step tutorial on how to automatically start ssh server on boot on the Windows Subsystem for Linux

How to automatically start ssh server on boot on Windows Subsystem for Linux

Microsoft partnered with Canonical to create Bash on Ubuntu on Windows, running through a technology called the Windows Subsystem for Linux. Below are instructions on how to set up the ssh server to run automatically at boot.

  1. Edit the /etc/ssh/sshd_config file by running the command sudo vi /etc/ssh/sshd_config and do the following
    1. Change Port to 2222 (or any other port above 1000)
    2. Change PasswordAuthentication to yes. This can be changed back to no if ssh keys are setup.
  2. Restart the ssh server:
    • sudo service ssh --full-restart
  3. With this setup, the ssh server must be turned on every time you run Bash on Ubuntu on Windows, as by default it is off. Use this command to turn it on: