Skip to content

Instantly share code, notes, and snippets.

View mjohnsonengr's full-sized avatar
🏠
Working from home

Marcus mjohnsonengr

🏠
Working from home
View GitHub Profile
@mjohnsonengr
mjohnsonengr / WSL-ssh-server.md
Created September 17, 2022 15:04 — 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:
@mjohnsonengr
mjohnsonengr / wsl2-network.ps1
Last active October 7, 2022 14:56 — 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;
}
@mjohnsonengr
mjohnsonengr / gist:31da59ea75174e049ac1dd8545b31c21
Created April 3, 2022 22:33
Daedalus wallet koinly clean up script
function process() {
const ss = SpreadsheetApp.getActiveSpreadsheet();
const sheet = ss.getSheetByName("Clean Up Attempt for Script");
const lastRow = sheet.getLastRow();
const data = sheet.getDataRange().getValues();
for (rowNum = lastRow; rowNum > 1; --rowNum) {
// stop before header row (rowNum == 1)
const row = data[rowNum-1];
if (row[10].toString().length > 0) {
# Set variable values
$resourceGroupName = "SnapshotDemo"
$location = "West US"
$vmName = "SnapshotDemo"
$vmSize = "Standard_A1"
$vnetName = "SnapshotDemo"
$nicName = "snapshotdemo98"
$dnsName = "snapshotdemo"
$diskName = "SnapshotDemo"
$storageAccount = "snapshotdemo5062"