Skip to content

Instantly share code, notes, and snippets.

@andy51002000
andy51002000 / private-k8s.md
Created August 1, 2022 03:42 — forked from pydevops/private-k8s.md
how to set up kubectl on laptop for private GKE cluster and on prem private cluster

HTTP tunnel

On prem k8s cluster set up with bastion vm

  1. Create a bastion vm in your data center or in cloud with connectivity set up (usually vpn) to the on prem data center.
  2. Install tinyproxy on the bastion vm and pick a random port as it would be too easy for spam bot with default 8888, set up as systemd service according to https://nxnjz.net/2019/10/how-to-setup-a-simple-proxy-server-with-tinyproxy-debian-10-buster/. Make sure it works by validating with curl --proxy http://127.0.0.1:<tinyproxy-port> https://httpbin.org/ip. And I don't use any user authentication for proxy, so I locked down the firewall rules with my laptop IP/32.
  3. Download the kubeconfig file for the k8s cluster to your laptop
  4. From your laptop, run
HTTPS_PROXY=<bastion-external-ip>:<tinyproxy-port> KUBECONFIG=my-kubeconfig kubectl get nodes
@andy51002000
andy51002000 / python-es6-comparison.md
Created January 28, 2021 02:48 — forked from logicbomb421/python-es6-comparison.md
# Python3 VS ES6 syntax comparison
@andy51002000
andy51002000 / python-es6-comparison.md
Created January 28, 2021 02:44 — forked from revolunet/python-es6-comparison.md
# Python VS JavaScript ES6 syntax comparison

Python VS ES6 syntax comparison

Python syntax here : 2.7 - online REPL

Javascript ES6 via Babel transpilation - online REPL

Imports

import math
@andy51002000
andy51002000 / MVVM.cs
Created November 2, 2018 09:52 — forked from heiswayi/MVVM.cs
C# MVVM common classes in a single file. Example of usage: https://heiswayi.github.io/2016/mvvm-common-classes-in-single-file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq.Expressions;
using System.Windows;
using System.Windows.Input;
namespace HeiswayiNrird.MVVM.Common
{
@andy51002000
andy51002000 / curl.md
Created April 9, 2018 07:13 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@andy51002000
andy51002000 / nodejs_installer.ps1
Created August 16, 2017 06:48 — forked from nweldev/nodejs_installer.ps1
Powershell script installing nodejs (with git) and some npm packages
write-host "`n ## NODEJS INSTALLER ## `n"
### CONFIGURATION
# nodejs
$version = "4.4.7-x64"
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi"
# git
$git_version = "2.9.2"
@andy51002000
andy51002000 / nodejs_installer.ps1
Created August 16, 2017 06:48 — forked from nweldev/nodejs_installer.ps1
Powershell script installing nodejs (with git) and some npm packages
write-host "`n ## NODEJS INSTALLER ## `n"
### CONFIGURATION
# nodejs
$version = "4.4.7-x64"
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi"
# git
$git_version = "2.9.2"
@andy51002000
andy51002000 / nodejs_installer.ps1
Created August 16, 2017 06:48 — forked from nweldev/nodejs_installer.ps1
Powershell script installing nodejs (with git) and some npm packages
write-host "`n ## NODEJS INSTALLER ## `n"
### CONFIGURATION
# nodejs
$version = "4.4.7-x64"
$url = "https://nodejs.org/dist/latest-v4.x/node-v$version.msi"
# git
$git_version = "2.9.2"