Skip to content

Instantly share code, notes, and snippets.

@cnleo
cnleo / 2fa
Created April 5, 2020 04:01 — forked from MineRobber9000/2fa
2-factor authentication terminal app in Python
#!/usr/bin/env python
import os, os.path, stat, sys, base64
# TOTP lib inlined
import time, hmac, base64, hashlib, struct
def pack_counter(t):
return struct.pack(">Q", t)
@cnleo
cnleo / linux-stuff.txt
Created May 17, 2020 23:34
Links to Linux stuff
Linux Advanced Routing & Traffic Control HOWTO
"A very hands-on approach to iproute2, traffic shaping and a bit of netfilter."
https://berthub.eu/lartc/
@cnleo
cnleo / toolings.txt
Last active October 18, 2020 16:03
Links to Tools
List of tools to create Live USB systems
https://en.wikipedia.org/wiki/List_of_tools_to_create_Live_USB_systems
A collection of free single-purpose online tools for web developers...
https://tiny-helpers.dev/
A list of free, self-hosted software in different categories
https://github.com/awesome-selfhosted/awesome-selfhosted
A list of AWESOME everything, like self-hosted (as above), just of anything
@cnleo
cnleo / security-and-privacy-links.txt
Last active May 4, 2021 09:24
Links to security and privacy related stuff
@cnleo
cnleo / github-projects.txt
Last active October 18, 2021 08:36
List of github projects
https://github.com/lutris
https://github.com/CodingTrain
@cnleo
cnleo / Youtube_Livestream_Parts_download.py
Created September 5, 2021 15:57 — forked from cheadrian/Youtube_Livestream_Parts_download.py
Download Youtube Live streamed video from the start or selected time
#With the help of this script you can download parts from the Youtube Video that is live streamed, from start of the stream till the end
import urllib.request
import os
#E.G: "https://r4---sn-gqn-p5ns.googlevideo.com/videoplayback?expire=1603041842& ..... 2.20201016.02.00&sq="
#The sound link should contain: &mime=audio in it.
#Here's an example from NASA LIVE:
#VIDEO: https://r5---sn-gqn-p5ns.googlevideo.com/videoplayback?expire=1603165657&ei=eQmOX8TeFtS07gO1xLWwDA&ip=79.115.11.159&id=DDU-rZs-Ic4.1&itag=137&aitags=133%2C134%2C135%2C136%2C137%2C160&source=yt_live_broadcast&requiressl=yes&mh=PU&mm=44%2C29&mn=sn-gqn-p5ns%2Csn-c0q7lnsl&ms=lva%2Crdu&mv=m&mvi=5&pl=20&initcwndbps=1350000&vprv=1&live=1&hang=1&noclen=1&mime=video%2Fmp4&gir=yes&mt=1603143920&fvip=5&keepalive=yes&fexp=23915654&c=WEB&sparams=expire%2Cei%2Cip%2Cid%2Caitags%2Csource%2Crequiressl%2Cvprv%2Clive%2Chang%2Cnoclen%2Cmime%2Cgir&sig=AOq0QJ8wRQIgQMnxy1Yk3HLTpqbOGmjZYH1CXCTNx6u6PgngAVGi4EQCIQDWyaye-u_KGyVQ0HRUsyKVaAzyXbmzDqOGVGpIyP7VtA%3D%3D&lspa
@cnleo
cnleo / ffmpeg combine files.sh
Created September 6, 2021 12:22 — forked from NapoleonWils0n/ffmpeg combine files.sh
ffmpeg: combine seperate audio and video files into a single video
#!/bin/sh
# ffmpeg combine seperate audio and video files into a single video
# copy the audio and video tracks
ffmpeg -i audio.aiff -i video.mov -acodec copy -vcodec copy -f mp4 avcombined.mp4
# encode the audio as aac and copy the video track without encoding it. if its the h264 codec
ffmpeg -i audio.aiff -i video.mov -acodec libfaac -ac 2 -ar 48000 -ab 160k -vcodec copy -f mp4 avcombined.mp4
@cnleo
cnleo / command_list.txt
Last active November 18, 2023 22:12
commands you need - ever
/* if android broke your video record because storage is full; use the untrunc fork from anthwlock https://github.com/anthwlock/untrunc */
untrunc -sv you_need_a_working_video_as_reference_from_your_device.mp4 your_android_broken_video.mp4
/* delete metadata, good before you publish something; does not work with pdf */
exiftool -all= input.mp4
ffmpeg -i input.mp4 -map 0 -map_metadata -1 -c copy output.mp4
/**
* "best" mean video and audio in once file - sometimes it will smaler (because only subset are avaible as once)
* but it is much more accurate in sync;
@cnleo
cnleo / ChromeContentScript.js
Created March 19, 2022 18:33 — forked from insin/ChromeContentScript.js
Chrome Extension compatibility for Greasemonkey's GM_getValue and GM_setValue
// Request settings from the extension's localStorage and kick things off
chrome.extension.sendRequest({type: "getprefs"}, function(response)
{
cachedSettings = response;
init();
});
@cnleo
cnleo / junction.cmd
Last active May 1, 2022 19:33
junction for microsoft minecraft source packs
@echo off
REM simple to update source packs once for all your installs; here it is in "C:\Minecraft\Source Packs"
mklink /j "C:\Users\<you>\AppData\Roaming\.minecraft\resourcepacks" "C:\Minecraft\Source Packs"
mklink /j "C:\Minecraft\Feed the Beast Launcher\Minecraft Installs\FTBUltimateReloaded\minecraft\resourcepacks" "C:\Minecraft\Source Packs"
mklink /j "C:\Minecraft\TechnicLauncher\Install\.technic\modpacks\tekkitmain\resourcepacks" "C:\Minecraft\Source Packs"
REM to delete the junction use follow e.g.:
REM rmdir "C:\Minecraft\TechnicLauncher\Install\.technic\modpacks\tekkitmain\resourcepacks"