Skip to content

Instantly share code, notes, and snippets.

fn input(msg: &str) -> String {
print!("{}", msg);
let mut input = String::new();
io::stdout().flush().unwrap();
io::stdin().read_line(&mut input).unwrap();
input.trim().to_string()
}
#!/bin/bash
echo "Usage: ./videoget <url>"
echo "Press 'CTRL-C' to stop."
endmsg1="If the video ends in .ts, upload to youtube to get it to work."
endmsg2="If the video ends in .mp4, end the stream before it stops."
url=$1
echo $endmsg1
echo $endmsg2
#!/bin/bash
echo "Usage: ./videoget <url>"
echo "Press 'CTRL-C' to stop."
endmsg1="If the video ends in .ts, upload to youtube to get it to work."
endmsg2="If the video ends in .mp4, end the stream before it stops."
url=$1
echo $endmsg1
echo $endmsg2
@kaubu
kaubu / videoget.bat
Created May 20, 2021 03:02
Videoget for windows
@echo off
echo "Usage: videoget.bat <url> <name>"
echo "Press 'CTRL-C' to stop."
set url=%1
set name=%2
youtube-dl --no-part --hls-use-mpegts --abort-on-unavailable-fragment -f best "%url%" -o "%name%.ts"
@kaubu
kaubu / add_languages.ps1
Created July 31, 2021 03:38
Adds languages to a computer that doesn't have access to administrator or settings
$LanguageList = Get-WinUserLanguageList # Gets language list
# $LanguageList # Prints current info
# Tutorial: https://4sysops.com/archives/adding-and-removing-keyboard-languages-with-powershell/
# Language codes: https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/available-language-packs-for-windows
$LanguageList.Add("el-GR") # Greek
$LanguageList.Add("ja-JP") # Japanese
Set-WinUserLanguageList $LanguageList # Sets language list
@kaubu
kaubu / yay-install.sh
Created September 4, 2021 01:05
Install yay on Arch
#!/bin/bash
# Install yay on Arch
echo "Current username: "
read username
sudo pacman -S base-devel git
cd /opt
sudo git clone https://aur.archlinux.org/yay.git
sudo chown -R $username:users ./yay

List of languages

Ancient languages

Tier 1

Egyptian
Sumerian
Canaanite
Akkadian
Eblaite
Elamite

Tier 2

use std::env;
fn main() {
let argsv: Vec<String> = env::args().collect();
match argsv.len() {
0 | 1 => {},
2 | _ => {
let arg = argsv[1].as_str();
@kaubu
kaubu / videoget
Created August 28, 2022 08:03
Download videos using yt-dlp
#!/bin/bash
echo "Usage: ./videoget <url>"
echo "Press 'CTRL-C' to stop."
url=$1
yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/best[ext=mp4]/best" "$1"
@kaubu
kaubu / double_number_calc.py
Last active September 10, 2022 07:14
Calculate a number that is doubled over and over
base = float(input("What is the base number? "))
double = int(input("How many times do you wish to double it? "))
for i in range(1, double+1):
doubled_base = base * 2
if doubled_base.is_integer():
print(f"\n{doubled_base:.0f}\n\t\t(^ Number {i})")
else:
print(f"\n{doubled_base:.1f}\n\t\t(^ Number {i})")
base = doubled_base