Skip to content

Instantly share code, notes, and snippets.

View thingsiplay's full-sized avatar

Tuncay thingsiplay

View GitHub Profile
@thingsiplay
thingsiplay / check_eol_kernel.sh
Last active November 3, 2022 16:59
Check if one of the current installed Linux kernels has reached EOL
#!/bin/env bash
# https://forum.manjaro.org/t/can-i-get-a-warning-about-eol-of-a-kernel/84079/10
# check_eol_kernel
# Check if one of the current installed Linux kernels has reached EOL
#
# Usage:
# check_eol_kernel
# check_eol_kernel list
#
@thingsiplay
thingsiplay / clipdelete
Created January 5, 2022 08:37
Clipboard editing scripts
#!/bin/sh
echo '' | xclip -selection clipboard -rmlastnl -in
xsel --clipboard --clear
@thingsiplay
thingsiplay / vimh.sh
Created February 18, 2022 21:33
vimh - Open Vim in help page directly from terminal (fzf edition)
#!/bin/env bash
# vimh - Open Vim in help page directly from terminal (fzf edition)
#
# Usage:
# If no argument is given, then a fuzzy finder search is initiated.
#
# vimh [tag]
# vimh ''
# vimh '<c-p>'
@thingsiplay
thingsiplay / py
Created March 25, 2022 13:59
py - check Python script with mypy and flake8, then execute it
#!/bin/env bash
# py - check Python script with mypy and flake8, then execute it
export PATH=".:$PATH"
file=$(/usr/bin/which --skip-alias --skip-functions "$1")
shift
export MYPY_CACHE_DIR="/tmp/.mypy_cache"
mkdir -p "$MYPY_CACHE_DIR"
mypy "$file" \
@thingsiplay
thingsiplay / .zshrc
Created April 11, 2022 20:40
cdd - jump to a directory you visited previously (ZSH function)
# cdd - jump to a directory you visited previously
# A Function for ZSH config file.
#
# Usage:
# $ cdd
# $ cdd "regex"
#
# Don't forget to enable "setopt auto_pushd", so that each "cd" command will
# add a folder to the list automatically.
#
@thingsiplay
thingsiplay / checkmails.sh
Created April 24, 2022 11:05
Count unread mails in Thunderbird and write to stdout.
#!/bin/env bash
# Count unread mails in Thunderbird and write to stdout.
# Usage:
# checkmails.sh
# Path to your Thunderbird profile.
profile="$HOME/.thunderbird/aabbcc007.default"
# Regex to find the unread message lines.
@thingsiplay
thingsiplay / biggest.sh
Last active May 6, 2022 12:19
biggest - list biggest files and folders
#!/bin/env bash
# biggest - list biggest files and folders
#
# Usage:
# biggest
# biggest *.png
du --apparent-size --all --max-depth 1 --one-file-system "$@" \
| sort --numeric-sort --ignore-leading-blanks --reverse \
@thingsiplay
thingsiplay / ocr
Created May 13, 2022 17:12
ocr - select screen portion and recognize text from non text source such as videos
#!/bin/env bash
input="$(mktemp)"
output="$(mktemp)"
import "$input.png"
tesseract -l eng "$input.png" "$output" 2> /dev/null
cat "$output.txt"
rm -f "$input"
@thingsiplay
thingsiplay / arcade_monitor.slangp
Last active June 12, 2022 13:52
My Shader Presets for RetroArch shaders_slang
#reference "shaders_slang/presets/crt-royale-kurozumi.slangp"
geom_mode_runtime = "3.000000"
interlace_detect_toggle = "0.000000"
@thingsiplay
thingsiplay / fontsearch.sh
Last active June 9, 2022 10:55
Cleaner output font name output when searching for font
#!/bin/sh
fc-list \
| grep -ioE ": [^:]*$1[^:]+:" \
| sed -E 's/(^: |:)//g' \
| tr , \\n \
| sort \
| uniq