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 / gist:112d2bdde984a9824a7e0ed236dd6ab8
Last active June 15, 2021 13:40
Centos 7 / Amazon Linux sshguard install (without repo)
Probably the easiest way to install latest version of sshguard (at the time of writting, sshguard 2.4.0)
on Amazon Linux (v2) or Centos 7, is to use fedora src.rpm package. Since there's no available repos,
probably except of http://download.opensuse.org/repositories/home:/blarson:/sshguard/ which is outdated anyway.
Fedora packages are available at [Fedora package sources](https://src.fedoraproject.org/rpms/sshguard)
So using 'Fedora EPEL 7' package.
You could use binary package there, or follow steps below to compile it locally on your machine.
@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 / 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 / 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. ##