Skip to content

Instantly share code, notes, and snippets.

How to Install Python 3.8 on Ubuntu and Debian

Tested on Debian 10 Buster

Prerequisites

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install wget  # For downloading file
$ sudo apt-get install xz-utils  # For extracting .tar.xz files

NSLOC stands for 'Normalized Source Code', which is a custom measurement we use (among others) when evaluating the complexity of a codebase.

To get the NSLOC count of a file:

  1. For all functions, reduce any multiline function declarations to a single line.
  2. Remove all comments
  3. Remove all empty lines
  4. Count the remaining lines

Example:

@westphahl
westphahl / optimal_tsp.py
Created June 10, 2010 11:46
TSP brute-force solution
"""
Author: Simon Westphahl <westphahl@gmail.com>
Description: Brute-force implementation for solving the TSP.
http://en.wikipedia.org/wiki/Travelling_salesman_problem
"""
routes = []
def find_paths(node, cities, path, distance):
@akella
akella / setup.md
Last active May 1, 2024 05:33
My Setup
@HarmfulBreeze
HarmfulBreeze / hyperv-esm-fedora.md
Last active May 1, 2024 05:27
Setting up Hyper-V Enhanced Session Mode with Fedora 39

(Lines prefixed with a # should be run as the root user or with sudo. Lines prefixed with a $ should be run as your local user.)

  1. # dnf install xrdp (with Xorg session support: # dnf install xrdp xorgxrdp)
  2. If using Gnome: # $EDITOR /etc/pam.d/xrdp-sesman and comment and uncomment the appropriate lines.
  3. Optionally, rename the shared drives mount: # $EDITOR /etc/xrdp/sesman.ini and set FuseMountName=shared-drives
  4. # $EDITOR /etc/xrdp/xrdp.ini and set port=vsock://-1:3389 ([Globals] section), security_layer=rdp, bitmap_compression=false. Uncomment the whole [Xorg] section if you chose to install the xorgxrdp package.
  5. $ systemctl enable xrdp xrdp-sesman
  6. Shut down the virtual machine (do NOT reboot) and close the Virtual Machine Connection window.
  7. On your host, in PowerShell (as admin or as a user in the "Hyper-V Administrators" group): Set-VM -VMName "Name of your Fedora VM" -EnhancedSessionTransportType HvSocket
  8. Connect to your VM by reopening the Virtual
@MartinEesmaa
MartinEesmaa / youtube_formats.md
Last active May 1, 2024 05:27 — forked from AgentOak/youtube_formats.md
Youtube Format IDs

Note: This is all almost full YouTube ID informations. Original owner goes to AgentOak, modified version by Martin Eesmaa.

See the credits and also special thanks in below.

Last updated: April 2024

Also known as itag or format codes and way back they could be specified with the fmt parameter (e.g. &fmt=22). Depending on the age and/or popularity of the video, not all formats will be available.

DASH video

#!/usr/bin/env bash
# Abort sign off on any error
set -e
# Start the benchmark timer
SECONDS=0
# Repository introspection
OWNER=$(gh repo view --json owner --jq .owner.login)
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active May 1, 2024 05:25
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@dkosmari
dkosmari / fetch-wiiu-crash-logs.sh
Created May 1, 2024 05:21
A shell script to fetch Wii U crash logs through FTPiiU plugin. Requires wget and sed.
#!/bin/sh -e
# This scripts copies crash logs from a Wii U running Aroma with FTPiiU plugin.
WIIU_ADDRESS=${1:-wiiu}
TEMP_PATH=$(mktemp -d)
if [[ -z "$TEMP_PATH" ]]
then
@MateusRodCosta
MateusRodCosta / Improved Microphone (Male voices, with Noise Reduction).json
Last active May 1, 2024 05:21
An EasyEffects preset created for input devices (intended for Microphones). Please read the README.md.
{
"input": {
"blocklist": [],
"compressor": {
"attack": 20.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"hpf-frequency": 10.0,
"hpf-mode": "off",
"input-gain": 0.0,