Skip to content

Instantly share code, notes, and snippets.

View glubsy's full-sized avatar

Fuan glubsy

  • Canada
View GitHub Profile

Intro

Just some FYI, to get started:

  • I'm using a 16 GB Sandisk SD card.
  • I have a model B Pi, 512 MB RAM (not really relevant, thought I'd mention it).
  • Monitor and keyboard connected to the Pi itself, for now.
  • Network working, internet access.
@frantic1048
frantic1048 / waifu.sh
Last active September 25, 2018 02:08
waifu2x batch operation wrapper
#!/bin/bash
waifu () {
if [[ $# -eq 0 ]]; then
cat << EOF
Usage: waifu [OPTIONS] FILE1 [FILE2 ...]
Options:
-d dry run, just print out the commands to exec.
@Kyuuhachi
Kyuuhachi / i3bg2.py
Created December 11, 2016 00:28
i3 per-workspace background for /u/Ghostotw
#!/usr/bin/env python3
import Xlib.threaded
import Xlib
import Xlib.display
from Xlib import Xatom
from PIL import Image
import os.path
from collections import defaultdict
try:
@naelstrof
naelstrof / monitorshot2.sh
Last active June 15, 2024 20:40
Just screenshots the monitor that the mouse is on.
#!/bin/bash
MONITORS=$(xrandr | grep -o '[0-9]*x[0-9]*[+-][0-9]*[+-][0-9]*')
# Get the location of the mouse
XMOUSE=$(xdotool getmouselocation | awk -F "[: ]" '{print $2}')
YMOUSE=$(xdotool getmouselocation | awk -F "[: ]" '{print $4}')
for mon in ${MONITORS}; do
# Parse the geometry of the monitor
MONW=$(echo ${mon} | awk -F "[x+]" '{print $1}')
anonymous
anonymous / PKGBUILD
Created November 20, 2017 00:29
pkgname=diffimg
_pkgname=Diffimg
pkgver=2.2.0
pkgrel=1
pkgdesc="Simple image comparison tool"
arch=('i686' 'x86_64')
license=('GPL2')
depends=(qt4 qwt-qt4 opencv2-opt freeimage)
makedepends=(qt4 qwt-qt4 opencv2-opt freeimage cmake)
url='http://sourceforge.net/projects/diffimg/'
@ddnomad
ddnomad / luks_on_lvm_arch_linux_guide.sh
Last active April 11, 2023 19:34
Arch Linux installation with a full-disk encryption (LUKS on LVM)
###############################################################################
# Author: ddnomad
# Version: 1.1.3
# Last Update: 2020-07-06
#
# External contributors:
# - u/momasf (https://www.reddit.com/user/momasf) - an excellent
# tip to use 'reflector' to speed up downloads during the base
# installation
# - eXhumer (https://github.com/eXhumer) - Fixes for things that
@cheadrian
cheadrian / Youtube_Livestream_Parts_download.py
Last active July 21, 2024 20:27
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
@abraithwaite
abraithwaite / chill-zoom.sh
Last active May 8, 2024 08:43
Zoom in Systemd Cgroups on Linux. Change the max allocations to fit your workstation.
#!/usr/bin/bash -xe
cat <<EOF > "${HOME}/.config/systemd/user/zoom.slice"
[Slice]
AllowedCPUs=0-4
MemoryHigh=6G
EOF
cat /usr/share/applications/Zoom.desktop | sed -E 's#^(Exec=).*$#Exec=/usr/bin/systemd-run --user --slice=zoom.slice /opt/zoom/ZoomLauncher#' > "${HOME}/.local/share/applications/Zoom.desktop"
@Henje
Henje / papers_please_fix.cpp
Last active February 28, 2023 23:10
Simple hack to disable joystick scanning and remove stutters from Papers Please.
#include <string>
#include <dlfcn.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
using namespace std::literals;
@guilhem
guilhem / tpm2_startup.service
Last active March 30, 2024 20:50
a set of systemd unit to fix tpm errors "tpm tpm0: a tpm error (256) occurred attempting get random"
[Unit]
Description=Execute TPM2 Startup with Delay After Suspend
After=systemd-suspend.service systemd-hybrid-sleep.service systemd-hibernate.service
[Service]
Type=oneshot
ExecStartPre=/bin/sleep 5
ExecStart=/usr/bin/tpm2_startup
[Install]