Skip to content

Instantly share code, notes, and snippets.

View dungdt88's full-sized avatar

Richard Dam dungdt88

  • Ho Chi Minh City, Vietnam
View GitHub Profile
@dungdt88
dungdt88 / Python-Cheatsheets.md
Last active October 30, 2019 05:20
Python Cheatsheets

Install Python 3.7 on Ubuntu

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y virtualenv python3.7 python3.7-dev

Python - MySQL Connector

@dungdt88
dungdt88 / aws-ec2-cloud-init-users.md
Created June 12, 2020 07:39
AWS EC2 Cloud Init - Used when you lost key to ssh to your EC2 instance

Add this to your instance user data. You need to stop the instance before set this.

Content-Type: multipart/mixed; boundary="//"
MIME-Version: 1.0

--//
Content-Type: text/cloud-config; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
@dungdt88
dungdt88 / urrl-regex-pattern.py
Last active July 23, 2020 09:18
Python URL regex pattern
URL_PATTERN = (
r'(?i)('
r'(?:(?:(?:https?|ftp):)?//)'
r'(?:\S+(?::\S*)?@)?'
r'(?:'
r'(?!(?:10|127)(?:\.\d{1,3}){3})'
r'(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})'
r'(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})'
r'(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])'
r'(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}'
@dungdt88
dungdt88 / xlmsec-mac-issue.md
Created December 6, 2023 03:59
Solve issue with xmlsec installation in Mac