Skip to content

Instantly share code, notes, and snippets.

@NorbertFenk
NorbertFenk / QtTestBenchmarkWithCMake.txt
Last active June 22, 2018 13:44
QtTest benchmark with CMake
https://stackoverflow.com/a/23560316/5789008
------------------ CMakeLists.txt ------------------
cmake_minimum_required(VERSION 3.9)
project(qt_perf_test_with_cmake)
enable_testing()
set(CMAKE_AUTOMOC ON)
@NorbertFenk
NorbertFenk / fork-cpp-example.cpp
Created July 25, 2018 08:20
Short program to show forking in C++ and how to create zombie process.
#include <iostream>
#include <unistd.h>
int main()
{
std::cout << "------ program started ------" << std::endl;
int counter = 0;
pid_t pid = fork();
#!/usr/bin/env bash
# According to this documentation https://cloud.google.com/container-registry/docs/managing you can move images
# but the gcloud command with add tag option will handle only one tag at a time
# The "if while for" magic will handle multiple tags by retagging the same image.
# Supported input which is provided by the list-tags command:
# 0.2.63
# 0.2.60;0.2.61
# 0.2.59
@NorbertFenk
NorbertFenk / kubernetes-vpa.yaml
Last active July 25, 2019 08:32
Kubernetes VPA examples
# VPA
---
apiVersion: autoscaling.k8s.io/v1beta2
kind: VerticalPodAutoscaler
metadata:
name: my-vpa
namespace: vpa-pdb-test
spec:
targetRef:
apiVersion: "extensions/v1beta1"
---
## Command to run the agent with root user
# docker run -it -u root --rm -v /home/norbi/robot-framework/docker-robot-framework-master:/development/code -v /home/norbi/robot-framework/robot-ansible-install:/development/ansible jenkins/jnlp-slave:3.23-1 bash
# apt-get update
# apt-get install ansible
# xvfb-run \
#--server-args="-screen 0 1920x1080x24 -ac" \
#robot \
@NorbertFenk
NorbertFenk / starship.toml
Created December 13, 2019 17:43
Starship promt config file with enabled kubernetes support. Additionally I changed the order.
prompt_order = [
"username",
"hostname",
"directory",
"git_branch",
"git_commit",
"git_state",
"git_status",
"hg_branch",
"package",
@NorbertFenk
NorbertFenk / VirtualboxVM-enlarge-disk.txt
Last active December 15, 2019 18:51
VirtualboxVM enlarge disk
# 1. convert vmdk to vdi
# https://unix.stackexchange.com/questions/18775/how-to-convert-vmdk-to-vdi-vhd
VBoxManage clonemedium disk <aaaa.vmdk> <aaaa.vdi> --format VDI
# 2. resize the partition, follow this answer
https://askubuntu.com/a/119458
@NorbertFenk
NorbertFenk / install.md
Created January 8, 2020 17:40
spinnaker install guide to kind without disk persistence

Resources https://dzone.com/articles/install-spinnaker-with-halyard-on-kubernetes

https://www.spinnaker.io/setup/install/halyard/

Steps to install spinnaker to a local dev cluster You will need a Kubernetes emulator link kind You will need to install halyard. This is a spinnaker deployment management tool. Here you can find further information about it and an installation guide: https://www.spinnaker.io/setup/install/halyard/ Follow these steps : https://www.spinnaker.io/setup/install/providers/kubernetes-v2/

@NorbertFenk
NorbertFenk / go-learning.md
Created January 9, 2020 11:22
Go notes through the learning phase

Arrays

  • An array type definition specifies a length and an element type.
  • For example, the type [4]int represents an array of four integers.
  • An array's size is fixed
  • Arrays can be indexed in the usual way, so the expression s[n] accesses the nth element, starting from zero.
  • Arrays do not need to be initialized explicitly; the zero value of an array is a ready-to-use
  • An array variable denotes the entire array; it is not a pointer to the first array element (as would be the case in C).
  • When you assign or pass around an array value you will make a copy of its contents.

An array literal can be specified like so:

Comparison betewen the "map as a set" and a string slice accessed by two functions. "Sort" based and "for" based search included too.

Use this command to run the benchmark tests

go test -bench=.