Skip to content

Instantly share code, notes, and snippets.

View tsaarni's full-sized avatar

Tero Saarni tsaarni

  • Ericsson
  • Finland
  • 11:13 (UTC +03:00)
View GitHub Profile
@tsaarni
tsaarni / README.md
Last active June 8, 2021 09:40
Wansview NCM700GC web camera
@tsaarni
tsaarni / README.md
Last active April 19, 2026 18:50
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
@tsaarni
tsaarni / 00-PROFANITY-IN-DOCKER-README.md
Last active April 26, 2016 12:02
Run profanity inside docker

Profanity inside Docker container

Building the container image

Clone this repository:

git clone https://gist.github.com/0c6f5f31f874d39e0860c48fd4b575e8.git docker-profanity
cd docker-profanity

and then run following command to build the image:

@tsaarni
tsaarni / 00-asio-handler-member-function.md
Last active August 13, 2021 17:39
boost::asio with handler callback as member function, guarded by weak_ptr

Using member function as boost::asio handler

This example demonstrates how to implement boost::asio handler callback as a member functions in a safe way, even while the ASIO timer or socket object is itself also contained in the same object.

Problem

When deleting the object containing both the handler method and ASIO

#include <boost/exception/diagnostic_information.hpp>
struct MyException : virtual boost::exception, virtual std::exception
{
virtual const char* what() const throw() { return boost::diagnostic_information_what(*this); }
};
// clang++ -Wall -std=c++11 -O0 -o scope-exit scope-exit.cpp && ./scope-exit
// g++ -Wall -std=c++11 -O0 -o scope-exit scope-exit.cpp && ./scope-exit
#include <iostream>
template <typename F>
struct ScopeExit
{
ScopeExit(F f) : f(f) {}
~ScopeExit() { f(); }
@tsaarni
tsaarni / 00-elk-stack-sshd-log-analysis.md
Last active February 4, 2026 11:54
Using ELK stack (Elasticsearch + Logstash + Kibana) for offline SSHD log analysis

Using ELK stack for offline SSHD log analysis

To start Elasticsearch + Logstash + Kibana execute:

docker-compose up

The container images will be downloaded from docker hub at first run.

Next, import the log file data to logstash