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
| find . -name "*.log" -type f -delete |
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
| from colorist import Color, BrightColor, BgColor, Effect | |
| from sys import stdout, stderr | |
| from datetime import datetime | |
| def success(message): | |
| stdout.write(f"{datetime.now().strftime('%d/%m/%Y, %H:%M:%S')} - {Color.GREEN}[SUCCESS]{Color.OFF}: {message}\n") | |
| def info(message): | |
| stdout.write(f"{datetime.now().strftime('%d/%m/%Y, %H:%M:%S')} - {Color.CYAN}[INFO]{Color.OFF}: {message}\n") |
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
| On server: | |
| sudo wget -O /usr/local/bin/rsub https://raw.github.com/aurora/rmate/master/rmate && sudo chmod +x /usr/local/bin/rsub | |
| Locally: | |
| run: nano ~/.ssh/config | |
| and paste: | |
| Host HostHere |
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
| next((x for x in list if x == y), 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
| #thread.py file: | |
| import threading | |
| class thread(threading.Thread): | |
| def __init__(self, function=None, sleep=1): | |
| super().__init__() | |
| self._kill = threading.Event() | |
| self._function = function | |
| self.interval = sleep |
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
| sudo apt install -y build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev libsqlite3-dev wget libbz2-dev | |
| wget https://www.python.org/ftp/python/3.11.1/Python-3.11.1.tgz | |
| tar -xvf Python-3.11.1.tgz | |
| cd Python-3.11.1 | |
| sudo ./configure --enable-optimizations | |
| sudo make -j 2 | |
| sudo make altinstall | |
| sudo apt install -y python3-pip | |
| cd .. | |
| rm -rf Python-3.11.1 Python-3.11.1.tgz |
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
| systemctl show yourServiceHere.service -p NRestarts | |
| journalctl -u yourServiceHere.service | grep -i start |
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
| nc -zv host port |
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
| alias cronhis='tail -n 999 -f /var/log/syslog | cut -d " " -f 1-4,7,9- | grep -i $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
| import sys | |
| import textwrap | |
| from PyQt5.QtWidgets import * | |
| from PyQt5 import QtWidgets, QtGui, QtCore | |
| from PyQt5.QtWidgets import QTextEdit | |
| from PyQt5.QtGui import * | |
| from PyQt5.QtCore import * | |