Skip to content

Instantly share code, notes, and snippets.

View mator's full-sized avatar
🏠
Working from home

Anatoly Pugachev mator

🏠
Working from home
  • Russia, Moscow
View GitHub Profile
@mator
mator / urlinfo.pl
Last active August 29, 2015 14:27 — forked from atr000/urlinfo.pl
irssi This script will catch incoming urls, grab their <title> and display.
#!/usr/bin/perl -w
# This script will catch incoming urls, grab their <title> and display. It has
# some rudimentary caching.
# WISHLIST
# * grab and add tags, if provided with original msg
# * equivalence rules - some urls are identical
# (like http://42.pl/u/..._description)
# * configurable output (theme item)
@mator
mator / iscsi.py
Created April 23, 2019 20:23
pr 55643
elif sys.platform.startswith('aix'):
if module is not None:
cmd = module.get_bin_path('lsattr', required=True)
cmd = cmd + " -E -l iscsi0"
rc, out, err = module.run_command(cmd)
if out:
line = self.findstr(out, 'initiator_name')
iscsi_facts['iscsi_iqn'] = line.split()[1].rstrip()
...
def findstr(self, text, str):
@mator
mator / lparcfg
Last active April 14, 2020 07:50
sample output of /proc/ppc64/lparcfg , lscpu
# cat /proc/ppc64/lparcfg
lparcfg 1.9
serial_number=IBM,02214AB1V
system_type=IBM,8284-22A
partition_id=12
BoundThrds=1
CapInc=1
DisWheRotPer=5120000
MinEntCap=100
MinEntCapPerVP=5
[mator@archlinux ~]$ cat bsd-ifconfig-fix.patch
diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py
index e62f31a3b8..97e78f62f0 100644
--- a/lib/ansible/module_utils/facts.py
+++ b/lib/ansible/module_utils/facts.py
@@ -2716,7 +2716,7 @@ class GenericBsdIfconfigNetwork(Network):
self.detect_type_media(interfaces)
self.merge_default_interface(default_ipv4, interfaces, 'ipv4')
self.merge_default_interface(default_ipv6, interfaces, 'ipv6')
- self.facts['interfaces'] = interfaces.keys()
@mator
mator / gist:bbbbe024c075251e4facc0bf386f1a06
Last active July 14, 2020 12:55
hikvision c2000 1TB nvme (512 and 4k) linux fio test
[root@u165 mator]# smartctl -i /dev/nvme0n1
smartctl 7.0 2019-03-31 r4903 [x86_64-linux-5.3.16-300.fc31.x86_64] (local build)
Copyright (C) 2002-18, Bruce Allen, Christian Franke, www.smartmontools.org
=== START OF INFORMATION SECTION ===
Model Number: HS-SSD-C2000
Serial Number: 30007141531
Firmware Version: ECFM22.4
PCI Vendor/Subsystem ID: 0x1987
IEEE OUI Identifier: 0x6479a7
@mator
mator / hpcvillage-super-hashcat-backend-info.txt
Last active September 30, 2020 14:33
backend info by hashcat
# https://openwall.info/wiki/HPC/Village
$ ./hashcat -I
hashcat (v6.1.1) starting...
CUDA Info:
==========
CUDA.Version.: 10.1
@mator
mator / test_parted_version_v2.py
Created October 5, 2020 11:46
unit test (non working) for parted_version
# tests/unit/plugins/modules/system/test_parted_version_v2.py
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.general.tests.unit.compat import mock
from ansible_collections.community.general.tests.unit.compat import unittest
OUT_VERSION1 = "parted (GNU parted) 3.3"
class Test1(unittest.TestCase):
@mator
mator / test_capabilities.py
Last active October 11, 2020 17:20
second (failed) attempt to write a test unit for ansible
$ cat tests/unit/plugins/modules/system/test_capabilities.py
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils import basic
from ansible_collections.community.general.tests.unit.compat.mock import patch
from ansible_collections.community.general.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase
from ansible_collections.community.general.plugins.modules.system import capabilities
@mator
mator / config.log
Created November 11, 2020 18:27
nmap config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ ./configure --without-ncat --without-liblua --without-libssh2 --without-nping --without-zenmap --without-ndiff --without-openssl --enable-debug --no-create --no-recursion
## --------- ##
## Platform. ##
@mator
mator / gist:a44eb39d5103aaaea2f1b2f3856c391d
Created December 14, 2020 15:44
[sparc64] ftrace: kernel logs after enabling CONFIG_FTRACE_STARTUP_TEST
-- Journal begins at Mon 2020-10-12 23:40:31 MSK, ends at Mon 2020-12-14 17:36:21 MSK. --
Dec 14 13:48:15 kernel: PROMLIB: Sun IEEE Boot Prom 'OBP 4.38.17 2019/01/25 08:22'
Dec 14 13:48:15 kernel: PROMLIB: Root node compatible: sun4v
Dec 14 13:48:15 kernel: Linux version 5.10.0 (mator@ttip) (gcc (Debian 10.2.1-1) 10.2.1 20201207, GNU ld (GNU Binutils for Debian) 2.35.1) #155 SMP Mon Dec 14 13:32:10 MSK 2020
Dec 14 13:48:15 kernel: printk: bootconsole [earlyprom0] enabled
Dec 14 13:48:15 kernel: ARCH: SUN4V
Dec 14 13:48:15 kernel: Ethernet address: 00:14:4f:fa:06:f2
Dec 14 13:48:15 kernel: MM: PAGE_OFFSET is 0xfff8000000000000 (max_phys_bits == 47)
Dec 14 13:48:15 kernel: MM: VMALLOC [0x0000000100000000 --> 0x0006000000000000]
Dec 14 13:48:15 kernel: MM: VMEMMAP [0x0006000000000000 --> 0x000c000000000000]