Skip to content

Instantly share code, notes, and snippets.

View pnsinha's full-sized avatar

P. Sinha pnsinha

View GitHub Profile
1) ==== Autossh using systemd ====
Example from
https://gist.github.com/drmalex07/c0f9304deea566842490
2) =============
Install autossh
@pnsinha
pnsinha / install-singularity.sh
Last active November 27, 2023 05:16 — forked from cory-weller/install-singularity.sh
Script to install singularity
#!/usr/bin/env bash
# prereqs
sudo apt update -y && sudo apt install -y \
build-essential \
libssl-dev \
uuid-dev \
libgpgme11-dev \
squashfs-tools \
@pnsinha
pnsinha / How to use ssh-copy-id.md
Created November 12, 2023 05:29 — forked from CharlesGodwin/How to use ssh-copy-id.md
Windows 10/11 scripts to support ssh-copy-id which is missing in Windows OpenSSH

The Windows version of OpenSSH client doesn't include a ssh-copy-id command. I don't know why. If it does one day, then this can be ignored.

NOTE If you have Windows Subsystem for Linux (WSL) installed, you can use the linux version of ssh-copy-id instead. Go to the description at the end of this document.

  • Download the file ssh-copy-id.cmd to your Windows PC, or copy and paste its contents.
  • Run the script passing your linux ssh information (for example ssh-copy-id.cmd [email protected]). This should work with any Linux platform. Alternatively, if you have experience, you can use the powershell version. ssh-copy-id.ps1. Run the script as powershell .\ssh-copy-id.ps1 [email protected].
  • Run the command for each linux account you connect with. You will be prompted for your Linux host password. If you have more than 1 account on any machine, you must do this for each account.

The file name and location of the script is not important but the filename extension must be .cmd

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

@pnsinha
pnsinha / installs.ps1
Created June 16, 2022 05:20 — forked from jimbrig/installs.ps1
Scoop Configuration and Installation for R
# check execution policy
If ((Get-ExecutionPolicy) -eq 'Restricted') {
Set-ExecutionPolicy Unrestricted -Scope CurrentUser
}
# check powershell $PROFILE
If (!(Test-Path $PROFILE)) {
Write-Host "No PowerShell $PROFILE detected, creating one.." -ForegroundColor Magenta
New-Item -ItemType File -Path $PROFILE -Force
Write-Host "Created PowerShell Profile at: $PROFILE" -ForegroundColor Green
@pnsinha
pnsinha / lxc-create.sh
Created May 30, 2022 11:47 — forked from gigadot/lxc-create.sh
Create LXC and Bridge with LAN interface
#/bin/bash
# Check if bridge-nf-call-iptables is enabled (1 if enabled)
# cat /proc/sys/net/bridge/bridge-nf-call-iptables
# Enable IP Forwarding
# echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
# sysctl --system
CONTAINER_NAME=kube
BRIDGED_NAME=br0
@pnsinha
pnsinha / chocoscoop.ps1
Created March 24, 2022 06:04 — forked from dominicusin/chocoscoop.ps1
install scoop & choco
Set-ExecutionPolicy RemoteSigned -scope CurrentUser
$env:SCOOP='D:\prg\scoop'
[environment]::setEnvironmentVariable('SCOOP',$env:SCOOP,'User')
$env:SCOOP_GLOBAL='D:\prg\sapps'
[environment]::setEnvironmentVariable('SCOOP_GLOBAL',$env:SCOOP_GLOBAL,'Machine')
iwr -useb get.scoop.sh | iex
Set-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
scoop install 7zip innounp dark wixtoolset sudo curl git
#sudo