This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#This script will compile and install a static ffmpeg build with support for nvenc un ubuntu. | |
#See the prefix path and compile options if edits are needed to suit your needs. | |
# ripped from https://gist.github.com/Brainiarc7/3f7695ac2a0905b05c5b | |
# updated to my personal needs | |
# tested on Ubuntu 22 | |
# refer here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# USE AT YOUR OWN RISK | |
# THIS IS FOR EXPERTS ONLY - KNOW WHAT YOU ARE DOING. | |
#Step 1: | |
Make sure old system and new system are running same OS | |
On both systems: | |
apt update | |
apt upgrade | |
#Step 2: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HOW TO Copy EC2 instance to Amazon Lightsail | |
WARNING - this is a guide to remind myself how to do it!!!! | |
WARNING - I'M NOT RESPONSIBLE FOR ANYTHING YOU DO WITH THIS! | |
WARNING - DON'T ASK ME ANY QUESTIONS ABOUT IT. | |
WARNING - THIS IS NOT A TUTORIAL - I'm typing this from memory. | |
These steps are a good approximation of what is needed but you'll | |
need strong tech skills to do this. Don't do it unless you know what you are doing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# compression level 9, use all cores | |
XZ_OPT='-T$(nproc) -9' | |
# J means xz compression, z means gz | |
NUM_THREADS=$(nproc) | |
sudo env "XZ_OPT=-T${NUM_THREADS} -7" tar -cvpJf /tmp/backup.tar.xz \ | |
--exclude=/tmp/backup.tar.xz \ | |
--exclude=/var/swap.1 \ | |
--exclude=/proc \ | |
--exclude=/mnt \ | |
--exclude=/dev \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// IMPORTANT IMPORTANT IMPORTANT - SET YOUR TWITTER HANDLE IN THE NEXT LINE! | |
// IMPORTANT IMPORTANT IMPORTANT - SET YOUR TWITTER HANDLE IN THE NEXT LINE! | |
const yourTwitterHandle = "@bootrino"; | |
// one every 10 seconds to avoid Twitter noticing | |
const waitTimeSeconds = 10 | |
const sleep = async (seconds) => new Promise(resolve => setTimeout(resolve, seconds * 1000)); | |
const main = async () => { | |
while (true) { | |
await walkTweets(); | |
await sleep(waitTimeSeconds) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.youtube.com/shorts/jlvwSorkdIo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const timeSince = (timestamp) => { | |
const seconds = Math.floor((new Date() - new Date(timestamp)) / 1000); | |
let interval = Math.floor(seconds / 31536000); | |
if (interval > 1) { | |
return interval + " years"; | |
} | |
interval = Math.floor(seconds / 2592000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ffmpeg -i "http://example.com/chunklist.m3u8" -codec copy file.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def make_slug(text, randomize=False, total_length=None): | |
# arbitrary | |
text = text[:30] | |
# arbitrary | |
length = total_length or 5 | |
if randomize: | |
text += '-' + shortuuid.ShortUUID('abdcefghkmnpqrstuvwxyzABDCEFGHKMNPQRSTUVWXYZ23456789').random(length=length) | |
if total_length: | |
return slugify(text)[:total_length] | |
return slugify(text) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def list_to_path(path_element_list, topslash=False, tailslash=False): | |
# strips leading and trailing slashes from each element and returns without leading and trailing slashes i.e. 'a/b/c' | |
# drop empty list elements | |
path_element_list = [x for x in path_element_list if x] | |
path = '/'.join([x.strip('/') for x in path_element_list]) | |
if topslash: | |
path = '/' + path | |
if tailslash: | |
path = path + '/' |
NewerOlder