Skip to content

Instantly share code, notes, and snippets.

View lee-pai-long's full-sized avatar
💭
Work In Progress

Saïdina MOHAMED ALI lee-pai-long

💭
Work In Progress
  • Marseille (France)
View GitHub Profile
@lee-pai-long
lee-pai-long / retry_with_backoff.py
Last active September 16, 2020 23:33
Retry an action with exponential backoff
"""Retry an action with exponential backoff.
Inspired by:
- https://www.toptal.com/python/python-parameterized-design-patterns#classes-as-exceptions
- https://stackoverflow.com/a/33577016/3775614
"""
# WARNING: Never used yet
# TODO: Add a unit test module
import time

GIT: Keep branch author on squash merge

When merging topic branches with the squash method, i.e: git merge --squash ${topic_branch}, by default the author and committer of the merge commit following will be the one executing the merge.

But most of the time this person(or tool) is the integrator and to be able to follow back a topic author we need to force

@lee-pai-long
lee-pai-long / install.sh
Created September 25, 2019 08:33 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`

[Apache] Tail log file with new line

$ [sudo] tail -f <apache-log-file.log> | sed 's/\\n/\n/g'

[LIBVIRT] Share directory with guest

Edit domain xml:

$ [sudo] virsh edit <mydomain>

[Python3] List of must read PEPs

Fist a reminder of what a PEP is and how PEPs are organised

PEP stands for Python Enhancement Proposal. A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment. The PEP should provide a concise technical specification of the feature and a rationale for the feature.

[DEBIAN] Install python 3.4 on Wheezy using Apt Pinning

Create a file in the apt souces directory:

$ [sudo] vim /etc/apt/sources.list.d/jessie.list

Add this line:*

[Atom] Use PlantUML

Install Graphviz

$ [sudo] apt-get update -qq \
> && [sudo] apt-get install graphviz

[Linux Mint 17.2] Install latest owncloud Client

Install

$ URL="http://download.opensuse.org/repositories/isv:/ownCloud:/desktop/Ubuntu_14.04/" \
> && wget -nv $URL/Release.key -O /tmp/Release.key \

[LINUX MINT] Install latest tmux

$ [sudo] apt-get update \
>   && [sudo] apt-get install \
>       -y python-software-properties software-properties-common \
>   && [sudo] add-apt-repository -y ppa:pi-rho/dev \
>   && [sudo] apt-get update \
>   && [sudo] apt-get install -y tmux-next