Skip to content

Instantly share code, notes, and snippets.

@jimsander
jimsander / fuwsl2.md
Last active May 18, 2023 00:13
Windows and hanging SSH Connections

SSH sessions hang if using WSL2 linux or any linux container

UPDATE : Nope, it's even PowerShell ... (discovered this after revision 4 of this gist)

TLDR; Suspect the virtual machine platform, requried for any containerized system (including Rancher/Docker desktop) is the source of the ssh hangs, as a PowerShell ssh has no hang issues.

This is a known issue for 4 years now

Tried using a Linux container and ssh behaves similarly

@jimsander
jimsander / k8s_install.md
Last active July 13, 2022 12:04
Initial notes on install self-managed k8s

Enable Modules

cat <<EOF | sudo tee /etc/modules-load.d/k8s.conf
overlay
br_netfilter
EOF

sudo modprobe overlay
sudo modprobe br_netfilter
@jimsander
jimsander / cjParse.py
Last active April 15, 2022 22:22
Sample JQ parsing
# Simple CSV to JSON converter.
# No files, just stdin and stdout like a real tool should be
# Jim Sander
import csv
import json
import sys
data = []
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jimsander
jimsander / odme_step11_3.ps1
Created January 11, 2018 18:26
odme_step11_3
Current subscription is 40b7ae52-39d7-48cb-bdff-ef88558c58d5;
ResourceGroup is odme-dev-pm-rg
Tenant: 91c369b5-1c9e-439c-989c-1867ec606603
## Step 11 :: Initial Deployment of Services
Version is dev
Region is pm
Select build
Choose product package
[] Apollo-1.11.0.10717-Engine-2.2.6910-odme-pm-deployment.zip [] Apollo-1.11.0.10712-Engine-2.2.6910-master.zip
# bash apimcall.curl
* Trying 13.89.49.189...
* Connected to extdevapi.azure-api.net (13.89.49.189) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
* Server certificate: *.azure-api.net
* Server certificate: Microsoft IT SSL SHA2
* Server certificate: Baltimore CyberTrust Root
> POST /xcloud/api/core/tenants/e9c18612-8251-48a0-8aa9-f2cf04e549bf/token HTTP/1.1
> Host: extdevapi.azure-api.net
> User-Agent: curl/7.43.0
```
Artifactory Package Install Script starting
true : The term 'true' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\users\azure\documents\visual studio 2015\Projects\Artifactory2\packages\Artifactory.2.3.1\tools\Install.ps1:50
char:39
+ $taskDoc.psbase.PreserveWhitespace = true
+ ~~~~
+ CategoryInfo : ObjectNotFound: (true:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
@jimsander
jimsander / azurerm_invalid_maxsizeinmegabytes.md
Last active January 6, 2017 20:49
AzureRM: Invalid property value for MaxSizeInMegabytes

Using a template file exported from Azure portal, getting an error of invalid size for a topic resource

  ``` {
        "comments": "Generalized from resource: '/subscriptions/26b771e4-52ff-4d34-ab73-8606e48876a7/resourcegroups/charon-services-work/providers/Microsoft.ServiceBus/namespaces/charon-bus/topics/subscriptioncreatedfailures'.",
        "type": "Microsoft.ServiceBus/namespaces/topics",
        "name": "[parameters('topics_subscriptioncreatedfailures_name')]",
        "apiVersion": "2015-08-01",
        "location": "South Central US",
        "properties": {
            "defaultMessageTimeToLive": "14.00:00:00",
@jimsander
jimsander / azure_arm_templates_and_deployments.md
Last active January 6, 2017 19:02
JDS: Azure ARM template and deployments

Being a CommandLine and non-Windows guy, it's been fun trying to work with Azure ARM (Azure Resource Manager) templates. As of last month, VS Code, a cross-platform tool for working with VisualStudio, has a new plugin for working with ARMs.

tl:dr https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-vs-code

Working with ARM Templates in Visual Studio Code

  • install VS Code
  • Open Quick Open
  • ext install azurerm-vscode-tools
  • restart VSCode