Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
jfeilbach / transmission
Last active September 22, 2018 16:44
/etc/logrotate.d/transmission
/var/log/transmission/transmission.log {
daily
rotate 7
delaycompress
compress
notifempty
missingok
postrotate
invoke-rc.d transmission-daemon reload
endscript
@jfeilbach
jfeilbach / settings.json
Last active September 22, 2018 16:43
transmission daemon config file ~/.config/transmission-daemon/settings.json
{
"alt-speed-down": 50,
"alt-speed-enabled": false,
"alt-speed-time-begin": 540,
"alt-speed-time-day": 127,
"alt-speed-time-enabled": false,
"alt-speed-time-end": 1020,
"alt-speed-up": 50,
"bind-address-ipv4": "192.168.1.53",
"bind-address-ipv6": "::",
@jfeilbach
jfeilbach / mnt.sh
Last active April 25, 2019 20:17
Mount remote media shares
#!/bin/bash
# mount remote filesystems
HOST='nas1'
OPTS='guest,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,soft,user,noperm'
LOCAL_PATH='/mnt'
CMD='sudo mount'
DIR=${1}
NC='\e[0m'
WHITE='\e[1;37m'
@jfeilbach
jfeilbach / tomcat.service
Last active March 14, 2023 23:51
WorldServer systemd tomcat.service
[Unit]
Description=Tomcat 8.5 servlet container
After=network.target
[Service]
Type=forking
User=ws
Group=ws
@jfeilbach
jfeilbach / replace_tracker.sh
Last active November 8, 2018 15:26
Update torrents with current tracker URL via transmission-remote (uses a gsed alias)
#!/bin/bash
SECONDS=0
CMD=/usr/local/bin/transmission-remote
TR=$(/usr/local/bin/transmission-remote)
# Your announce key for the new tracker (keep secret)
KEY="key"
# Transmission daemon host
HOST="localhost:9091"
# Authentication to transmission-daemon; 1 = True, 0 = False
# Python 2 - Requires: flac, lame
# Usage: python transcode.py 320/V0/V2 inputfolder
# By: TheSingularity
python
import sys, os, shutil
from subprocess import call
convertTo = sys.argv[1]
folderPath = sys.argv[2]
@jfeilbach
jfeilbach / .bashrc
Last active March 2, 2020 16:31
.bashrc for Ubuntu Linux
alias p='/usr/bin/python3.7'
alias auth='/usr/bin/oathtool --totp -b <private key> | pbcopy'
alias auth2='/usr/bin/oathtool --totp -b <private key> | pbcopy'
alias btc='curl https://rate.sx/btc'
alias fw='/home/jason/auth.sh'
alias weather='curl -s https://wttr.in/South_Jordan | head -n -2'
alias rr='if [ -f /var/run/reboot-required ]; then echo "reboot required"; else echo "No reboot needed"; fi'
alias gh='/home/jason/get_aws_host.sh'
alias sshbast='fed up di && auth && ssh -A -i ~/.ssh/id_rsa -o VisualHostKey=yes $FED_USER@$FED_HOST'
alias sshbastdi='fed up di && auth && ssh di'
@jfeilbach
jfeilbach / gist:604f1ed6c4c1f0b7b1928e8fab613675
Last active April 8, 2019 20:10
Linux desktop setup (not very organized) for HP ZBook 15 G5 (WIP)
sudo apt install gnome-tweak-tool curl htop glances git sky python-requests openjdk-11-jre-headless remmina remmina-plugin-rdp remmina-plugin-rdp unbound transmission-remote-cli gnome-todo feedreader ngrep awscli python3.7 oathtool keychain flac ffmpeg mediainfo secret-tool libsecret-tools ruby-full chrome-gnome-shell gnome-online-accounts mosh
#!/bin/bash
# Fix resolution lost during reboot
# Laptop display
# run on X start
#xrandr --newmode "1920x1080_60.00" 173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
#xrandr --addmode Virtual1 "1920x1080_60.00"
#xrandr -s 1920x1080_60.00
# New external monitor version
@jfeilbach
jfeilbach / gist:fb27b2bc211892e07cc4a36d7c154294
Created March 12, 2019 20:53 — forked from Ray33/gist:ba189a729d81babc99d7cef0fb6fbcd8
Amazon Elastic Network Adapter (ENA) on CentOS 7
sudo su
yum --enablerepo=extras install epel-release
yum -y install patch dkms kernel-devel perl
yum update
reboot
sudo su
@jfeilbach
jfeilbach / get_tls.sh
Last active June 25, 2019 19:38
Get TLS cert expiration and send reminder
#!/bin/bash
SECONDS=0
RED='\033[0;31m'
WHITE='\033[1;37m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
LIST='host1 host2 host3'