Skip to content

Instantly share code, notes, and snippets.

View tsaarni's full-sized avatar

Tero Saarni tsaarni

  • Ericsson
  • Finland
  • 04:34 (UTC +03:00)
View GitHub Profile
diff --git a/hack/generate-crd-clients.sh b/hack/generate-crd-clients.sh
index 9bfeadff..7fee28ca 100755
--- a/hack/generate-crd-clients.sh
+++ b/hack/generate-crd-clients.sh
@@ -17,7 +17,6 @@ readonly DESTDIR=${DESTDIR:-$(mktemp -d)}
readonly YEAR=$(date +%Y)
readonly GO111MODULE=on
-readonly GOFLAGS=-mod=vendor
@tsaarni
tsaarni / README.md
Last active January 2, 2020 20:37
Multiboot in UEFI system with Windows 10 installed on separate drive

Windows boot entry missing from grub menu

Problem: After installing Windows 10 on separate disk, Windows entry is not visible in grub menu. Windows 10 installer might not have used GPT partition table, but instead is using MBR for booting. It might still look like UEFI boot since Windows created small system partition with bit similar content as EFI partition would have.

From https://askubuntu.com/questions/447686/how-to-boot-windows-8-from-a-legacy-mbr-partition-in-uefi-mode-via-grub

The custom GRUB entry isn't needed (at least not for windows 10's boot manager), you can install to the BCD to your main EFI partition, with "bcdboot C:\Windows /s X: /f UEFI", where X is the letter you assigned to the UEFI partition. You can assign a letter to the UEFI partition either using the windows gui or using "diskpart" command line utility. This works even if windows isn't in a GPT partition

@tsaarni
tsaarni / readme.md
Last active December 28, 2019 09:51
Install any version of go (using existing installation of go)

Install any version of go

Get a list of all available go versions by running:

curl -s "https://golang.org/dl/?mode=json&include=all" | jq -r '.[].version' | sort -V

To install latest version of go (not including beta versions) by using existing go installation for bootstrapping:

GOLATEST=$(curl -s "https://golang.org/dl/?mode=json&include=all" | jq -r '.[].version | select(contains("beta") | not )' | sort -V | tail -1)

go get golang.org/dl/$GOLATEST # compiles go downloader

@tsaarni
tsaarni / extract-pre-master-secret.py
Created November 15, 2019 19:15
Extract keys to decrypt Java TLS stream
#!/usr/bin/env python3
#
# Extract TLS pre-master secret to decrypt captured TLS stream in Wireshark
#
# Java TLS implementation can be configured to dump information on TLS stream,
# making it possible to extracting TLS key for decrypting the stream for debug
# purposes.
#
# This script is originally by Timothy Basanov
# https://timothybasanov.com/2016/05/26/java-pre-master-secret.html
drivers/usb/host/dwc_otg/dwc_otg_hcd.c: In function ‘assign_and_init_hc’:
drivers/usb/host/dwc_otg/dwc_otg_hcd.c:1243:19: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hc->xfer_buff = (uint8_t *) urb->dma + urb->actual_length;
^
drivers/usb/host/dwc_otg/dwc_otg_hcd.c:1287:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hc->xfer_buff = (uint8_t *) urb->setup_dma;
^
drivers/usb/host/dwc_otg/dwc_otg_hcd.c:1318:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
hc->xfer_buff = (uint8_t *) hcd->status_buf_dma;
^
@tsaarni
tsaarni / README.md
Last active June 8, 2021 09:40
Wansview NCM700GC web camera
@tsaarni
tsaarni / README.md
Last active June 9, 2021 18:58
How to connect to Azure AKS Kubernetes node VM by SSH

How to connect to Azure AKS Kubernetes worker node by SSH

Nodes are not assigned public IP. If you have accessible VM in the same VNET as worker nodes, then you can use that VM as jump host and connect the worker via private IP.

Alternatively public IP can be assigned to a worker node. This readme shows how to do that.

Steps how to attach public IP to a worker node

find out the resource group that AKS created for the node VMs

@tsaarni
tsaarni / README.md
Last active November 8, 2017 20:23
Installing any version of go compiler on ubuntu

Prepare working environment for go compiler

Create "go path" directory (will store downloads and the source code that you yourself write)

mkdir ~/go

add following to your .bashrc or somewhere

if [ -d $HOME/go ]; then

export GOPATH=${HOME}/go

@tsaarni
tsaarni / openssl-notes.txt
Created October 22, 2016 08:50
Generate self-signed certs with different key types
*** RSA
# Generate self-signed certificate with RSA 4096 key-pair
openssl req -x509 -nodes -days 3650 -newkey rsa:4096 -keyout rsakey.pem -out rsacert.pem
# print private and public key
openssl rsa -in rsakey.pem -text -noout
# print certificate
openssl x509 -in rsacert.pem -text -noout