Skip to content

Instantly share code, notes, and snippets.

@baydam
baydam / Internet_check.sh
Created April 10, 2015 19:38
This Script reboot the modem router after verifying if internet connection gone down
#!/bin/bash
# Author: Dame Diongue
# This script checks for an active Internet connection by trying to access
# If check fail, it will reboot the Modem Router
# Trying to access
wget -t 1 -T 10 -o wgetout "http://www.google.sn"
# Wait 5 secondes
sleep 5
@baydam
baydam / rearrange_downloads.py
Last active April 6, 2022 03:22
This script will be execute when medias (movies and tv shows) download are complete. He move the movies to movies folders, create new folder in tv show directory with a name of show and copy it in.
#!/usr/bin/python
import os, re, shutil
from os.path import join, expanduser, dirname, basename
# Defines global variables
media_extensions = ['avi', 'mkv', 'mp4'] # Extensions for many videos file
tv_show_directory = expanduser("/mnt/D40E9CD00E9CACCC/Series/") # Tv Show path
movies_directory = expanduser("/mnt/D40E9CD00E9CACCC/Movies/") # Movies path
download_directory = expanduser("~/Downloads/") # Path for downloaded files