liannnix revised this gist 1 month ago. Go to revision
1 file changed, 45 insertions
hasher.md(file created)
| @@ -0,0 +1,45 @@ | |||
| 1 | + | # Hasher | |
| 2 | + | ||
| 3 | + | ## hasher user config | |
| 4 | + | ||
| 5 | + | `~/.hasher/config` | |
| 6 | + | ||
| 7 | + | ``` | |
| 8 | + | packager="Andrey Limachko <liannnix@altlinux.org>" | |
| 9 | + | ## Сборка в /tmp (оперативная память) | |
| 10 | + | # workdir="/tmp/.private/$USER/" | |
| 11 | + | workdir="$HOME/hasher" | |
| 12 | + | target=x86_64 | |
| 13 | + | mount=/dev/pts,/proc | |
| 14 | + | known_mountpoints=/proc,/dev/pts,/sys | |
| 15 | + | def_repo="$HOME/alt/repo" | |
| 16 | + | ``` | |
| 17 | + | ||
| 18 | + | ## hasher-priv | |
| 19 | + | ||
| 20 | + | `/etc/hasher-priv/system` | |
| 21 | + | ||
| 22 | + | ``` | |
| 23 | + | # Systemwide configuration for the hasher-priv(8) helper program. | |
| 24 | + | # See hasher-priv.conf(5) for details. | |
| 25 | + | ||
| 26 | + | prefix=~:/tmp/.private | |
| 27 | + | allow_ttydev=yes | |
| 28 | + | allowed_mountpoints=/proc,/dev/pts,/dev/shm,/sys,/sys/fs/cgroup | |
| 29 | + | allowed_devices=/dev/kvm | |
| 30 | + | #rlimit_soft_cpu=86400 | |
| 31 | + | #rlimit_hard_cpu=87000 | |
| 32 | + | #wlimit_time_elapsed=40000 | |
| 33 | + | #wlimit_time_idle=3600 | |
| 34 | + | #wlimit_bytes_written=17179869184 | |
| 35 | + | #nproc=32 | |
| 36 | + | ``` | |
| 37 | + | ||
| 38 | + | `/etc/hasher-priv/fstab` | |
| 39 | + | ||
| 40 | + | ``` | |
| 41 | + | # Information about mount points for the hasher-priv(8) helper program. | |
| 42 | + | # See fstab(5) for details. | |
| 43 | + | ||
| 44 | + | proc /proc proc rw,nosuid,nodev,noexec,gid=proc,hidepid=2 0 0 | |
| 45 | + | ``` | |
liannnix revised this gist 1 month ago. Go to revision
11 files changed, 11 insertions, 11 deletions
btrfs.md
| @@ -5,4 +5,4 @@ | |||
| 5 | 5 | ```bash | |
| 6 | 6 | btrfs dev add /dev/sda1 / | |
| 7 | 7 | btrfs balance start -dconvert=raid1 -mconvert=raid1 | |
| 8 | - | ``` | |
| 8 | + | ``` | |
dd.md
| @@ -2,4 +2,4 @@ | |||
| 2 | 2 | ||
| 3 | 3 | ```bash | |
| 4 | 4 | dd if=/dev/zero of=test1.img bs=5G count=1 oflag=dsync && rm -rf test1.img | |
| 5 | - | ``` | |
| 5 | + | ``` | |
dogtag.md
| @@ -17,4 +17,4 @@ pkispawn | |||
| 17 | 17 | ```bash | |
| 18 | 18 | pki pkcs12-import --pkcs12 ~/.dogtag/pki-main/ca_admin_cert.p12 --password-file pass.txt | |
| 19 | 19 | pki client-cert-import --pkcs12 ~/.dogtag/pki-main/ca_admin_cert.p12 --pkcs12-password-file pass.txt | |
| 20 | - | ``` | |
| 20 | + | ``` | |
git.md
| @@ -43,4 +43,4 @@ git add -p | |||
| 43 | 43 | ||
| 44 | 44 | ```bash | |
| 45 | 45 | git log --first-parent | |
| 46 | - | ``` | |
| 46 | + | ``` | |
glusterfs.md
| @@ -67,4 +67,4 @@ gluster volume heal sysvol info | |||
| 67 | 67 | ||
| 68 | 68 | ```bash | |
| 69 | 69 | gluster volume heal | |
| 70 | - | ``` | |
| 70 | + | ``` | |
lxc.md
| @@ -4,4 +4,4 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ``` | |
| 6 | 6 | */2 * * * * /usr/bin/host -W 5 ya.ru 192.168.20.53 2>&1 > /dev/null || /usr/bin/systemctl restart bind | |
| 7 | - | ``` | |
| 7 | + | ``` | |
nsupdate.md
| @@ -24,4 +24,4 @@ realm GIRAN.CYOU | |||
| 24 | 24 | update delete 7.2.b.0.f.b.e.f.f.f.e.7.d.1.4.a.a.0.0.0.3.0.0.1.0.4.8.e.2.0.a.2.ip6.arpa. in PTR | |
| 25 | 25 | update add 7.2.b.0.f.b.e.f.f.f.e.7.d.1.4.a.a.0.0.0.3.0.0.1.0.4.8.e.2.0.a.2.ip6.arpa. 3600 in PTR yun.giran.cyou. | |
| 26 | 26 | send | |
| 27 | - | ``` | |
| 27 | + | ``` | |
openssl.md
| @@ -4,4 +4,4 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ``` | |
| 6 | 6 | openssl x509 -in cert.pem -noout -text | |
| 7 | - | ``` | |
| 7 | + | ``` | |
openvswitch.md
| @@ -4,4 +4,4 @@ | |||
| 4 | 4 | ||
| 5 | 5 | ```bash | |
| 6 | 6 | ovs-vsctl add-port trunk vlv4ttk_v4ttk tag=201 -- set interface vlv4ttk_v4ttk type=internal | |
| 7 | - | ``` | |
| 7 | + | ``` | |
pkinit.md
| @@ -112,4 +112,4 @@ cp /home/test/*.pem /var/lib/kerberos/krb5/ | |||
| 112 | 112 | ... | |
| 113 | 113 | pkinit_anchors = FILE:/var/lib/kerberos/krb5/cacert.pem | |
| 114 | 114 | #pkinit_identities = FILE:/var/lib/kerberos/krb5/client.pem,/var/lib/kerberos/krb5/clientkey.pem | |
| 115 | - | ``` | |
| 115 | + | ``` | |
Andrey Limachko revised this gist 1 month ago. Go to revision
19 files changed, 426 insertions, 1 deletion
X11Forwarding.md(file created)
| @@ -0,0 +1,26 @@ | |||
| 1 | + | # SSH: X11 Forwarding | |
| 2 | + | ||
| 3 | + | ## Connect | |
| 4 | + | ||
| 5 | + | ``` | |
| 6 | + | ssh -YC <host> | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | ## KDE QT5 themes | |
| 10 | + | ||
| 11 | + | ### On client | |
| 12 | + | ||
| 13 | + | .ssh/config | |
| 14 | + | ``` | |
| 15 | + | Host orion # orion | |
| 16 | + | HostName orion.giran.cyou | |
| 17 | + | User liannnix | |
| 18 | + | SetEnv XDG_CURRENT_DESKTOP=kde | |
| 19 | + | ``` | |
| 20 | + | ||
| 21 | + | ### On server | |
| 22 | + | ||
| 23 | + | /etc/openssh/sshd_config | |
| 24 | + | ``` | |
| 25 | + | AcceptEnv XDG_CURRENT_DESKTOP | |
| 26 | + | ``` | |
abc (file deleted)
| @@ -1 +0,0 @@ | |||
| 1 | - | abc | |
btrfs.md(file created)
| @@ -0,0 +1,8 @@ | |||
| 1 | + | # BTRFS | |
| 2 | + | ||
| 3 | + | ## Создание RAID1 из уже существующей ФС | |
| 4 | + | ||
| 5 | + | ```bash | |
| 6 | + | btrfs dev add /dev/sda1 / | |
| 7 | + | btrfs balance start -dconvert=raid1 -mconvert=raid1 | |
| 8 | + | ``` | |
dd.md(file created)
| @@ -0,0 +1,5 @@ | |||
| 1 | + | # HDD speed test | |
| 2 | + | ||
| 3 | + | ```bash | |
| 4 | + | dd if=/dev/zero of=test1.img bs=5G count=1 oflag=dsync && rm -rf test1.img | |
| 5 | + | ``` | |
dogtag.md(file created)
| @@ -0,0 +1,20 @@ | |||
| 1 | + | # Dogtag | |
| 2 | + | ||
| 3 | + | ## Установка | |
| 4 | + | ||
| 5 | + | ```bash | |
| 6 | + | apt-get install pki-base pki-ca pki-server dogtag-pki-server-theme | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | ## Инициализация | |
| 10 | + | ||
| 11 | + | ```bash | |
| 12 | + | pkispawn | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | ## Ипортирование сертификата администратора | |
| 16 | + | ||
| 17 | + | ```bash | |
| 18 | + | pki pkcs12-import --pkcs12 ~/.dogtag/pki-main/ca_admin_cert.p12 --password-file pass.txt | |
| 19 | + | pki client-cert-import --pkcs12 ~/.dogtag/pki-main/ca_admin_cert.p12 --pkcs12-password-file pass.txt | |
| 20 | + | ``` | |
git.md(file created)
| @@ -0,0 +1,46 @@ | |||
| 1 | + | # GIT | |
| 2 | + | ||
| 3 | + | ## Worktree | |
| 4 | + | ||
| 5 | + | ```bash | |
| 6 | + | git worktree | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | ## Blame | |
| 10 | + | ||
| 11 | + | ```bash | |
| 12 | + | git blame | |
| 13 | + | ``` | |
| 14 | + | ||
| 15 | + | ## Ours strategy | |
| 16 | + | ||
| 17 | + | ```bash | |
| 18 | + | git merge -s ours | |
| 19 | + | ``` | |
| 20 | + | ||
| 21 | + | ## Empty branch | |
| 22 | + | ||
| 23 | + | ```bash | |
| 24 | + | git switch --orphan <branch> | |
| 25 | + | ``` | |
| 26 | + | ||
| 27 | + | ## From srpm to gear migration hack | |
| 28 | + | ||
| 29 | + | ```bash | |
| 30 | + | git merge --no-commit --allow-unrelated-histories -s ours <upstream-tag> | |
| 31 | + | git read-tree -u --reset <upstream-tag> | |
| 32 | + | git checkout @ -- .gear package.spec | |
| 33 | + | git commit -a | |
| 34 | + | ``` | |
| 35 | + | ||
| 36 | + | ## Chunked add | |
| 37 | + | ||
| 38 | + | ```bash | |
| 39 | + | git add -p | |
| 40 | + | ``` | |
| 41 | + | ||
| 42 | + | ## See only my commits | |
| 43 | + | ||
| 44 | + | ```bash | |
| 45 | + | git log --first-parent | |
| 46 | + | ``` | |
glusterfs.md(file created)
| @@ -0,0 +1,70 @@ | |||
| 1 | + | # GlusterFS | |
| 2 | + | ||
| 3 | + | ## Установка пакетов | |
| 4 | + | ||
| 5 | + | ```bash | |
| 6 | + | apt-get install glusterfs9 glusterfs9-server | |
| 7 | + | ``` | |
| 8 | + | ||
| 9 | + | ## Включение и запуск сервисов | |
| 10 | + | ||
| 11 | + | ```bash | |
| 12 | + | systemctl enable --now glusterfssharedstorage.service | |
| 13 | + | systemctl enable --now glusterd.service | |
| 14 | + | ``` | |
| 15 | + | ||
| 16 | + | ## Добавление пиров (node) | |
| 17 | + | ||
| 18 | + | ```bash | |
| 19 | + | gluster peer probe sora.giran.cyou | |
| 20 | + | ``` | |
| 21 | + | ||
| 22 | + | ## Создание тома | |
| 23 | + | ||
| 24 | + | ```bash | |
| 25 | + | gluster volume create data replica 3 sora.giran.cyou:/srv/data/brick jarvis.giran.cyou:/srv/data/brick yun.giran.cyou:/srv/data/brick | |
| 26 | + | ``` | |
| 27 | + | ||
| 28 | + | ## Монтирование тома | |
| 29 | + | ||
| 30 | + | ### Интерактивное | |
| 31 | + | ||
| 32 | + | ```bash | |
| 33 | + | mount.glusterfs sora:/data /mnt/data/ -o acl | |
| 34 | + | ``` | |
| 35 | + | ||
| 36 | + | ### Через fstab | |
| 37 | + | ||
| 38 | + | ```bash | |
| 39 | + | sora.giran.cyou:/data /mnt/data glusterfs acl 0 0 | |
| 40 | + | ``` | |
| 41 | + | ||
| 42 | + | ## Запуск glusterd после инициализации сети | |
| 43 | + | ||
| 44 | + | ```bash | |
| 45 | + | systemctl edit glusterd.service | |
| 46 | + | ``` | |
| 47 | + | ||
| 48 | + | ```systemd | |
| 49 | + | [Unit] | |
| 50 | + | After=network-online.target | |
| 51 | + | Before= | |
| 52 | + | ``` | |
| 53 | + | ||
| 54 | + | ## Статус | |
| 55 | + | ||
| 56 | + | ```bash | |
| 57 | + | gluster volume status data | |
| 58 | + | ``` | |
| 59 | + | ||
| 60 | + | ## Показать файлы, которым требуется восстановление | |
| 61 | + | ||
| 62 | + | ```bash | |
| 63 | + | gluster volume heal sysvol info | |
| 64 | + | ``` | |
| 65 | + | ||
| 66 | + | ## Восстановить данные в томе | |
| 67 | + | ||
| 68 | + | ```bash | |
| 69 | + | gluster volume heal | |
| 70 | + | ``` | |
lxc.md(file created)
| @@ -0,0 +1,7 @@ | |||
| 1 | + | # LXC cheat sheet | |
| 2 | + | ||
| 3 | + | ## Autostart network listening service | |
| 4 | + | ||
| 5 | + | ``` | |
| 6 | + | */2 * * * * /usr/bin/host -W 5 ya.ru 192.168.20.53 2>&1 > /dev/null || /usr/bin/systemctl restart bind | |
| 7 | + | ``` | |
nsupdate.md(file created)
| @@ -0,0 +1,27 @@ | |||
| 1 | + | # Update PTR record | |
| 2 | + | ||
| 3 | + | nsupdate -g | |
| 4 | + | ||
| 5 | + | ```bash | |
| 6 | + | server giran.cyou | |
| 7 | + | update delete 10.254.168.192.in-addr.arpa. PTR | |
| 8 | + | update add 10.254.168.192.in-addr.arpa. 300 PTR yun.giran.cyou. | |
| 9 | + | send | |
| 10 | + | quit | |
| 11 | + | ``` | |
| 12 | + | ||
| 13 | + | ```bash | |
| 14 | + | echo -e 'server giran.cyou\n update delete 10.254.168.192.in-addr.arpa. PTR\n update add 10.254.168.192.in-addr.arpa. 300 PTR yun.giran.cyou.\n send\n quit | |
| 15 | + | ' | nsupdate -g | |
| 16 | + | ``` | |
| 17 | + | ||
| 18 | + | ```bash | |
| 19 | + | realm GIRAN.CYOU | |
| 20 | + | update delete 10.254.168.192.in-addr.arpa. in PTR | |
| 21 | + | update add 10.254.168.192.in-addr.arpa. 3600 in PTR yun.giran.cyou. | |
| 22 | + | send | |
| 23 | + | realm GIRAN.CYOU | |
| 24 | + | update delete 7.2.b.0.f.b.e.f.f.f.e.7.d.1.4.a.a.0.0.0.3.0.0.1.0.4.8.e.2.0.a.2.ip6.arpa. in PTR | |
| 25 | + | update add 7.2.b.0.f.b.e.f.f.f.e.7.d.1.4.a.a.0.0.0.3.0.0.1.0.4.8.e.2.0.a.2.ip6.arpa. 3600 in PTR yun.giran.cyou. | |
| 26 | + | send | |
| 27 | + | ``` | |
openssl.md(file created)
| @@ -0,0 +1,7 @@ | |||
| 1 | + | # OpenSSL | |
| 2 | + | ||
| 3 | + | ## show cert info | |
| 4 | + | ||
| 5 | + | ``` | |
| 6 | + | openssl x509 -in cert.pem -noout -text | |
| 7 | + | ``` | |
liannnix revised this gist 1 month ago. Go to revision
1 file changed, 1 insertion
abc(file created)
| @@ -0,0 +1 @@ | |||
| 1 | + | abc | |