Skip to content

Instantly share code, notes, and snippets.

View gintsgints's full-sized avatar
🏠
Working from home

Gints gintsgints

🏠
Working from home
  • Balcia SIA
  • Riga, Latvia.
View GitHub Profile
View useScrollHandler.ts
export function useScrollHandler() {
const offsets: Array<Number> = [];
let touchStartY = 0;
let activeSection = 0;
let inMove = false;
const mountHandler = () => {
calculateSectionOffsets();
window.addEventListener('keydown', handleKeyDown);
window.addEventListener('DOMMouseScroll', handleMouseWheelDOM); // Mozilla Firefox
View standard.md

How to enable at VS Code studio

  • Install plugin Standard
  • For vettur choose formatter VS Code Typescript
View microk8s_NanoPI.md
View k3s_on_NanonPI.md
View Traefik.md
View expose_k8s_service.md

Deployment -> Service -> Ingress

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: attachment
  name: server
View Kube_restore.md

How to restore kubernetes after certificate expire

Based on - https://stackoverflow.com/questions/56320930/renew-kubernetes-pki-after-expired/56334732#56334732

$ cd /etc/kubernetes/pki/
$ mv {apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front-proxy-client.crt,front-proxy-client.key,front-proxy-ca.key,apiserver-kubelet-client.key,apiserver.key,apiserver-etcd-client.crt} ~/
$ kubeadm init phase certs all --apiserver-advertise-address <IP>
$ cd /etc/kubernetes/
$ mv {admin.conf,controller-manager.conf,mv kubelet.conf,scheduler.conf} ~/
View PostgREST_docker_compose.md

docker-compose.yml

version: '3'
services:
  server:
    image: postgrest/postgrest
    ports:
      - "3000:3000"
    links:
 - db:db
View docker-multiplatform.md