Skip to content

Instantly share code, notes, and snippets.

View tranphuquy19's full-sized avatar
🐢
Doraneko

Doraneko tranphuquy19

🐢
Doraneko
View GitHub Profile
# Put this file in /etc/nginx/sites-available
# Then "ln -s /etc/nginx/sites-available/aria2-nginx.conf /etc/nginx/sites-enabled"
# Then "sudo service nginx restart"
server {
listen 80;
listen [::]:80;
root /var/www/aria2; # Put your aria2 web ui here, such as AriaNg
index index.html;
server_name DOMAIN_NAME;
location / {
@tranphuquy19
tranphuquy19 / colors.md
Created September 18, 2020 14:24 — forked from 0x263b/colors.md
Random color from string in javascript

Random color from string in javascript

Consider a list of strings you need to permanently assign a random color.

First you should turn the string into a hash.

var string = "string"
var hash = 0
@tranphuquy19
tranphuquy19 / install_anaconda.md
Created October 21, 2020 08:54 — forked from kauffmanes/install_anaconda.md
Install Anaconda on Windows Subsystem for Linux (WSL)

Note: $ denotes the start of a command. Don't actually type this.

Edit: This article is also on my blog: https://www.emilykauffman.com/teaching/install-anaconda-on-wsl

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_65.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose Anaconda3-5.2.0-Linux-x86_64.sh.
  4. From the terminal run wget https://repo.continuum.io/archive/[YOUR VERSION]. Example: $ wget https://repo.continuum.io/archive/Anaconda3-5.2.0-Linux-x86_64.sh
  5. Run the installatio
yum install -y wget unzip
wget -O k8s-cli-1.0.0.zip https://github.com/tranphuquy19/k8s-cli/archive/1.0.0.zip
unzip k8s-cli-1.0.0.zip
chmod 755 -R ~/k8s-cli-1.0.0/
mkdir -p ~/bin/
mv -v ~/k8s-cli-1.0.0/* ~/bin/
echo 'export PATH=$PATH:$HOME/bin' >> ~/.bashrc
@tranphuquy19
tranphuquy19 / install-docker-k8s.sh
Created April 14, 2021 02:19
Install kubernetes with docker container runtime
#!/bin/bash
# Cập nhật 12/2019
# Cai dat Docker
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum update -y && yum install docker-ce-18.06.2.ce -y
usermod -aG docker $(whoami)
@tranphuquy19
tranphuquy19 / main.go
Created April 14, 2021 13:21
GoLang-Run-Forever
package main
import (
"fmt"
"time"
"github.com/go-co-op/gocron"
)
var task = func() {
@tranphuquy19
tranphuquy19 / install_kubeadm.sh
Last active April 20, 2021 10:02
Install KubeADM
#!/usr/bin/env bash
# Set hostname
hostnamectl set-hostname master # for master node
# ================================================================
# Install Docker
# ================================================================
# CentOS/RHEL
@tranphuquy19
tranphuquy19 / ubuntu-setup.sh
Last active May 23, 2021 13:10
Ubuntu scripts
#!/bin/bash
set -e
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
@tranphuquy19
tranphuquy19 / dart_flutter_why_not.md
Created June 30, 2021 00:53 — forked from coder7eeN/dart_flutter_why_not.md
Dart và Flutter, tại sao không?

Part 1. Mọi thứ đều bắt đầu từ những thứ cơ bản nhất

Khi nhắc đến việc làm sao để tạo ra 1 ứng dụng mobile thì thứ mọi người sẽ lặp tức nghĩ ngay đến là native app (Android và iOS), nhưng bên cạnh đó vẫn còn rất nhiều công nghệ có thể giúp bạn tạo ra 1 ứng dụng mobile như Cordova, Webview (WeChat), Ionic, Xamarin và React Native. Tất cả các framework, platform đó đều hổ trợ người dùng tạo ra được 1 ứng dụng mobile theo ý muốn của mình. Và để không bỏ lỡ cuộc vui thì Google cũng đã mang đến cho người dùng đứa con mới nhất của mình - Flutter - nó kế thừa cũng như nổi bật hơn các công nghệ hybrid app kia. Vậy thì làm sao để có thể sử dụng, có thể tạo ra được những sản phẩm theo ý muốn của mình? Bài viết với những kiến thức của bản thân mình sẽ đem đến cho bạn có được 1 số kiến thức cơ bản nhất để có thể tự mình "chiến" và "khám phá" Flutter.

Dart Language

Bao giờ cũng vậy, bạn muốn "chiến" hoặc "chỉ học để biết" 1 library, 1 framework, 1 platform thì ngôn ngữ (language) sử dụng để build

@tranphuquy19
tranphuquy19 / install_php71_opensuse.sh
Last active July 30, 2021 11:19 — forked from jniltinho/install_php71_opensuse.sh
Install PHP 7.4 on OpenSUSE
#!/bin/bash
### Install PHP 7.4 on OPenSUSE 42.2 64Bits
### https://build.opensuse.org/package/view_file/devel:languages:php/php7/php7.spec?expand=1
### https://www.howtoforge.com/tutorial/how-to-install-php-7-on-debian/
### http://www.shaunfreeman.name/compiling-php-7-on-centos/
zypper in openssl-devel
zypper in gcc gcc-c++ libxml2-devel pkgconfig libbz2-devel curl-devel libwebp-devel