This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
: ' | |
This script helps me to backup Dropbox business accounts. Requires rclone to be installed on your machine (https://rclone.org/downloads/). | |
You must create a dropbox application (https://www.dropbox.com/developers/apps) with all READ scopes. | |
Then configure your rclone using rclone config | |
1) Choose dropbox | |
2) Set your remote name | |
3) On client_id, paste the value you have for "App key" on your Dropbox app (in settings) | |
4) On client_secret, paste the value you have for "App secret" on your Dropbox app (in settings) | |
5) Edit advanced config and set a value to the impersonate parameter (your admin account email e.g) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Nous avons deux textes en entrée, texte_a et texte_b qui parlent tous les deux de Labrador (l'un étant une région du Canada et l'autre étant une race de chien). | |
''' | |
import re | |
from tabulate import tabulate | |
texte_a = '''Le Labrador est la région continentale de la province canadienne de Terre-Neuve-et-Labrador. A ne pas confondre avec la race de chien labrador.''' | |
texte_b = '''Le retriever du Labrador, plus communément appelé labrador retriever ou plus simplement labrador, est une race de chiens originaire du Royaume-Uni. C'est un chien de taille moyenne, à l'allure ronde et robuste, de couleur entièrement sable, chocolat ou noir. Issu du chien de Saint-John, la race a été importée puis développée au Royaume-Uni et au Canada. Le labrador est actuellement l'une des races les plus répandues dans le monde.''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, jsonify | |
from flask import request | |
from bson.json_util import dumps | |
from flask_cors import CORS | |
from pymongo import MongoClient | |
client = MongoClient('mongodb://localhost:27017/') | |
db = client['reddit'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gsprpsc="git stash && git pull --rebase && git push && git stash apply && git stash clear" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mail: { | |
transport: 'SMTP', | |
options: { | |
service: 'Mailgun', | |
port: 2525, | |
auth: { | |
user: '[email protected]', | |
pass: 'myMailGunPassword' | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
print("LXC-KICKSTART - Ajinov : Network Setting") | |
ip = raw_input("Entrez l'adresse ip > ") | |
passerelle = raw_input("Entrez la passerelle > ") | |
hostname = raw_input("Entrez le hostname > ") | |
os_type = raw_input("Debian ou Ubuntu ? (0/1) > ") | |
hostname_file = "/etc/hostname" | |
interface_file = "/etc/network/interfaces" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf8 | |
import os, csv | |
print("Welcome to the ImapSync interactive") | |
mode = input("Interactive mode or Read CSV file ? (1/2) ") | |
if mode == "2": | |
#host1;user1;password1;host2;user2;password2 | |
file = input("File path : ") | |
if file: | |
print("Reading file") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def compare_dates(last_entry): | |
utc = pytz.UTC | |
if last_entry.end_time > utc.localize(datetime.datetime.now()): | |
return True | |
return False |