Skip to content

Instantly share code, notes, and snippets.

View OneCDOnly's full-sized avatar
🕶️
just geekin' out

OneCD OneCDOnly

🕶️
just geekin' out
  • ... there, behind that sofa!
  • 00:57 (UTC +10:00)
View GitHub Profile
@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 3, 2024 15:54
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
Indexer Membership Status API URL Software API Hits/Day NZB Grabs/Day Retention Account Duration Counter Reset Counter Reset
NZB.cat Free https://nzb.cat nZEDb 500 50 60 Days
NZB.cat VIP https://nzb.cat nZEDb 5,000 1,000 Lifetime
Oznzb.com Freeloader https://api.oznzb.com Newsnab+ 5 5 Rolling Counter Rolling Co
@Oppodelldog
Oppodelldog / inner.sh
Created November 27, 2019 20:29
shell - nested traps
#!/bin/bash
err_report() {
echo "error in inner script: $(caller):$1"
}
trap 'err_report $LINENO' ERR
echo "INNER SCRIPT"
@ishad0w
ishad0w / sources.list
Last active March 17, 2024 02:06
Debian 11 (Bullseye) -- Full sources.list
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://deb.debian.org/debian bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian bullseye-backports main contrib non-free
deb http://security.debian.org/debian-security/ bullseye-security main contrib non-free
@mob-sakai
mob-sakai / _README.md
Last active February 20, 2024 00:29
Run shell script on gist

Run shell script on gist

Shells that support process substitution such as bash and zsh allow to run shell script on gist as follows.

# With curl:
bash <(curl -sL ${GIST_URL}) args...

# With wget:
@iamtekeste
iamtekeste / Download Google Drive files with WGET
Created July 8, 2015 11:00
Download Google Drive files with WGET
Download Google Drive files with WGET
Example Google Drive download link:
https://docs.google.com/open?id=[ID]
To download the file with WGET you need to use this link:
https://googledrive.com/host/[ID]
Example WGET command:
@OneCDOnly
OneCDOnly / gist:947404ecd6efe48d763bf5c4b3761665
Created January 3, 2021 03:09
Kate highlighted keywords
# These demonstrate available words for syntax highlighting on Kate (makes it easier to pick a word that stands-out):
# ALERT ATTENTION DANGER HACK SECURITY
# BUG FIXME DEPRECATED TASK TODO TBD WARNING CAUTION NOLINT
# ### NOTE NOTICE TEST TESTING
@OneCDOnly
OneCDOnly / gist:f0a756e33d82ede0f2f7de1b0ecdb511
Created October 9, 2020 03:45
find unused BASH functions in script
#!/usr/bin/env bash
target_pathfile="$1"
target_func=''
for target_func in $(grep '()$' "$target_pathfile" | grep -v '=\|\$' | sed 's|()||g'); do
[[ $(grep -ow "$target_func" < "$target_pathfile" | wc -l) -eq 1 ]] && echo "$target_func()"
done
@n0ts
n0ts / remote_bash.sh
Created May 1, 2014 06:35
execute bash script from remote site
# http://stackoverflow.com/questions/5735666/execute-bash-script-from-url
bash <(curl -s http://mywebsite.com/myscript.txt)
# http://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
curl http://foo.com/script.sh | bash -s arg1 arg2
@OneCDOnly
OneCDOnly / gist:c6faa21b3f5ad53b43f16ac425b0f0e6
Created August 19, 2021 05:32
make all backup NZBs zero bytes
find /media/downloads/sabnzbd/nzb/backup/ -type f -name "*.nzb.*" ! -size 0 -print0 | xargs -0 truncate -s 0