This file contains hidden or 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
| """ | |
| https://en.wikipedia.org/wiki/Trie | |
| """ | |
| from collections import defaultdict | |
| from itertools import chain | |
| from queue import Queue | |
| from typing import Any, Iterable, Iterator, Optional | |
This file contains hidden or 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
| # Original source from http://asyncio.readthedocs.io/en/latest/producer_consumer.html | |
| # Rewritten for Python >=3.4 | |
| import asyncio | |
| import random | |
| @asyncio.coroutine | |
| def produce(queue, n): | |
| for x in range(n): |
This file contains hidden or 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
| #!/usr/bin/env sh | |
| # - https://stackoverflow.com/questions/12023773/python-3-3-source-code-setup-modules-were-not-found-lzma-sqlite3-tkinter | |
| # - https://stackoverflow.com/questions/6171210/building-python-and-more-on-missing-modules | |
| sudo \ | |
| apt-get install \ | |
| build-essential python-dev "libncurses*-dev" \ | |
| liblzma-dev libgdbm-dev libsqlite3-dev \ | |
| libbz2-dev tk-dev libssl1.0-dev \ | |
| libreadline6 libreadline6-dev |
This file contains hidden or 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
| # Install nvidia-docker and nvidia-docker-plugin | |
| wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb | |
| sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb |
This file contains hidden or 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
| # Requires pydub (with ffmpeg) and Pillow | |
| # | |
| # Usage: python waveform.py <audio_file> | |
| import sys | |
| from pydub import AudioSegment | |
| from PIL import Image, ImageDraw | |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| echo "Installation de Docker-compose" | |
| curl -L "https://github.com/docker/compose/releases/download/1.8.1/docker-compose-$(uname -s)-$(uname -m)" -o ./docker-compose | |
| sudo mv docker-compose /usr/local/bin/docker-compose | |
| sudo chmod +x /usr/local/bin/docker-compose | |
| which docker-compose | |
| docker-compose --version |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| wget -O - https://get.docker.com/ | sh - | |
| sudo usermod -aG docker $USER | |
| # edition du fichier de settings pour docker | |
| sudo $EDITOR /etc/default/docker | |
| # restart du daemon docker |
This file contains hidden or 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
| # https://askubuntu.com/questions/324725/getting-command-not-found-working-under-zsh | |
| if [[ -s '/etc/zsh_command_not_found' ]]; then | |
| source '/etc/zsh_command_not_found' | |
| fi | |
| # http://virtualenvwrapper.readthedocs.io/en/latest/install.html#basic-installation | |
| export WORKON_HOME=$HOME/.virtualenvs | |
| export PROJECT_HOME=$HOME/Devel | |
| source ~/.local/bin/virtualenvwrapper.sh |
This file contains hidden or 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
| ###################### | |
| ### DESIGN CHANGES ### | |
| ###################### | |
| # Met ZSH comme shell de base | |
| set-option -g default-shell /bin/zsh | |
| # remap prefix from 'C-b' to 'C-a' | |
| unbind C-b | |
| set-option -g prefix C-a |
This file contains hidden or 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
| #!/bin/bash | |
| echo "1. Installation des packages (essentiels) pour l'host" | |
| sudo apt-get install -y \ | |
| htop iotop bmon \ | |
| mesa-utils \ | |
| apt-file \ | |
| usbutils \ | |
| dconf-cli \ | |
| zsh \ |