Skip to content

Instantly share code, notes, and snippets.

View Lvl4Sword's full-sized avatar
๐Ÿ’š
Whatever you do, do it well.

Scott King Lvl4Sword

๐Ÿ’š
Whatever you do, do it well.
View GitHub Profile
#!/usr/bin/env python3
import json
import requests
import sys
band = None
user = None
counter = 0
input_stripped = input('Input a band (or hit enter for user): ').strip()
@Lvl4Sword
Lvl4Sword / ZodiacPOC.py
Last active December 11, 2020 22:37
Basic concept as to how I believe the 340 Zodiac Cipher would have been done. It could also just be random characters. It's been solved! - https://www.youtube.com/watch?v=-1oQLPRE21o
import string
def encrypt(the_input):
start = 1
encrypted = []
one_e = str.maketrans(
"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789?!. '",
"74IKSQ'VR5LDBZ6J.N1GW?ETO8P UA023F9!MXHYC")
#!/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 = []
@Lvl4Sword
Lvl4Sword / detection.py
Last active October 4, 2018 23:12
Detect Ethernet, Wireless, Battery, and Main Power Supply, within Linux.
#!/usr/bin/env python3
import os
ethernet_interfaces = []
wireless_interfaces = []
def get_interfaces():
interfaces = os.listdir('/sys/class/net')
return interfaces
@Lvl4Sword
Lvl4Sword / idle_time.py
Created October 13, 2018 00:12
Detect idle time, because why not
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)))
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:
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:
@Lvl4Sword
Lvl4Sword / gmail_from_and_returnpath_headers.py
Last active March 20, 2020 17:28
gmail_from_and_returnpath_headers.py
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()
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,
@Lvl4Sword
Lvl4Sword / do_not_disturb.py
Last active August 27, 2021 07:29
Programmatically enable DND mode on Ubuntu 20.04 LTS between 5PM - 8AM
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()