Category Archives: Administration
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:
docker simple starter
Build and run (on linux do not forget sudo): docker image build -t . docker container run —env «DOCKER=true» —env «NODE_ENV=test» —env «NODE_PORT=8000» —mount «type=bind,source=/etc/nginx/sites-enabled,target=/sites-enabled» —env «PATH_CONF=/sites-enabled» -p 8000:8000 —rm —name —network=host Login into container docker container exec -it bash
Pipeline view in shell
tail -f /var/log/nginx/access.log | pv —line-mode —rate > /dev/null https://serverfault.com/questions/473905/is-there-a-unix-linux-command-to-count-lines-per-second-from-stdin
grep, zgrep, less and zless regexp examples
Grep all files with mask: grep «regex to find» /var/log/lb-*.net/nginx/error.log Grep all zipped files with mask: zgrep «regex to find» /var/remote-log/nodejs-1*.net/node/error.log.* Less all files with mask: less /var/log/lb-*.net/nginx/error.log Grep all zipped files with mask: zless /var/remote-log/nodejs-1*.net/node/error.log.* Tail all files with mask: tail -f /var/log/lb-*.net/nginx/error.log
Search for occurencies in directory with grep
grep -rnw ‘/path/to/somewhere/’ -e ‘pattern’ https://stackoverflow.com/questions/16956810/how-do-i-find-all-files-containing-specific-text-on-linux
git squash variants
If you just want to squash all commits into one. 1. The simplest way: git checkout -b <temp-branch> origin/master git merge —squash origin/<branch-with-changes-you-need> git commit -m ‘commit message’ git push origin refs/heads/<temp-branch>:<new-branch> https://stackoverflow.com/a/5309051 If you have a message like ‘error: failed to push some refs to’, add —force to the last command.
Check ssl certificates on a host
openssl s_client -connect your-host:443 If it says something like gethostbyname failure then try following. It needs socat, which can be installed on macOs like this — brew install socat. Then in one terminal open socat TCP4-LISTEN:10443,fork TCP6:your-host:443 and in another terminal: openssl s_client -crlf -connect 127.0.0.1:10443
Check availability and version of a package in Ubuntu
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 …