Webstorm deployment is not working on modern mac and IPv6
First of all, get all interfaces:
1 2 3 |
networksetup -listallhardwareports # or ifconfig |
Possible solutions: 1. It’s working but you should do it after every login to your mac:
1 |
sudo ifconfig en7 down # you should check what interface inactivation works for you |
2. In webstorm: Help → Edit custom VM options
1 2 |
-Djava.net.preferIPv4Stack=false -Djava.net.preferIPv6Addresses=true |
Help → Edit custom properties
1 |
deployment.macOs.bannedInterfaces=awdl0,utun0,utun1,utun2,utun3 |
You should also check what interfaces work for you.
Check availability and version of a package in Ubuntu
1 2 |
apt-cache search <name> apt-cache policy <name> |
SRE: SLA vs SLO vs SLI
SLA — Service Level Agreement. It’s more about contracts. SLI — Service Level Indicator. It’s some parameters that should be measured and which should be kept in some range. SLO — Service Level Objective. It says how often SLI could fail. Like SLI should be true for 99.9% of the time. Video from Google’s engineer …
Socks5 proxy for telegram
It’s the easiest one you can install on your VPS server. It’s a docker container. https://github.com/schors/tgdante2 You could use VPN for that but it will send all traffic through your VPN endpoint which is not fast. Socks5 proxy uses much less resources and this one is only applicable for telegram now.
React, redux and redux-thunk with typescript
I tried it and it looks strange, verbose and painful. But if you want to try it, please take a look at: https://github.com/piotrwitek/react-redux-typescript-guide https://levelup.gitconnected.com/react-and-redux-with-typescript-da0c37537a79 (together with https://github.com/JonJam/react-redux-ts/tree/68e8cca4a6e6214b4acb030cf3fdb3321b636085/src)
List of resources to prepare for the interview
Mock Interviews interviewing.io (beta), Free Pramp, Free CareerCup, Paid Algorithms Cracking the Code Interview, Book byte by byte, Website and YouTube CS50, YouTube Interview Cake, Website HackerRank, Website LeetCode, Website Operating Systems Operating System Concepts, Book Architecture Design Intro to Architecture and Systems, YouTube Behavioural Intro to Behavioural Interviews, YouTube Original article with explanations: https://medium.freecodecamp.org/software-engineering-interviews-744380f4f2af
What is a Service Mesh? Introductory article from NginX
The original is here — https://www.nginx.com/blog/what-is-a-service-mesh/ Another small introductory article on Istio you can find here. A service mesh is a configurable infrastructure layer for a microservices application. It makes communication between service instances flexible, reliable, and fast. The mesh provides service discovery, load balancing, encryption, authentication and authorization, support for the circuit breaker pattern, and other …
Istio — platform for managing and connecting your microservices. Service mesh
https://istio.io/docs/concepts/what-is-istio/overview.html It’s flexible and modular service mesh made by Google, IBM and Lyft. It is a platform for managing your kubernetes system. It’s responsible traffic management, observability, policy enforcement, service identity and security. It provides features like service discovery, load balancing, A/B experiments, canary deployments, circuit breaking and health checks.
Kubectl helpful commands
k8s cheatsheet. Get all pods by label
1 |
$ kubectl --kubeconfig <config file> get po -lapp=<pod name without hash> -Lversion,cfg,infra-cfg |
Exec into the pod
1 |
$ kubectl --kubeconfig <config file> exec -it <pod name> sh |
Port forwarding
1 |
$ kubectl --kubeconfig <config file> port-forward <pod name> <local port>:<remote port> |
Getting logs
1 |
$ kubectl --kubeconfig <config file> logs <pod name> <pod name without hash> |
Get replica limits from configs:
1 2 3 4 5 |
$ kubectl --kubeconfig <config file> get hpa <pod name without hash> # more details $ kubectl --kubeconfig <config file> get deployment <pod name without hash> --output=yaml $ kubectl --kubeconfig <config file> describe deployments <pod name without hash> $ kubectl --kubeconfig <config file> describe pod <pod name without hash> # CPU and memory limits/requests (quota) |
Remove pod from load balancing to debug startup errors:
1 2 3 |
$ kubectl --kubeconfig <config file> label pod <pod_name> <labels to remove> # and remove (kill the pod) afterwards $ kubectl --kubeconfig <config file> delete pod <pod_name> |
Scale (up/down) pods:
1 2 3 4 |
$ kubectl --context=xx-live-default get pods -l app=boblin -o wide $ kubectl --context=xx-live-default scale --current-replicas=12 --replicas=3 deployment/boblin $ kubectl --context=xx-live-default delete pods boblin-3353777365-qjdpd $ kubectl --kubeconfig <config file> scale deployment <pod name without hash> --current-replicas=0 --replicas=2 |
1 2 3 4 |
$ kubectl --kubeconfig <config file> get po -lapp=<label> -Lversion,cfg $ watch -n 1 kubectl --kubeconfig <config file> get po -lapp=<label> -Lversion,cfg $ kubectl --kubeconfig <config file> exec <exact pod hash> sh $ kubectl --kubeconfig <config file> get hpa <label> |
More commands here: https://kubernetes.io/docs/reference/kubectl/overview/ https://kubernetes.io/docs/reference/kubectl/cheatsheet/
Using npm registry from corporate network
In a company we have some kind of proxy that does not allow to install npm packages via npm or yarn. You can get rid of this problem using this addition to yarn add:
1 |
yarn add react-redux-form --registry="https://registry.npmjs.org" |
Or you can also replace global property with
1 |
npm config set registry https://registry.npmjs.org |
https://stackoverflow.com/a/22390936/801426