This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sys | |
| import base64 | |
| import crypt | |
| def hash_passwd(passwd): | |
| # SHA-512 | |
| return crypt.crypt(passwd, "$6$" + base64.b64encode(os.urandom(16))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import re | |
| import logging | |
| # imported from parent directory | |
| import utils | |
| LOG = logging.getLogger(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import time | |
| def to_unit_auto(size): | |
| unit = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'] | |
| uindex = 0 # unit_index |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # disable dns service | |
| port=0 | |
| # proxy mode | |
| dhcp-range=192.168.31.254,proxy | |
| enable-tftp | |
| tftp-root=/tftpboot | |
| dhcp-boot=pxelinux.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <time.h> | |
| #include <sys/time.h> | |
| #include <stdio.h> | |
| #include <unistd.h> | |
| int get_cpu_usage() | |
| { | |
| unsigned int stat1[8], stat2[8]; | |
| char buf[256]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set ignorecase | |
| set smartcase | |
| set scrolloff=3 " 3 lines above/below cursor when scrolling | |
| " Emulated Plugins | |
| set surround | |
| " Copy to system clipboard as well | |
| set clipboard+=unnamed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import paramiko | |
| class SSHClient(paramiko.SSHClient): | |
| def run_cmd( | |
| self, | |
| command, | |
| bufsize=-1, | |
| timeout=None, | |
| get_pty=False, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # to enable this filter add to jail.conf following (/etc/fail2ban/jail.conf) | |
| # Thanks to -> TheBarret | |
| [nginx-4xx] | |
| enabled = true | |
| port = http,https | |
| logpath = /var/log/nginx/access.log | |
| maxretry = 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Wpeinit | |
| ipconfig /all | |
| netsh interface show interface | |
| net use z: \\10.211.55.19\public | |
| z: | |
| .\setup.exe |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> | |
| <name>win10</name> | |
| <uuid>a03f5f0b-d4e0-49e9-975c-62970b296719</uuid> | |
| <metadata> | |
| <libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> | |
| <libosinfo:os id="http://microsoft.com/win/10"/> | |
| </libosinfo:libosinfo> | |
| </metadata> | |
| <memory unit='KiB'>4194304</memory> | |
| <currentMemory unit='KiB'>4194304</currentMemory> |