Skip to content

Instantly share code, notes, and snippets.

View Kvanrooyen's full-sized avatar
💻
Coding

Keagan Van Rooyen Kvanrooyen

💻
Coding
View GitHub Profile
@Kvanrooyen
Kvanrooyen / docker-ubuntu.sh
Last active May 24, 2022 00:03
Install Docker on an Ubuntu machine
#!/bin/bash
# Install Docker on Ubuntu #
#--------------------------#
# Update packages
sudo apt update
# Install prerequistes
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
@Kvanrooyen
Kvanrooyen / profiles.json
Last active June 18, 2020 14:49
Windows Terminal Profile
// This file was initially generated by Windows Terminal (Preview) 1.0.1402.0
// It should still be usable in newer versions, but newer versions might have additional
// settings, help text, or changes that you will not see unless you clear this file
// and let us generate a new one for you.
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
@Kvanrooyen
Kvanrooyen / multi-proc.py
Created May 22, 2019 20:40
Multi processing in Python
# Testing of how multi processing works
# https://www.youtube.com/watch?v=ecKWiaHCEKs
"""
Multiprocessing:
- A new process is started independent from the first process
- Starting a process is slower than starting a thread
- Memory is not shared between processes
- Mutexes not necessary (unless threading in the new process)
- One GIL (Global Interpreter Lock) for each process
"""
@Kvanrooyen
Kvanrooyen / threading.py
Created May 22, 2019 20:40
Threading in Python
# Testing of how threading works
# https://www.youtube.com/watch?v=ecKWiaHCEKs
"""
Threading:
- A new thread is spawned within the existing process
- Starting a thread is faster than starting a process
- Memory is shared between all threads
- Mutexes often necessary to control access to shared data
- One GIL (Global Interpreter Lock) for all threads
"""