Skip to content

Instantly share code, notes, and snippets.

Avatar

Fuan glubsy

  • Canada
View GitHub Profile
@glubsy
glubsy / howto_record_youtube_livestreams.md
Last active Feb 27, 2021
HOWTO record Youtube live streams
View howto_record_youtube_livestreams.md

How to properly record Youtube live streams:

• use this simple script.

• or use this script that does everything for you (download then merge). You can use cookies file to get member-only streams. Be aware that this script currently fails to download chunks as soon as the stream has ended (this might be a bug).

• or use youtube-dl with these arguments: youtube-dl -ciw --hls-use-mpegts --no-part, but be aware this will not download from the very first chunk of the stream and will only record from wheen you started the program.

@glubsy
glubsy / gfycat.show-all-download-links.js
Last active Feb 3, 2021 — forked from sidneys/gfycat.show-all-download-links.js
UserScript | GFYCAT | Show all Download Links (GIF, MP4, WEBP, WEBM)
View gfycat.show-all-download-links.js
@glubsy
glubsy / stream_parts_joiner.sh
Last active Feb 27, 2021 — forked from cheadrian/Youtube_Livestream_Parts_download.py
Download Youtube Live streamed video from the start. These scripts are not updated anymore, checkout https://github.com/glubsy/livestream_saver instead!
View stream_parts_joiner.sh
#!/bin/zsh
# Join parts generated by the script: https://gist.github.com/cheadrian/b661fb68a6a87ea64069e641cef68c3e#gistcomment-3495351
mkdir -p vid_fix
base_dir=$(pwd)
vid_dir="${base_dir}/stream_download_test/vid/"
aud_dir="${base_dir}/stream_download_test/aud/"
# number of files to skip from the start and end
skip_start=58
skip_end=0
@glubsy
glubsy / regex_loop_tests.py
Created Sep 1, 2020
Test regex union versus separate regex matching in a loop for possible performance gain
View regex_loop_tests.py
# Measure performance difference between two regex matching methods.
# We test each line in a data set (fake virtual directory paths in this case).
# 1) by looping through each compiled regex and testing each against each
# line, which should be something like O(n*m).
# 2) by combining all the regex expressions into one and matching that single
# expression against each line, which should be 0(n) probably...
# Note: we stop testing as soon as there is one match. If any of the regex
# expression matches, we don't need to continue
import re
import random
@glubsy
glubsy / save_as_tweaks_1.3.patch
Last active Dec 27, 2018
save as tweaks for mcomix 1.3 "Save as" dialog remembers the last used directory, Option to auto-rename suggested filename in case it already exists in target directory, Adds checker buttons in preferences for auto-rename suggestion and remembering of last used directory
View save_as_tweaks_1.3.patch
diff --git a/mcomix/main.py b/mcomix/main.py
index 80f74dc..d341238 100644
--- a/mcomix/main.py
+++ b/mcomix/main.py
@@ -278,6 +278,8 @@ class MainWindow(gtk.Window):
if show_library:
self.actiongroup.get_action('library').activate()
+ self.last_used_directory=None
+
@glubsy
glubsy / crash.log
Last active Sep 29, 2018
TheyBleedPixels error log (Arch Linux)
View crash.log
./x86/theybleedpixels.x86[0x807cb38]
./x86/theybleedpixels.x86[0x807cb92]
linux-gate.so.1(__kernel_rt_sigreturn+0x0)[0xf7f7a070]
/usr/lib32/pulseaudio/libpulsecommon-12.2.so(pa_smoother_new+0x31)[0xf44f64e1]
/usr/lib32/libpulse.so.0(+0x299d4)[0xf4a019d4]
/data/SteamLibrary/steamapps/common/they bleed pixels/x86/libopenal.so.1(+0x507f5)[0xf7a307f5]
/data/SteamLibrary/steamapps/common/they bleed pixels/x86/libopenal.so.1(+0x536db)[0xf7a336db]
/data/SteamLibrary/steamapps/common/they bleed pixels/x86/libopenal.so.1(+0x254d8)[0xf7a054d8]
/data/SteamLibrary/steamapps/common/they bleed pixels/x86/libopenal.so.1(alcCreateContext+0xd1)[0xf7a06cd1]
./x86/theybleedpixels.x86[0x80e4612]
@glubsy
glubsy / theybleedpixels.strace
Last active Sep 29, 2018
Strace of the TheyBleedPixels wrapper script
View theybleedpixels.strace
execve("./TheyBleedPixels", ["./TheyBleedPixels"], 0x7ffddf7243f0 /* 48 vars */) = 0
brk(NULL) = 0x55c1d3963000
arch_prctl(0x3001 /* ARCH_??? */, 0x7ffdc7068190) = -1 EINVAL (Invalid argument)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/data/SteamLibrary/steamapps/common/they bleed pixels/x86/tls/x86_64/x86_64/libreadline.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/data/SteamLibrary/steamapps/common/they bleed pixels/x86/tls/x86_64/x86_64", 0x7ffdc70673d0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/data/SteamLibrary/steamapps/common/they bleed pixels/x86/tls/x86_64/libreadline.so.7", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/data/SteamLibrary/steamapps/common/they bleed pixels/x86/tls/x86_64", 0x7ffdc70673d0) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/data/SteamLibrary/steamapps/common/they bleed pixels/x86/tls/x86_64/libreadline.so.7", O_R
@glubsy
glubsy / waifu.sh
Last active Sep 26, 2018 — forked from frantic1048/waifu.sh
waifu2x batch operation wrapper
View waifu.sh
#!/bin/bash
# example method for best quality output:
#waifu2x -scale 2 -method scale -tta 1 -tta_level 8 -model_dir /usr/share/waifu2x/models/photo -i ~/test/test_1280.png -o ~/test/test_waifu2x_tta8.png
success(){
# play a sound on successful file processing
paplay ~/Music/sfx/185845__lloydevans09__incorrect-function.wav
return 0
}
failure(){
View PKGBUILD
# Maintainer: Piotr Rogoża <rogoza dot piotr at gmail dot com>
# Contributor: Nathan O <ndowens.aur at gmail dot com>
# vim:set ts=2 sw=2 et ft=sh tw=100: expandtab
pkgname=diffimg
_pkgname=Diffimg
pkgver=2.2.0
pkgrel=1
pkgdesc="Simple image comparison tool"
arch=('i686' 'x86_64')
@glubsy
glubsy / i3bg3.py
Last active Dec 17, 2018
Improvements on u/caagr98's i3bg.py script for workspace-specific wallpapers
View i3bg3.py
#!/usr/bin/env python3
#i3 per-workspace background for Caagr98 https://gist.github.com/Caagr98/f74e149403e5c1f92006158f09108a78
#deps: pip3 install python3-xlib i3ipc Pillow
# usage: i3bg2.py /path/to/directory
# where directory holds wallpapers to randomly pick from (optional)
import Xlib.threaded
import Xlib
import Xlib.display
from Xlib import Xatom
from PIL import Image