Only needs two external libraries
https://github.com/saghul/aiodns
https://github.com/secynic/ipwhois
This file contains 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
# Save to ~/.xonshrc | |
# https://github.com/anki-code/xontrib-prompt-starship | |
# Below is example to put in xonsh config ~/.xonshrc for xontrib-prompt-starship | |
#$STARSHIP_CONFIG = "~/.config/starship_xonsh.toml" | |
$XONTRIB_PROMPT_STARSHIP_LEFT_CONFIG = "~/.config/starship_xonsh_left.toml" | |
#$XONTRIB_PROMPT_STARSHIP_RIGHT_CONFIG = "~/.config/starship_xonsh_right.toml" | |
#$XONTRIB_PROMPT_STARSHIP_BOTTOM_CONFIG = "~/.config/starship_xonsh_bottom.toml" | |
xontrib load prompt_starship |
This file contains 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 asyncio | |
import aiodns | |
import aiofiles | |
import aiohttp | |
from colorama import Fore | |
from dataclasses import field, dataclass | |
from pycares import ares_query_cname_result | |
from concurrent.futures import ThreadPoolExecutor | |
import sys | |
import re |
This file contains 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
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands) | |
gpg --gen-key | |
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null` | |
# check current keys: | |
gpg --list-secret-keys --keyid-format LONG | |
# See your gpg public key: | |
gpg --armor --export YOUR_KEY_ID | |
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333) |
This file contains 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 | |
# Quick script to disable an internal webcam if an external one is attached, or | |
# enable the internal one if the external one's not attached. | |
# by Shimon Rura, 25 Jan 2018. In the public domain. | |
# To use, run `lsusb` and identify the lines for your internal and external camera devices. | |
# For example, mine are: | |
# internal: |
This file contains 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
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->exclude('libs') | |
->exclude('utils') | |
->name('*.phtml') | |
->in(__DIR__) | |
//->append([ | |
//__DIR__.'/dev-tools/doc.php', | |
// __DIR__.'/php-cs-fixer', disabled, as we want to be able to run bootstrap file even on lower PHP version, to show nice message |
Download the file then move it and make executable and restart nautilus to see the Copy Path icon
wget https://gist.githubusercontent.com/meramsey/f1d20da371de82e801df19c92a673e63/raw/2bb9cb9007f21e85b00aade70d5db21c41b44f44/nautilus-copy-paths.py
sudo mv nautilus-copy-paths.py /usr/share/nautilus-python/extensions/nautilus-copy-paths.py
sudo chmod +x /usr/share/nautilus-python/extensions/nautilus-copy-paths.py
nautilus -q
This file contains 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 python2 | |
"""A very simple Apache access log parser in Python | |
usage help = http://i.imgur.com/XBiX2kX.png | |
when required arguments are missing = http://i.imgur.com/P5L0GZV.png | |
when incorrect file path is passed = http://i.imgur.com/sJDc0om.png | |
successful sample output = http://i.imgur.com/iH89mwI.png |
This file contains 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/python3 | |
import sys | |
import time | |
from datetime import date, timedelta | |
from datetime import datetime | |
import os | |
import re | |
import urllib.request | |
import requests | |
import json |
based on https://wiki.archlinux.org/index.php/Systemd/Timers#MAILTO
- Move
systemd-email.sh
to/usr/local/bin/systemd-email
- Move
status-email-alerts@.service
to/etc/systemd/system/
- Put
OnFailure=OnFailure=status-email-alerts@%n.service
into the[Unit]
section of a service
Create file /usr/local/bin/systemd-email
OlderNewer