How to setup a Ubuntu 20.04 server with Kubernetes + CRI-O + Cilium
vim /etc/netplan/01-netcfg.yaml # optional, if DHCP isn't good enough| server { | |
| # ... | |
| # https://serverfault.com/a/593003/219587 | |
| resolver 8.8.8.8; | |
| set $backend "${PROXY_URL}"; | |
| location / { | |
| proxy_pass $backend; | |
| # ... |
| #!/bin/bash | |
| # Find ClusterIPs of Redis nodes | |
| export REDIS_NODES=$(kubectl get pods -l app=redis-cluster -n redis -o json | jq -r '.items | map(.status.podIP) | join(":6379 ")'):6379 | |
| # Activate the Redis cluster | |
| kubectl exec -it redis-cluster-0 -n redis -- redis-cli --cluster create --cluster-replicas 1 ${REDIS_NODES} | |
| # Check if all went well | |
| for x in $(seq 0 5); do echo "redis-cluster-$x"; kubectl exec redis-cluster-$x -n redis -- redis-cli role; echo; done |
Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.
If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: nginx-conf | |
| data: | |
| nginx.conf: | | |
| user nginx; | |
| worker_processes 3; | |
| error_log /var/log/nginx/error.log; | |
| events { |
| SELECT table, | |
| formatReadableSize(sum(bytes)) as size, | |
| min(min_date) as min_date, | |
| max(max_date) as max_date | |
| FROM system.parts | |
| WHERE active | |
| GROUP BY table |
Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version
This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.
| package ru.highloadcup; | |
| import com.wizzardo.metrics.*; | |
| import com.wizzardo.metrics.system.Utils; | |
| import com.wizzardo.tools.cache.Cache; | |
| import java.io.File; | |
| import java.io.FileOutputStream; | |
| import java.lang.management.*; | |
| import java.nio.charset.StandardCharsets; |
| import org.apache.http.client.config.RequestConfig; | |
| import org.apache.http.impl.client.CloseableHttpClient; | |
| import org.apache.http.impl.client.HttpClientBuilder; | |
| import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.context.annotation.Configuration; | |
| @Configuration | |
| public class ClientHttpPoolConfiguration { |
| Backup: | |
| docker exec -t -u postgres your-db-container pg_dumpall -c > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
| Restore: | |
| cat your_dump.sql | docker exec -i your-db-container psql -Upostgres |