Skip to content

Instantly share code, notes, and snippets.

View eon01's full-sized avatar
🎯
Focusing

Aymen EL Amri eon01

🎯
Focusing
View GitHub Profile
@eon01
eon01 / docker-destroy-all.sh
Last active June 7, 2017 15:44 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Destroy everything
# https://www.youtube.com/watch?v=DBwgX8yBqsw
#
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@eon01
eon01 / php7-fpm + nginx
Created July 6, 2017 21:31
Nginx configuration with php7-fpm
server {
listen 8000 default_server;
listen [::]:8000 default_server;
# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
@eon01
eon01 / httrack mirroring with near flag
Created August 5, 2017 18:15
httrack mirroring with near flag
# near: get non-html files 'near' an html file (ex: an image located outside) (--near)
httrack --near -%v -z -%k -%B -B -u2 -%u -O ./. 'http://blog.eon01.com'
@eon01
eon01 / install virtualenv ubuntu 16.04.md
Created July 31, 2018 20:55 — forked from Geoyi/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@eon01
eon01 / auto sync S3 bucket on file change
Last active February 14, 2019 20:44
This gist helps you to auto synchronize a local folder with an S3 bucket as soon as 1 or more files in the folder change. Helpful for live debugging when developping.
1) Install inotifywait
sudo apt install inotifywait
2) Use inotifywait to sync your folders to S3
s3folder = "<your_s3_fodler_path>"
s3bucket = "s3://<your_s3_bucket_name>"
while inotifywait $s3folder; do aws s3 sync $s3folder $s3bucket --delete; done
ffmpeg -i <video.mp4|flv> -vf scale=640:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - gif:- | convert -layers Optimize - <output.gif>
apt install python3-pip
pip3 install --upgrade pip
pip3 install virtualenvwrapper
mkdir $HOME/PYTHON_ENV
export WORKON_HOME=$HOME/PYTHON_ENVS
source /usr/local/bin/virtualenvwrapper.sh
mkvirtualenv --python=$(which python3) $1
@eon01
eon01 / gist:6f175a55baa64f0207174cc02d2f9a41
Created July 31, 2019 12:06 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@eon01
eon01 / reltime.py
Created August 2, 2019 09:47 — forked from deontologician/reltime.py
Relative datetimes in python
def reltime(date, compare_to=None, at='@'):
r'''Takes a datetime and returns a relative representation of the
time.
:param date: The date to render relatively
:param compare_to: what to compare the date to. Defaults to datetime.now()
:param at: date/time separator. defaults to "@". "at" is also reasonable.
>>> from datetime import datetime, timedelta
>>> today = datetime(2050, 9, 2, 15, 00)
>>> earlier = datetime(2050, 9, 2, 12)
@eon01
eon01 / meta-tags.md
Created August 8, 2019 11:47 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">