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 python3 | |
| from argparse import ArgumentParser | |
| from subprocess import Popen, PIPE, STDOUT | |
| import shlex | |
| import hashlib | |
| import time | |
| import warnings | |
| import os, sys, io | |
| import signal |
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 python3 | |
| from argparse import ArgumentParser | |
| from subprocess import Popen, PIPE, STDOUT | |
| import shlex | |
| import hashlib | |
| import time | |
| import warnings | |
| import os, sys, io | |
| import signal |
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
| #!/bin/bash | |
| BACKUP_DIR=/backup/openldap | |
| ROTATE=7 | |
| if [ ! -d $BACKUP_DIR ]; then | |
| mkdir -p $BACKUP_DIR | |
| fi | |
| day=$(date '+%Y%m%d') |
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
| #!/bin/bash | |
| aptitude -y install expect | |
| // Not required in actual script | |
| MYSQL_ROOT_PASSWORD=abcd1234 | |
| SECURE_MYSQL=$(expect -c " | |
| set timeout 10 |
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
| -- for 5.6 | |
| -- UPDATE mysql.user SET Password=PASSWORD('your_password') WHERE User='root'; | |
| -- for generic | |
| -- ALTER USER 'root'@'localhost' IDENTIFIED BY 'your_password'; | |
| -- for 5.7 | |
| -- UPDATE user SET authentication_string=PASSWORD('your_password') WHERE User='root'; | |
| -- for 8.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
| #!/usr/bin/env python3 | |
| import os,sys,pwd | |
| if len(sys.argv) < 2: | |
| sys.exit("Usage: {0} USER".format(os.path.basename(__file__))) | |
| account = sys.argv[1] | |
| try: | |
| pw = pwd.getpwnam(account) |
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
| class MethodMissing(object): | |
| def __getattr__(self, name): | |
| try: | |
| return self.__getattribute__(name) | |
| except AttributeError: | |
| def method(*args, **kw): | |
| return self.method_missing(name, *args, **kw) | |
| return method | |
| def method_missing(self, name, *args, **kw): |
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 | |
| # vim:fileencoding=utf-8 | |
| """ [NAME] script or package easy description | |
| [DESCRIPTION] script or package description | |
| """ | |
| from argparse import ArgumentParser | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| import logging |
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 python3 | |
| # vim:fileencoding=utf-8 | |
| """ [NAME] script or package easy description | |
| [DESCRIPTION] script or package description | |
| """ | |
| from datetime import datetime | |
| from argparse import ArgumentParser, FileType | |
| import pprint |
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 python3 | |
| # vim:fileencoding=utf-8 | |
| from datetime import datetime | |
| from argparse import ArgumentParser, FileType | |
| from concurrent.futures import ThreadPoolExecutor, as_completed | |
| from subprocess import Popen, PIPE | |
| import threading | |
| import re | |
| import shlex | |
| import time |