Your cart is currently empty!
Author: Website Admin
Docker: Logs Output
Docker only logs STDOUT and STDERR from PID 1. Sending stuff to STDOUT and STDERR of PID n:
MySQL: Too Many Connections Error
Check status: Check config: Default max_connections config is 151. Check current process list: By the end of the line you will get the total connections. Set new max_connection value: References: MySQL – SHOW VARIABLES Statement (tutorialspoint.com) MySQL – SET Syntax for Variable Assignment (tutorialspoint.com)
Golang: String Format
%% prints a single % %b binary integer %c a character represented by the corresponding Unicode code point %d decimal integer %e scientific notation (mantissa/exponent), lowercase %E scientific notation (mantissa/exponent), uppercase %f decimal floating point, lowercase %F decimal floating point, uppercase %g the shortest representation of %e or %f %G the shortest representation of %E…
Kubernetes: Headless Service and Endpoints
Say you have Kubernetes node on 192.168.1.10 and a database node on 192.168.1.11. First, we create a dummy service: When you create a service you will also get an endpoint: To get my-db to point to 192.168.1.11. First, we need to edit the endpoint to point to 192.168.1.11. Add these lines to the end of…
Golang: Append via Function Receiver
Create new type that holds slice of user struct. Create function receiver for our new type. In our main function we can use it to add user struct to the slice.
Golang: Conditional with Empty Struct
This will generate an error The correct way to write is to enclose struct with parentheses (User{}) However, this works
Vim: Insert Mode
Pressing Ctrl-o in insert mode will turn Vim into normal mode for one set of command. Pressing Esc in insert mode will turn Vim into normal mode permanently.
Kubernetes: Node Cordon vs. Node Drain
Node Cordon This will mark the node as unschedulable. New pod will not be scheduled to be deployed on this node. Existing pods still run on this node until the next reschedule. Node Uncordon This will mark the node as schedulable. Node Drain This will mark the node as unschedulable and at the same time…