Skip to content

Instantly share code, notes, and snippets.

View jirib's full-sized avatar

jirib jirib

View GitHub Profile
+/- Job: "show_id_job"
+/- Task Group: "show_id_group"
+/- Task: "show_id"
+/- Config {
+/- args[0]: "--login" => "jiri"
+/- args[1]: "jiri" => "-c"
args[2]: "/usr/bin/id"
command: "/usr/bin/su"}
@jirib
jirib / test
Last active February 26, 2021 22:48
cloud-init playground
#cloud-config
cloud_init_modules:
- migrator
- bootcmd
- [write-files, always]
- growpart
- resizefs
- disk_setup
- mounts
- set_hostname
@jirib
jirib / gist:54e702ae4e19e6fa17591f030a756e54
Created February 11, 2021 17:02
renaming a vg which has same name as other vg present on the system
# vgs -o +vg_uuid,pv_uuid
VG #PV #LV #SN Attr VSize VFree VG UUID PV UUID
vg 1 5 0 wz--n- <200.00g <42.00g d8XDct-uTAi-UGk0-r3NQ-6fCc-chtY-V4lewj j0nyyb-DAwr-Jt5u-6o5F-LMS9-3QN9-bREnpC
vg 1 5 0 wz--n- <119.24g 1.73g ivcAj8-Jcas-LmCg-2Ntk-0nTM-xLyR-pIogEx dIS1on-2lW1-5WOI-6SL7-NysN-KEPA-ILZN2L
# pvs -o +pv_uuid
PV VG Fmt Attr PSize PFree PV UUID
/dev/mapper/t500_crypt vg lvm2 a-- <200.00g <42.00g j0nyyb-DAwr-Jt5u-6o5F-LMS9-3QN9-bREnpC
/dev/mapper/vg_crypt vg lvm2 a-- <119.24g 1.73g dIS1on-2lW1-5WOI-6SL7-NysN-KEPA-ILZN2L
@jirib
jirib / gist:eacfe5f5d0b7e56ea8e673305d20ef09
Last active February 8, 2021 14:08
LCD setup and laptop kbd setup - disable keyboard if your cat likes to walk or sleep closed to your laptop :D
$ cat ~/bin/lcd_{reset,home}
#!/bin/bash
set -x
set -o pipefail
set -e
EXT_DISPLAY=DP1
INT_DISPLAY=LVDS1
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 TLS: Initial packet from [AF_INET]1.2.3.4:39233, sid=801aa60b cc475c1d
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 CRL: loaded 1 CRLs from file crl.pem
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 VERIFY WARNING: depth=0, unable to get certificate CRL: O=EXAMPLE.COM, CN=user1
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 VERIFY OK: depth=2, O=EXAMPLE.COM, CN=Certificate Authority
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 VERIFY OK: depth=1, O=EXAMPLE.COM, CN=EXAMPLE VPN CA
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 VERIFY KU OK
Jun 19 18:40:33 vpn-oss-gateway0.example.com openvpn[29382]: Fri Jun 19 18:40:33 2020 1.2.3.4:39233 Validating
@jirib
jirib / gist:daa646de6a27f8f2f4199ab39e5b4dd3
Last active April 14, 2020 20:44
alpine linux mdev cups
# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[88431.251041] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0/usbmisc/lp0 (usbmisc)
KERNEL[88431.251089] remove /usbmisc (class)
KERNEL[88431.251127] unbind /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0 (usb)
KERNEL[88431.251161] remove /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1/2-1.1:1.0 (usb)
KERNEL[88431.251204] unbind /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.1 (usb)
[root@ipa2 ~]# ipa-replica-manage list
ipa-server1.example.com: master
ipa-server0.example.com: master
ipa1.example.com: master
ipa2.example.com: master
ipa-server1.node.prod.example.com: master
[root@ipa2 ~]# ipa-replica-manage -v -f -c del ipa-server1.node.prod.example.com
Not allowed on non-leaf entry
@jirib
jirib / yadm_gtar.diff
Last active February 5, 2020 16:08
yadm_gtar_diff
diff --git a/test/test_encryption.py b/test/test_encryption.py
index ec3b330..e3f1d81 100644
--- a/test/test_encryption.py
+++ b/test/test_encryption.py
@@ -146,7 +146,7 @@ def decrypt_targets(tmpdir_factory, runner, gnupg):
env = os.environ.copy()
env['GNUPGHOME'] = gnupg.home
run = runner(
- ['tar', 'cvf', '-'] +
+ ['gtar', 'cvf', '-'] +
$ ansible-inventory -i env/prod/ --list >/dev/null
[WARNING]: * Failed to parse /home/jiri/src/threatmark/infra-ansible/env/prod/aws_ec2.yml with auto plugin: The ec2 dynamic inventory plugin requires boto3 and botocore.
[WARNING]: * Failed to parse /home/jiri/src/threatmark/infra-ansible/env/prod/aws_ec2.yml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse /home/jiri/src/threatmark/infra-ansible/env/prod/aws_ec2.yml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed, this character is reserved to
provide a port.
[WARNING]: Unable to parse /home/jiri/src/threatmark/infra-ansible/env/prod/aws_ec2.yml as an inventory source
$ xbps-query -l | grep boto
ii python-boto-2.49.0_2 Python interface to Amazon Web Services (Python2)
ii python-botocore-1.13.45_1 Core functionality library of boto 3 (Python2)
nainstalovat extensions:
- markdown all in one
- markdownlint
- markdownpreview
- restructuredtext
- rest preview
- czech - code spell checker
- latex workshop
- json