Category Archives: Administration
Setup local Athens for proper go mod
There is a project called Athens for proxying all your go mod downloads. How to use it locally. 1. Create the following files and directories: a. /Users/d.bolgov/.ssh-athens/storage — empty directory to cache go modules b. /Users/d.bolgov/.ssh-athens/.netrc — if you prefer using .netrc
1 2 3 |
machine github.com login [yourlogin] password [yourpassword] |
c. /Users/d.bolgov/.ssh-athens/gitconfig/.gitconfig — if you want to substitue some urls. I personally …
Port forwarding with kubectl
If you want some kubernetes pod to forward all the traffic to you local machine, you can do this: 1. get pod id with
1 |
kubectl --kubeconfig <config> get po -lapp=<pod_label_app> -Lversion,cfg,infra-cfg |
2. forward exact port from it to you localhost with
1 |
kubectl --kubeconfig <config> port-forward <pod-id> localhost_port:pod_port |
And you can request you localhost to reach pod on selected port.
Checking restart problems with mysql on centos
You probable installed MySQL with a help of article like this — https://phoenixnap.com/kb/how-to-install-mysql-on-centos-7 So your mysql is controlled by systemctl. Check current status — sudo systemctl status mysqld. Start service — sudo systemctl start mysqld Logs for systemctl are here — sudo journalctl -xe Logs for mysql can be found here — /var/log/mysqld.log. Configs are …
Letsencrypt — easy way
Now you can install certbot-nginx and it will do everything for you.
1 |
sudo yum install certbot-nginx |
And then
1 |
sudo certbot --nginx -d example.com -d www.example.com |
If it does not work, try this sudo certbot -d example.com -d www.example.com and then select nginx in a prompt. https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-centos-7
Install postgresql 11 on CentOs7
Just what to do, no discussion.
How to split disk pool on synology nas
I have a Synology NAS DS 218+. When I bought it, I decided to make a RAID1 pool from two disks. But after time passed, I realized that I don’t have enough space to store all files. And I decided to make two separate disks instead of one RAID1. RAID0 is worse for me comparing …
Linux. History of system usage
There is a way to monitor your system usage and log to a file easily — with atop command. On my Ubuntu it can be installed with
1 |
sudo apt-get install atop |
It can be started as a top command — it’s output almost the same. But the most interesting feature is that it starts a daemon that logs …
Kubernetes’ cronjobs
That’s what it is — https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ Get all cronjobs in env:
1 |
kubectl --kubeconfig ... --namespace platform -o wide get cronjobs |
Get info on exact cronjob:
1 |
kubectl --kubeconfig ... --namespace platform describe cronjob/smartrouting-cron-import-from-bi |
Get pods with this cronjob:
1 |
kubectl --kubeconfig ... --namespace platform -o wide get pods|grep "rou" |
Get logs of cronjob
1 |
kubectl --kubeconfig ... --namespace platform logs smartrouting-cron-import-from-bi-1555060200-dqg5j |
you can add -f for live updating logs and -p for watching logs of previous pod.
Crontab time format
That’s about it: min hour day/month month day/week Execution time 30 0 1 1,6,12 * — 00:30 Hrs on 1st of Jan, June & Dec. 0 20 * 10 1-5 –8.00 PM every weekday (Mon-Fri) only in Oct. 0 0 1,10,15 * * — midnight on 1st ,10th & 15th of month 5,10 0 10 …
docker-compose example for ceph, kafka, postgres cluster
That is how it can be done: