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 datetime | |
import smtplib | |
import ssl | |
from email.headerregistry import Address | |
from email.message import EmailMessage | |
import dbus | |
import pytz | |
from dbus.mainloop.glib import DBusGMainLoop | |
from gi.repository import GLib | |
from jinja2 import Template |
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 subprocess | |
import time | |
dnd_time = {'start': {'hour': 17, 'minute': 00}, 'end': {'hour': 8, 'minute': 00}} | |
sleep_time = 30 | |
def get_dnd_status(): | |
enabled = None | |
status = subprocess.check_output(['gsettings', 'get', 'org.gnome.desktop.notifications', 'show-banners']).strip().decode() |
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 random | |
import sys | |
BLACKJACK = 21 | |
ACE_IS_ELEVEN = 10 | |
ACE_IS_ONE = 11 | |
EXITS = ['e', 'x', 'q', 'exit', 'quit', 'escape', 'leave'] | |
cards = {'🂾': 10, '🂽': 10, '🂻': 10, '🂺': 10, '🂹': 9, '🂸': 8, '🂷': 7, | |
'🂶': 6, '🂵': 5, '🂴': 4, '🂳': 3, '🂲': 2, '🂱': 'A', '🃎': 10, |
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 email | |
import collections | |
import imaplib | |
mail = imaplib.IMAP4_SSL('imap.gmail.com') | |
mail.login('[email protected]', 'PASSWORD') | |
mail.list() | |
mail.select('inbox') | |
from_dict = collections.Counter() |
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 collections | |
import pyautogui | |
import pyscreeze | |
import sys | |
def MousePosition(): | |
"""This function is meant to be run from the command line. It will | |
automatically display the location and RGB of the mouse cursor.""" | |
print('Press Ctrl-C to quit.') | |
try: |
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 collections | |
import pyautogui | |
import pyscreeze | |
import sys | |
def MousePosition(): | |
"""This function is meant to be run from the command line. It will | |
automatically display the location and RGB of the mouse cursor.""" | |
print('Press Ctrl-C to quit.') | |
try: |
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 subprocess | |
import time | |
while True: | |
time.sleep(1) | |
a = subprocess.check_output('xprintidle') | |
a = round(int(a.decode().strip()), -3) | |
print('Seconds idle: {0}'.format(int(a / 1000))) |
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 python3 | |
import os | |
ethernet_interfaces = [] | |
wireless_interfaces = [] | |
def get_interfaces(): | |
interfaces = os.listdir('/sys/class/net') | |
return interfaces |
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 python3 | |
# While systemd has the prefixes set in the following way: | |
# en = ethernet | |
# wl = wlan | |
# ww = wwan | |
# There are still instances where an interface won't have these. | |
# Which, is why I made this script. | |
import os | |
ethernet_interfaces = [] |
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 string | |
def encrypt(the_input): | |
start = 1 | |
encrypted = [] | |
one_e = str.maketrans( | |
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?!. '", | |
"74IKSQ'VR5LDBZ6J.N1GW?ETO8P UA023F9!MXHYC") |
NewerOlder