Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View glubsy's full-sized avatar

Fuan glubsy

  • Canada
View GitHub Profile
@glubsy
glubsy / PKGBUILD
Last active September 19, 2018 18:00 — forked from anonymous/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 / waifu.sh
Last active September 26, 2018 00:44 — forked from frantic1048/waifu.sh
waifu2x batch operation wrapper
#!/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(){
@glubsy
glubsy / theybleedpixels.strace
Last active September 29, 2018 17:11
Strace of the TheyBleedPixels wrapper script
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 / crash.log
Last active September 29, 2018 17:18
TheyBleedPixels error log (Arch Linux)
./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 / save_as_tweaks_1.3.patch
Last active December 27, 2018 09:05
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
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 / regex_loop_tests.py
Created September 1, 2020 21:16
Test regex union versus separate regex matching in a loop for possible performance gain
# 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 / gfycat.show-all-download-links.js
Last active February 3, 2021 19:49 — forked from sidneys/gfycat.show-all-download-links.js
UserScript | GFYCAT | Show all Download Links (GIF, MP4, WEBP, WEBM)
@glubsy
glubsy / stream_parts_joiner.sh
Last active February 27, 2021 18:36 — 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!
#!/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 / i3bg3.py
Last active February 25, 2022 18:56
Improvements on u/caagr98's i3bg.py script for workspace-specific wallpapers
#!/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
@glubsy
glubsy / howto_record_youtube_livestreams.md
Last active April 16, 2024 14:48
How to properly record Youtube & Twitch live streams

How to record Youtube live streams:

  • use livestream_saver to download from the first segment. Can also record membership-only streams by supplying it your cookies (uses yt-dlp to download)

  • use ytarchive which basically does the same thing, except a bit better.

  • use youtube_stream_capture. You can use cookies file to get member-only streams too. Be aware that this script currently fails to download chunks as soon as the stream has ended (this might be a bug).

  • or use live-dl which does monitoring of streams too. This is a wrapper around streamlink and yt-dlp.