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
| crontab -e | |
| 0 0 * * * truncate -s 0 /var/lib/docker/containers/*/*-json.log |
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
| is_arm64(){ | |
| [[ `uname -m` == 'arm64' ]] | |
| } | |
| if is_arm64; then | |
| echo -e "sudo docker-compose --env-file ./docker/clickhouse-setup/env/arm64.env -f docker/clickhouse-setup/docker-compose.yaml ps -a" | |
| else | |
| echo -e "sudo docker-compose --env-file ./docker/clickhouse-setup/env/x86_64.env -f docker/clickhouse-setup/docker-compose.yaml ps -a" | |
| fi |
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
| filenames = glob('/path/filename*.csv') | |
| dataframes = [pd.read_csv(f) for f in filenames] |
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
| docker run -d --name <container_name> <image> tail -f /dev/null | |
| OR | |
| ENTRYPOINT ["tail", "-f", "/dev/null"] |
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 re | |
| from datetime import datetime, timedelta | |
| import slate3k as slate | |
| from tika import parser | |
| PDF_PATH: str = os.path.join(os.getcwd(), "source_folder_name") | |
| TEXT_PATH: str = os.path.join(os.getcwd(), "converted") |
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
| nmap -Pn -sV --script vulners.nse <ip or host> -oX scan.xml && xsltproc scan.xml -o "`date +%m%d%y`_report.html" |
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
| pip freeze — local | grep -v ‘^\-e’ | cut -d = -f 1 | xargs -n1 pip install -U | |
| or | |
| pip install -U $(pip freeze | cut -d '=' -f 1) | |
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
| def configParse(self, configPath=None): | |
| """ | |
| Parses the config file from the given location. | |
| :param path: path to the config file | |
| """ | |
| logger = LogManager.logEvent(__name__) | |
| workdir = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) | |
| if configPath == None: |
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 | |
| def readFile(filename): | |
| filehandle = open(filename) | |
| print filehandle.read() | |
| filehandle.close() | |
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 json | |
| def read_file(name: str): | |
| with open(str(name), 'r') as file: | |
| stream = file.read() | |
| file.close() | |
| return stream | |
| def count(file) -> int: | |
| object = read_file(file) |
NewerOlder