Skip to content

Instantly share code, notes, and snippets.

View Descent098's full-sized avatar
🐍
Writing Python

Kieran Wood Descent098

🐍
Writing Python
View GitHub Profile
@Descent098
Descent098 / download.py
Created May 21, 2023 21:15
A script to download multiple videos in parallel
# A script to download many videos in parallel
import subprocess # Used to instantiate yt-dlp processes to download
from typing import List
from multiprocessing import Process # Used to parrallel process download subprocesses
# Confirm dependencies are installed
try:
import yt_dlp # Needed for suprocessing
except ImportError:
print("Youtube DLP not installed, please install with:\n\tpip install yt-dlp\n\t\tor\n\tsudo pip3 install yt-dlp")
@Descent098
Descent098 / maria-db-import.md
Created January 24, 2023 18:32
Creating a MariaDB import docker compose

This file will teach you how to setup a mariaDB docker container, import a .sql dump and visualize it.

Step 1 Docker containers

First create a compose.yml file with the following info:

# Use root/example as user/password credentials
version: '3.1'
@Descent098
Descent098 / utilities.md
Last active October 28, 2022 19:42
This is a collection of developer utilities that are more obscure
@Descent098
Descent098 / Hosting.md
Last active October 19, 2022 23:20
Docker Hosting
@Descent098
Descent098 / Guide to setup pi.md
Last active September 19, 2022 05:53
Guide to setting up raspberry pi's in 2022!

Setting up Pi's

To setup your Pi initially install using the imager, after selecting 64-bit os (lite or normal) go into the settings.

Make sure you:

  • set your hostname to what you want
  • allow SSH
  • set a password & username (I usually just leave the username as default)
  • setup a WLAN (if not using ethernet, and make sure to set your country)
@Descent098
Descent098 / Microsoft.PowerShell_profile.ps1
Last active November 21, 2023 02:30
Setting up windows terminal
# Create new global aliases
New-Alias USERPROFILE $env:userprofile
New-Alias PATH $env:path
New-Alias python3 python
New-Alias which where.exe
# NOTE: starship also adds an implicit: New-Alias ~ $env:userprofile
# Introducing a set of "aliases" (a hashmap) that will be auto-expanded to expected paths
$Custom_Alias = @{
@Descent098
Descent098 / setup-electron.py
Created July 16, 2022 23:46
A Script to setup electron apps using the quick start guide https://www.electronjs.org/docs/latest/tutorial/quick-start
"""A script that automates the process found on https://www.electronjs.org/docs/latest/tutorial/quick-start
Interactive Usage:
python setup-electron.py
To pre-specify an app name use:
python setup-electron.py <app_name>
To run fully headlessly (without forge use):
python setup-electron.py <app_name> --headless
@Descent098
Descent098 / Operating sytstems.md
Last active September 8, 2023 19:12
A "course" on operating system fundamentals

Operating Systems

This document outlines many of the key aspects of operating systems, and provides resources to learn more about each part. There are a lot of things missing (i'm on human), but these are enough to get you up and running. The intention is to be able to understand how you go from electricity entering your PC to being at a login screen you can see.

Most of this is relevent to linux primarily because it's open source, so there's much more information available about it, but these principles are the same across systems they just may have different names for things.

Prerequisties

  • You know how to use a terminal
@Descent098
Descent098 / expressions.md
Created May 5, 2022 18:13
Useful regex expressions

Quoting

Terms inside single quotes: (?s)'(\\\\|\\[0-7]+|\\.|[^'\\])*' Terms inside double quotes: (?s)"(\\\\|\\[0-7]+|\\.|[^"\\])*"

Operators

Finds (not content seperated by them though) * / + - / < > <= >= % = /=: (\*\*|\*|\+|-|\/|<|>|<=|>=|==|\/=|=|%)

Finds True or False (and uncapitalized): (true|false|True|False)