Skip to content

Instantly share code, notes, and snippets.

View ronknight's full-sized avatar

ronknight ronknight

View GitHub Profile
@ronknight
ronknight / execute-download.py
Created May 20, 2024 22:08
Download bulk images, PDFs, mp3s, etc. from multiple URLs on a txt file, using Python 3
import requests
import urllib
def download_url(file_url):
print("downloading: ",file_url)
# find "/" then assume that all the rest of the charaters after that represents the filename
# if url is www.test.com/abc/xyz/filename.jpg, the file name will be filename.jpg
file_name_start_pos = file_url.rfind("/") + 1
file_name = file_url[file_name_start_pos:]
@ronknight
ronknight / get_wifi_password.py
Created May 20, 2024 21:58
get saved wifi password
import subprocess
import re
def get_wifi_passwords():
try:
# Run the command to get saved WiFi profiles
result = subprocess.run(["netsh", "wlan", "show", "profiles"], capture_output=True, text=True, check=True)
# Extract profile names
@ronknight
ronknight / .env
Last active May 20, 2024 22:17
download unsubcribe.log using ftp
USERNAME: username
PASSWORD: password
SERVER:server_address
REMOTE_FILE: The_path_to_the_remote_file_on_the_FTP_server
LOCAL_PATH: The_local_directory_where_the_downloaded_file_should_be_stored
@ronknight
ronknight / unzip.js
Created May 17, 2019 18:10
unzip multiple .gz files using nodejs zlib
var zlib = require('zlib');
var fs = require('fs');
function decompress(inFilename, outFilename) {
var unzip = zlib.createUnzip();
var input = fs.createReadStream(inFilename);
var output = fs.createWriteStream(outFilename);
input.pipe(unzip).pipe(output);
}