Skip to content

Instantly share code, notes, and snippets.

@viktorlindgren
viktorlindgren / svt-serier.sh
Last active January 1, 2018 22:46
svt-serier
#!/bin/bash
cd "$(dirname "$0")" # Script path
mkdir -p SvtPlay && cd SvtPlay
WeekDay=$(date +'%A')
Hour=$(date +'%H')
function dl {
name=$1
if [[ "$WeekDay" != "$2" ]] || (( $3 != 10#$Hour )); then
@viktorlindgren
viktorlindgren / seafile-cli-update
Last active December 24, 2015 23:39
Seafile linux client update script
#!/bin/bash
# Create dirs if not exists
mkdir -p ~/bin ~/seaf-cli
cd ~/seaf-cli
# Remove any old or failed updates
rm -rf ~/seaf-cli/*.tar*
# Get download address
arch=$(uname -m | sed s/"_"/"-"/g)
@viktorlindgren
viktorlindgren / subscribe_youtube.py
Last active December 23, 2015 14:39
Subscript system of one Youtube channel using youtube-dl that only downloads newer videos since last time ran. youtube-dl can be found at http://rg3.github.io/youtube-dl/
from datetime import date, datetime
from subprocess import Popen, PIPE
import sys
DATEFORMAT = "%Y%m%d"
CONFPATH = 'last_updated.txt'
CMD = '''\
youtube-dl.exe -ci -w -o "%(title)s.%(ext)s" http://www.youtube.com/user/WTii1 --match-title "Warcraft 3.*"\
'''