Skip to content

Instantly share code, notes, and snippets.

View vincejv's full-sized avatar
🐶
Work-life balance

Vince JV vincejv

🐶
Work-life balance
View GitHub Profile
@vincejv
vincejv / .aliasrc
Last active May 13, 2021 18:40
Bash Aliases
# .bashrc - Aliases
# Custom shell prompt
export PS1="\[\033[38;5;11m\]\u\[$(tput sgr0)\]@\h\[$(tput sgr0)\]\[\033[38;5;6m\][\[$(tput sgr0)\]\[\033[38;5;39m\]\W\[$(tput sgr0)\]\[\033[38;5;6m\]]\[$(tput sgr0)\]\\$ \[$(tput sgr0)\]"
# Work with sudo
alias sudo='sudo '
# User specific aliases and functions
# Modem Restart
alias modemr="nohup /opt/cron/modem/restart.sh > /dev/null 2>&1 &"
@vincejv
vincejv / create-daemon-user.sh
Last active October 17, 2021 12:34
Create daemon user in linux
#!/usr/bin/env bash
# ------
# Creates a daemon user in linux
# usage: create-daemon-usr.sh <username>
# ------
# Add user
/usr/sbin/useradd -r $1
@vincejv
vincejv / aria2.conf
Last active May 9, 2021 20:09
Aria2 Config
#username
#rpc-user=
#Password
#rpc-passwd=111111
#The above authentication method is not recommended, it is recommended to use the following token method
#Set the encryption key
rpc-secret=
@vincejv
vincejv / pihole.conf
Created May 26, 2021 16:21
Pihole Lighttpd - Reverse Proxy to nginx
# Access Pihole UI on http[s]://web.tld/pihole
# Add ^~ to disable php execution, since lighttpd has already executed the
# php scripts, no need to execute the output of php files from lighttpd
location ^~ /pihole/ {
proxy_pass http://localhost:6775/admin/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 90;
@vincejv
vincejv / lxc-commands-openwrt.sh
Last active November 13, 2023 13:08
LXC OpenWRT
lxc-create --name ubuntu-jammy --template download -- --dist ubuntu --release jammy --arch amd64
lxc-start -n ubuntu-jammy # start
lxc-stop -n ubuntu-jammy # stop
lxc-ls -f # list
lxc-attach -n ubuntu-jammy
# usermods
adduser vince
apt install -y sudo
addgroup vince sudo
@vincejv
vincejv / gnome-tweaks.sh
Last active November 1, 2023 05:59
Gnome Tweaks (Ubuntu 22.04)
# In Ubuntu 20.04 Focal Fossa, there's a simple setting you can configure in Appearance -> Dock -> Show on:
# Dock tweaks (Doesn't work with Dock to Panel)
# minimize on click
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
# show icons that are open on that screen
gsettings set org.gnome.shell.extensions.dash-to-dock isolate-monitors true
@vincejv
vincejv / postgres.txt
Last active November 1, 2023 06:04
Postgres
# List users
SELECT * FROM pg_catalog.pg_user;
# Create user
CREATE USER youruser WITH ENCRYPTED PASSWORD 'yourpass';
# Create db owned by user
CREATE DATABASE "sonarr-main" OWNER sonarr;
CREATE DATABASE "sonarr-log" OWNER sonarr;
@vincejv
vincejv / mkvtools.sh
Last active April 27, 2024 13:53
MKV Tool Commands for Subs
# Change title and audio track languaage
mkvpropedit --edit info --set "title=The movie" --edit track:a1 --set language=tl input.mkv
# Rename track title
mkvpropedit *.mkv -e track:a1 -s name="Surround"
# Add encoding settings
for i in *.mkv; do mkvpropedit "$i" --tags track:v1:tags.xml; done
# Copy from public to uploads folder
for i in *.mkv; do mkdir "/data/torrents/uploads/${i%.*}"; done
@vincejv
vincejv / misccoms.sh
Created December 24, 2023 07:13
Misc commands
# MD5 sum of a folder
find folder/ -type f -print0 | xargs -0 md5sum | md5sum
@vincejv
vincejv / thelounge-dark-compact.css
Last active January 20, 2024 11:56
Compact Dark - The Lounge CSS (based on aab12345's flat dark theme)
/*!
* A simple flat theme with dark colours
* By aab12345 (modified by vincejv)
*
* License: MIT
* Compatible with The Lounge 4.2.0 / 4.3.0 / 4.4.0
* Last Updated: 01/20/2024
* Preview: https://i.imgur.com/8UgEkNL.png
*/