Skip to content

Instantly share code, notes, and snippets.

import os
import hashlib
import tarfile
import logging
import boto3
from datetime import datetime
from pathlib import Path
from dotenv import load_dotenv
from botocore.exceptions import ClientError
import random
class Weather:
def __init__(self, current_season = "Spring"):
self.temperature = "0/0"
self.current_season = current_season
self.seasons = ["Spring", "Summer", "Autumn", "Winter"]
self.seasons_temperature = {"Spring": "8,28/-6,10", "Summer": "28/10", "Autumn": "28,1/10,-6", "Winter": "1/-6"}
self.set_season(current_season)
# ofsets type: array
# import pyperclip
# if (input("Copy into clipboard? (y)") == "y"):
# pyperclip.copy(result)
def printOutOfsets(ofsets) -> int:
prefix = "0x"
result = ""
for ofset in reversed(ofsets):
result += prefix+ofset + ","
import wave
file_path = 'file.wav'
# Open the WAV file
with wave.open(file_path, 'rb') as wav_file:
# Get the parameters of the WAV file
n_channels = wav_file.getnchannels()
sample_width = wav_file.getsampwidth()
frame_rate = wav_file.getframerate()
#!/bin/bash
#sudo service network-manager stop
#ifconfig wlan0 down
sudo ip link set dev wlan0 down
sudo macchanger -r wlan0
#revert : sudo macchanger -p wlan0
import requests
from bs4 import BeautifulSoup
def og_scrape(url, container_class, container_tag='div'):
source = requests.get(url).text
soup = BeautifulSoup(source, 'html.parser')
# soup.select("")
if (container_class is None):
containers = soup.find_all(container_tag)
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
def og_scrape(source, container_class, container_tag='div'):
soup = BeautifulSoup(source, 'html.parser')
if (container_class is None):
import tkinter as tk
from tkinter import ttk
from random import choice
import string
class tkinterApp(tk.Tk):
"""Quick Password Analyzer and Generator programmed in tkinter"""
# __init__ function for class Tk
def __init__(self, *args, **kwargs):
tk.Tk.__init__(self, *args, **kwargs)
@BitR13x
BitR13x / NewsScrap.py
Last active January 24, 2023 22:06
Getting latest news from coinmarket and cryptonews then stores it into array of objects to display
import requests
from bs4 import BeautifulSoup
import json
import os
from termcolor import colored
def processArticle(articles, classname, ):
result = []
for article in articles:
headline = article.find('a', class_=classname )
#!/bin/bash
echo "Following packages can be installed[*]:"
echo "STEAM, CHROME, ZSH, GHYDRA, ATOM, PHONEINFOGA \n"
echo "Apps in apt install: [screenfetch, terminator, flameshot, meld, gitg, zaproxy, ltrace, armitage,
gobuster, stegcracker, steghide, hexedit, binwalk, stegoveritas, spotify-dl, youtube-dl] \n"
echo "Apps in snap install: [discord, snap-store, spotify ,vscode] \n"
echo ""