This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker ps -a -s - отобразить размеры запущенных контейнеров | |
docker builder prune -f ---- clear /var/lib/docker/overlay2 directory | |
docker run -it --rm dtzar/helm-kubectl:3.7.1 /bin/sh - interactive session into container | |
docker exec -i postgres /bin/bash -c "PGPASSWORD=YOUR_PASSWROD pg_dump --username postgres YOUR_DB" > /root/adaptive_db-$(date +%Y-%m-%d).sql | |
docker system df - show containers, volumes, images size |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
systemd service | |
================================================ | |
[Unit] | |
Description=MySQL Exporter Service | |
Wants=network.target | |
After=network.target | |
[Service] | |
User=root | |
Group=root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# find the kube node of the running pod, appear next to hostIP, and note containerID hash | |
kubectl get pod mypod -o json | |
# -> save hostIP | |
# -> save containerID | |
# connect to the node and find the pods unique network interface index inside it's container | |
docker exec containerID /bin/bash -c 'cat /sys/class/net/eth0/iflink' | |
# -> returns index | |
# locate the interface of the node |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
############################################################################### | |
# Helpful Docker commands and code snippets | |
############################################################################### | |
### CONTAINERS ### | |
docker stop $(docker ps -a -q) #stop ALL containers | |
docker rm -f $(docker ps -a -q) # remove ALL containers | |
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter | |
# exec into container |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE_PATH="/root/choco.jks" | |
#1 - chain | |
ISSUER1=$(echo 'issuer' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2> /dev/null | grep Issuer: | awk {'print$2,$3,$4,$5'} | sed 's/,//' | sed -n 1p | sed "s/ //g" | cut -c 4-) | |
KEYSTORE_UNTIL1=$(echo 'dummydummy' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2>/dev/null | grep -i Until | sed 's/.*until: //' | sed -n 1p) | |
#2 - chain | |
ISSUER2=$(echo 'issuer' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2> /dev/null | grep Issuer: | awk {'print$2,$3,$4,$5'} | sed 's/,//' | sed -n 2p | sed "s/ //g" | cut -c 4-) | |
KEYSTORE_UNTIL2=$(echo 'dummydummy' | keytool -list -storepass mypass -v -keystore $FILE_PATH 2>/dev/null | grep -i Until | sed 's/.*until: //' | sed -n 2p) | |
#3 - chain |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=================Filebeat===7.6.2=======/etc/filebeat/filebeat.yml=========================== | |
filebeat.inputs: | |
- type: log | |
enabled: true | |
paths: | |
- /opt/IBM/WebSphere/AppServer/V85/ND/profiles/AppSrv01/logs/Member1/SystemOut.log | |
filebeat.config.modules: | |
path: ${path.config}/modules.d/*.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Пример использования curator для автоматического удаления индексов старше 4 дней. | |
Software versions: | |
curator: 5.8.1 (https://www.elastic.co/guide/en/elasticsearch/client/curator/current/yum-repository.html) | |
ElasticSearch: 7.5.0 | |
1. curator --config /etc/elasticsearch/curator-clients.yml /etc/elasticsearch/curator-actions.yml - запуска куратора | |
0 2 * * * /usr/local/bin/curator --config /etc/elasticsearch/curator/client.yml /etc/elasticsearch/curator/action.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
================================================SRV-1======================================================= | |
! Configuration File for keepalived | |
global_defs { | |
router_id NGINX_MASTER | |
} | |
vrrp_instance NGINX_VRRP_1 { | |
state MASTER | |
interface enp0s3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pcs cluster auth 192.168.0.116 192.168.0.117 -u hacluster -p 123 --force | |
pcs cluster setup --force --name pacemaker1 192.168.0.116 192.168.0.117 | |
pcs status | |
pcs resource create VirtualIP ocf:heartbeat:IPaddr2 ip=192.168.0.120 cidr_netmask=24 op monitor interval=30s | |
pcs resource delete VirtualIP |