Skip to content

Instantly share code, notes, and snippets.

View patsevanton's full-sized avatar

Anton Patsev patsevanton

View GitHub Profile
@patsevanton
patsevanton / Install ctorrent from SRPM for CentOS 7.txt
Created November 11, 2017 02:30
Install ctorrent from SRPM for CentOS 7
wget http://dl.fedoraproject.org/pub/fedora/linux/releases/26/Everything/source/tree/Packages/c/ctorrent-1.3.4-25.dnh3.3.2.fc26.src.rpm
yum install rpm-build bash-completion-extras openssl-devel gcc-c++
rpmbuild --rebuild ctorrent-1.3.4-25.dnh3.3.2.fc26.src.rpm
cd rpmbuild/RPMS/x86_64/
yum localinstall ctorrent-1.3.4-25.dnh3.3.2.el7.centos.x86_64.rpm
@patsevanton
patsevanton / gist:9d5b4557e46442c05d5bac81c9f14bdc
Created July 7, 2018 16:04
Erasing docker and container-selinux package
<10.233.60.57> SSH: EXEC ssh -vvv -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=user_kuber -o ConnectTimeout=10 -o StrictHostKeyChecking=no -o ControlPath=/root/.ansible/cp/9135954d71 10.233.60.57 '/bin/sh -c '"'"'chmod u+x /home/user_kuber/.ansible/tmp/ansible-tmp-1530978097.9-96170543392269/ /home/user_kuber/.ansible/tmp/ansible-tmp-1530978097.9-96170543392269/yum.py && sleep 0'"'"''
<10.233.60.57> (0, '', 'OpenSSH_7.6p1 Ubuntu-4, OpenSSL 1.0.2n 7 Dec 2017\r\ndebug1: Reading configuration data /etc/ssh/ssh_config\r\ndebug1: /etc/ssh/ssh_config line 19: Applying options for *\r\ndebug1: auto-mux: Trying existing master\r\ndebug2: fd 3 setting O_NONBLOCK\r\ndebug2: mux_client_hello_exchange: master version 4\r\ndebug3: mux_client_forwards: request forwardings: 0 local, 0 remote\r\ndebug3: mux_client_request_session: entering\r\ndebug3: mux_cli
#!/bin/bash
arr=( $(cat /etc/yum.repos.d/mapnik.repo | grep gpgkey | cut -f 2 -d "=" ) )
for i in "${arr[@]}"
do
echo "$i"
rpm --import "$i"
done
ansible-playbook -u Ext-A.Patsev -i inventory/sample/hosts.ini cluster.yml -b
PLAY [localhost] ********************************************************************************************************************************
TASK [Check ansible version <2.7] ***************************************************************************************************************
Saturday 27 October 2018 19:39:56 +0300 (0:00:00.102) 0:00:00.102 ******
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}
check_raw.yml
---
- hosts: all
name: test
gather_facts: False
vars:
http_proxy: 'http://172.16.149.1:3128'
https_proxy: 'http://172.16.149.1:3128'
tasks:
- name: Check http::proxy in /etc/apt/apt.conf
$sdb1 = <<-SCRIPT
parted /dev/sdb mklabel msdos
parted /dev/sdb mkpart primary 0% 100%
mkfs.xfs /dev/sdb1
mkdir /mnt/data1
if grep -Fxq "sdb1" /etc/fstab
then
echo 'sdb1 exist in fstab'
else
echo `blkid /dev/sdb1 | awk '{print$2}' | sed -e 's/"//g'` /mnt/data1 xfs noatime,nobarrier 0 0 >> /etc/fstab
@patsevanton
patsevanton / gist:0c28b19dca2ae9c40ddff87bd4d67389
Created August 11, 2019 14:10
journald - unify data collection
kvaps, [11.08.19 04:06]
By the way, обновил journalbeat в кластере, помимо add_kubernetes_metadata добавил decode_json_fields processor, теперь если сервис пишет логи в JSON, он автоматически распознаёт и парсит его
Alexander Shinkarenko, [11.08.19 08:18]
[In reply to George Gaál]
А в чем его преимущество?
George Gaál, [11.08.19 08:27]
[In reply to Alexander Shinkarenko]
тем, что он сохраняет логи в локальном хранилище и не ломает docker logs (мы не говорим про docker-ee)
Egor:
А в чём преимущество MetalLB(layer2) + Nginx-ingress над nginx-ingress с параметром hostNetwork: true когда кластер состоит из трёх нод(1 мастер и 2 воркера)?
George Gaál:
Металлб даёт единую точку входа.
Во втором случае, кмк, у тебя нужно как-то прикручивать Вирт айпи руками
Egor:
Зачем прикручивать?
TF_LOG=DEBUG terraform apply
2019/08/26 13:14:35 [INFO] Terraform version: 0.12.6
2019/08/26 13:14:35 [INFO] Go runtime version: go1.12.4
2019/08/26 13:14:35 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2019/08/26 13:14:35 [DEBUG] Attempting to open CLI config file: /home/user/.terraformrc
ansible-playbook -i inventory/sample/inventory.ini --become --become-user=root cluster.yml
PLAY [localhost] *******************************************************************************************************************************
TASK [Check ansible version >=2.7.8] ***********************************************************************************************************
Tuesday 27 August 2019 11:03:58 +0600 (0:00:00.063) 0:00:00.063 ********
ok: [localhost] => {
"changed": false,
"msg": "All assertions passed"
}