Skip to content

Instantly share code, notes, and snippets.

View dthphuong's full-sized avatar
🎯
Try my best for my startup

Phuong Duong dthphuong

🎯
Try my best for my startup
View GitHub Profile
@dthphuong
dthphuong / download.html
Last active March 15, 2021 14:41
Get OS platform
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico" type="image/x-icon">
<title>Memori - Connect with ease</title>
@dthphuong
dthphuong / install.sh
Created March 9, 2021 03:41
Install TesseractOCR 4.1.1 on CentOS
# ================Install Leptonca library================
# step 01
yum install -y zlib-devel libpng-devel openjpeg-devel libtiff-devel libwebp-devel libtool automake
#step 02
git clone https://github.com/DanBloomberg/leptonica
#step 03
cd leptonica
export CC=${CC:-gcc}
sh ./autogen.sh
@dthphuong
dthphuong / learn.md
Last active March 15, 2021 14:45
Kali cheatsheet

Useful url:

Scan Port and OS info

nmap -T4 -A -F <ip>
nmap -T4 -A -r <ip>
@dthphuong
dthphuong / REAME.md
Created November 18, 2020 03:23
Check DateTime Overlap
startA                        endA
  |------- DateRange A --------|                    _ 
  _                          |-----Date Range B ----|
                           startB                  endB

Idea: DateRangesOverlap = max(startA, startB) < min(endA, endB) Code:

@dthphuong
dthphuong / let-encrypt.md
Last active December 20, 2022 21:53
Setup SSL with Let's Encrypt on Ubuntu 18.04

Step 1 — Installing Certbot

sudo add-apt-repository ppa:certbot/certbot
sudo add-apt-repository universe
sudo apt update
sudo apt install certbot python3-certbot-apache

Step 2 — Set Up the SSL Certificate

@dthphuong
dthphuong / .ci3.gitlab-ci.yml
Last active October 20, 2020 04:44
CI/CD scripts
# Basic CodeIgniter 3.x project
stages:
- deploy
deploy:
stage: deploy
script:
- echo "Deploying . . ."
- whoami
- mkdir -p /var/www/homie/phuongduong/phuongmai-wedding

SOME NOTES ON SETTING UP GITLAB RUNNER TO BUILD ON LINUX/UBUNTU

STEP 1 - Install Gitlab Runner

sudo apt-get install -y curl
curl -L https://packages.gitlab.com/install/repositories/runner/gitlab-ci-multi-runner/script.deb.sh | sudo bash
sudo apt-get install -y gitlab-ci-multi-runner
@dthphuong
dthphuong / README.md
Created September 17, 2020 08:47
Setup SSL with Lets Encrypt

yum -y install epel-release yum -y install yum-utils yum -y install certbot-apache

certbot --apache -d domain.com

or certbot --apache

@dthphuong
dthphuong / script.md
Created September 16, 2020 04:23
Create a New User and Grant Permissions in MySQL
  1. Let’s start by making a new user within the MySQL shell:
mysql> CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';

Note: When adding users within the MySQL shell in this tutorial, we will specify the user’s host as localhost and not the server’s IP address. localhost is a hostname which means “this computer,” and MySQL treats this particular hostname specially: when a user with that host logs into MySQL it will attempt to connect to the local server by using a Unix socket file. Thus, localhost is typically used when you plan to connect by SSHing into your server or when you’re running the local mysql client to connect to the local MySQL server.

  1. GRANT PERMISSION
mysql&gt; GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
@dthphuong
dthphuong / apache2buddy.md
Created July 23, 2020 17:33
Apache2Buddy

The following tools would help you for measuring the performance of your server and test the MPM Settings values of your Apache.

Apache2Buddy is a great tool that checks your server setup and performance and makes a report and suggestions based on the information it collects. It calculates the MaxRequestWorkers on remaining RAM, not total installed RAM.

You can run Apache2Buddy by using the following command:

curl -sL https://raw.githubusercontent.com/richardforth/apache2buddy/master/apache2buddy.pl | perl