Skip to content

Instantly share code, notes, and snippets.

@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
@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

How to Install Vector on Ubuntu 14

Vector is an on-host performance monitoring framework which exposes hand picked high resolution metrics to every engineer’s browser. More here.

Host machine

PCP Requirements

Vector requires PCP to collect data.

Lex

@baydam
baydam / install-cockpit.md
Last active July 13, 2017 15:06
How to install cockpit on Debian/Ubuntu

How to install cockpit on Debian/Ubuntu

$ git clone https://github.com/cockpit-project/cockpit.git
$ cd cockpit

Dependencies

$ sudo apt-get install nodejs npm
$ sudo npm install -g phantomjs
// Range tous les pins sur un tableau, la j'ai choisi au hasard
int numeroPins[] = {10, 13, 2, 12, 11};
// Ici le nombre de lampe est 5 puisque le tableau contient 5 case
int nombreDeLampe = 5;
void setup() {
// Parcoure ton tableau pour setter le pin mode
for (int i = 0; i < nombreDeLampe; i++)
pinMode(numeroPins[i], OUTPUT);
// Joue le premier effet serpent une seul fois
@baydam
baydam / afrocentriklab.css
Created March 7, 2016 22:22
Just a draft
#page-2 p {
width: 320px;
box-shadow: 0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.2),0 1px 5px 0 rgba(0,0,0,.12);
border-radius: 2px;
box-sizing: border-box;
}
#page-2 div img {
width: 320px;
margin: 0;
const unsigned int leftLED = 3; // LED on left side
const unsigned int leftButton = 2; // Button on left side
const unsigned int rightLED = 10; // LED on right side
const unsigned int rightButton = 11; // Button on right side
int ledState = LOW;
int buttonState;
int previousState = HIGH;
@baydam
baydam / flash-firefox.md
Created May 18, 2016 19:20
Comment ouvrir un fichier .SWF dans Firefox

Installer le pulugin flash dans Ubuntu

$ sudo apt-get install adobe-flashplugin

Ouvrir le fichier /usr/share/mime/packages/freedesktop.org.xml en mode root avec votre editeur de texte favori en tapant dans le terminal.

$ sudo gedit  /usr/share/mime/packages/freedesktop.org.xml

Modifier la ligne suivante:
<mime-type type="application/vnd.adobe.flash.movie">
Remplacer s'il existe par:

@baydam
baydam / build-cleanflight.md
Last active June 2, 2016 13:23
How to build cleanflight on Debian

How to build cleanflight on Debian/Ubuntu

Clone project from repository

$ git clone https://github.com/cleanflight/cleanflight.git
$ cd cleanflight

Dependencies

Allow your pc running 32 bits software

@baydam
baydam / build-pocketvj.md
Last active April 27, 2024 03:58
How to build PocketVJ on Raspberry Pi 3

Documentation for building PocketVJ on raspberry Pi 3

Install Raspbian Lite

Find the instruction in the link below https://www.raspberrypi.org/documentation/installation/installing-images/README.md

Install dependencies

$ sudo apt-get -y install lxde-core lxterminal lxappearance xinit lightdm ntfs-3g python-pexpect vim figlet git-core firmware-ralink hostapd isc-dhcp-server lighttpd samba samba-common-bin php5-common php5-cgi php5 php5-mysql screen fbi ttf-mscorefonts-installer mediainfo gparted php5-cli iptables xtightvncviewer imagemagick dosfstools exfat-utils exfat-fuse hfsplus hfsprogs hfsutils xdotool expect expect-dev avahi-daemon libavahi-compat-libdnssd-dev feh libjpeg8 libjpeg8-dev libao-dev avahi-utils libavahi-compat-libdnssd-dev libva-dev youtube-dl python-smbus mpg321 mpg123 libreoffice-impress rc-gui python-pip iceweasel python-dev python-dbus xpdf x11-xserver-utils libncurses5-dev shellinabox tk okular usbmount libgstreamer0.10-0 libgstreamer0.10-dev gstreamer0.10-tools gstr