Instance | Branch |
---|
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 logging | |
logging.basicConfig( | |
level=logging.DEBUG, | |
format="%(asctime)s %(name)-12s %(levelname)-8s %(message)s", | |
handlers=[logging.FileHandler("archive_results.log"), logging.StreamHandler()], | |
) | |
def main(): | |
pass |
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
""" | |
git.py | |
Git CLI interaction layer | |
author: Ryan Long <[email protected]> | |
""" | |
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
""" | |
gateway.py | |
Database interaction layer | |
author: Ryan Long <[email protected]> | |
""" | |
import pathlib | |
import sqlite3 |
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 logging | |
def handle_logging(args): | |
levels = { | |
"critical": logging.CRITICAL, | |
"error": logging.ERROR, | |
"warn": logging.WARNING, | |
"warning": logging.WARNING, | |
"info": logging.INFO, | |
"debug": logging.DEBUG, |
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 | |
""" | |
Module to remove empty folders recursively. Can be used as standalone script or be imported into existing script. | |
""" | |
import os | |
import argparse | |
import pathlib | |
import asyncio | |
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
# log current function name and local vars | |
logger.debug("fx=%s: vars=%s", inspect.stack()[0][3], locals()) |
By: @saurabhshri
Many users when are given server access, do not have root (or sudo) privileges and can not simply do
sudo apt-get install python-pip
.
Here's an easy way you can install and use pip without root (or sudo) access in a local directory.
Note : This works without easy_install
too.
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 ctypes | |
from ctypes import wintypes | |
import time | |
user32 = ctypes.WinDLL('user32', use_last_error=True) | |
INPUT_MOUSE = 0 | |
INPUT_KEYBOARD = 1 | |
INPUT_HARDWARE = 2 |
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
// This file was initially generated by Windows Terminal 1.3.2651.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"defaultProfile": "Bash", | |
// You can add more global application settings here. |