Skip to content

Instantly share code, notes, and snippets.

View eon01's full-sized avatar
🎯
Focusing

Aymen EL Amri eon01

🎯
Focusing
View GitHub Profile
(?:http://(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?)\.
)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?:\d+)(?:\.(?:\d+)
){3}))(?::(?:\d+))?)(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F
\d]{2}))|[;:@&=])*)(?:/(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=])*))*)(?:\?(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-fA-F\d]{
2}))|[;:@&=])*))?)?)|(?:ftp://(?:(?:(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?
:%[a-fA-F\d]{2}))|[;?&=])*)(?::(?:(?:(?:[a-zA-Z\d$\-_.+!*'(),]|(?:%[a-
fA-F\d]{2}))|[;?&=])*))?@)?(?:(?:(?:(?:(?:[a-zA-Z\d](?:(?:[a-zA-Z\d]|-
)*[a-zA-Z\d])?)\.)*(?:[a-zA-Z](?:(?:[a-zA-Z\d]|-)*[a-zA-Z\d])?))|(?:(?
:\d+)(?:\.(?:\d+)){3}))(?::(?:\d+))?))(?:/(?:(?:(?:(?:[a-zA-Z\d$\-_.+!
@eon01
eon01 / nginx_basics.md
Created April 17, 2016 11:08 — forked from leommoore/nginx_basics.md
Nginx Basics

#Nginx Basics for Ubuntu

Please see http://wiki.nginx.org/Main for more information. See http://arstechnica.com/gadgets/2012/11/how-to-set-up-a-safe-and-secure-web-server/ for a tutorial on how to install Nginx.

##Installation To install, you can install the version which is in the standard Ubuntu repositories but it is normally quite old and will not have the latest security patches. The best way is to update the repositories first:

apt-get update
apt-get install python-software-properties

apt-get upgrade

@eon01
eon01 / DockerAndDockerComposeUbuntu14.04
Last active July 20, 2016 08:15
Docker + Docker Compose on Ubuntu 14.04
#Root
sudo su
#Install Docker
apt-get update
apt-get install -y apt-transport-https ca-certificates
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | tee -a /etc/apt/sources.list.d/docker.list
apt-get update
apt-get install -y linux-image-extra-$(uname -r)
@eon01
eon01 / Install And Configure awscli on Ubuntu
Last active August 2, 2016 08:48
Install And Configure awscli on Ubuntu
sudo apt-get install -y python-pip
sudo pip install awscli
aws configure
@eon01
eon01 / configure_docker0.sh
Last active September 17, 2020 01:06 — forked from kamermans/configure_docker0.sh
Change the IP subnet of Docker's docker0 interface
# Example1: configure_docker0.sh 192.168.10.1/16
# Example1: configure_docker0.sh 192.168.11.1/16
#
# PLEASE READ:
# - Make sure you replace "192.168.10.0/16" with the network that you want to use
# - Make sure you are using Debian/Ubuntu
# - This script must be run with your root user
# - Docker must be stopped
# - IP change will occur after starting Docker
#
@eon01
eon01 / gist:9bb0ad98fbfc2e9cf53df1c363078465
Created March 14, 2017 22:14
Installing MariaDB for OpenStack (Clone from: OpenStack Cloud Computing Cookbook)
#!/bin/bash
# controller.sh
# Authors: Kevin Jackson ([email protected])
# Cody Bunch ([email protected])
# Egle Sigler ([email protected])
# Vagrant scripts used by the OpenStack Cloud Computing Cookbook, 3rd Edition
# Website: http://www.openstackcookbook.com/
@eon01
eon01 / Wordpress + Docker Swarm + Docker Compose V3 + RDS
Created March 18, 2017 23:51
Wordpress + Docker Swarm + Docker Compose V3 + RDS
version: '3'
networks:
wordpress_network:
#volumes:
# fs-xxxxx:
# driver: rexray or efs
# driver_opts:
# share: "fs-xxxxx"
@eon01
eon01 / github_flask_oauth2.py
Created April 5, 2017 20:55 — forked from ib-lundgren/github_flask_oauth2.py
Example of how to use Flask with requests-oauthlib to fetch a GitHub user profile using an OAuth 2 token.
from requests_oauthlib import OAuth2Session
from flask import Flask, request, redirect, session, url_for
from flask.json import jsonify
import os
app = Flask(__name__)
# This information is obtained upon registration of a new GitHub
client_id = "<your client key>"
@eon01
eon01 / Install_React_Native_Android_on_Ubuntu.md
Last active December 19, 2022 10:58 — forked from ShirajG/Install_React_Native_Android_on_Ubuntu.md
Steps for getting a working Linux install for React Native Android

Installing React Native Android on Ubuntu

Here are the steps for getting a working Linux install for React Native:

  1. Install Java SDK
  1. Install KVM
    • sudo apt-get install qemu-kvm libvirt-bin bridge-utils virt-manager
    • sudo adduser $USER libvirtd
@eon01
eon01 / js_redirect_android_ios.js
Last active June 7, 2017 14:38
Redirect static website according to the User Agent (Android, iOS)
<script type="text/javascript">
var u = navigator.userAgent
if( /iPhone/i.test(u) ) {
//window.location = "http://www.apple.com";
}
else if (/android/i.test(u)) {
//window.location = "http://www.google.com";
}
</script>