Skip to content

Instantly share code, notes, and snippets.

View peter279k's full-sized avatar
🎯
Focusing

Chun-Sheng, Li peter279k

🎯
Focusing
View GitHub Profile
@peter279k
peter279k / upgrade_apache.sh
Created June 27, 2020 19:27
This is about upgrading Apache server on Ubuntu 16.04 and Ubuntu 18.04
#!/bin/bash
# References:
# https://www.mysterydata.com/update-apache-2-4-to-latest-version-on-ubuntu-16-04-server-vestacp/
sudo_prefix="sudo "
if [[ ${USER} == "root" ]]; then
sudo_prefix=""
else
@peter279k
peter279k / fix_ubuntu_meta_release.sh
Last active June 27, 2020 18:40
This is about how to fix "failed-to-connect-to-http-changelogs-ubuntu-com-meta-release"
#!/bin/bash
# References
# https://www.cnblogs.com/xsjzhao/p/11001541.html
# https://askubuntu.com/questions/919441/failed-to-connect-to-http-changelogs-ubuntu-com-meta-release
# https://ubuntuforums.org/showthread.php?t=2391641
# It causes because of temporary network issue.
# The resolved solution is as follows:
@peter279k
peter279k / nginx-default
Last active December 15, 2020 11:38
The customized Packaggist mirror installer
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@peter279k
peter279k / LINE-Chrome-Extension-Guideline.md
Last active July 11, 2020 03:05
This is a LINE Chrome Extension guideline
@peter279k
peter279k / LINE-API-Guideline.md
Last active June 20, 2020 06:26
This is about overview of LINE API guideline

LINE Login

LINE Login Image

LINE Login Flow

LINE Login Flow

The LINE Login process for web (web login) is based on the OAuth 2.0 authorization code grant flow and the OpenID Connect protocol. Your application must be able to make requests server-side and receive data from the LINE Platform. The following is an overview of the web login flow.

@peter279k
peter279k / google_chrome_installer.sh
Last active December 28, 2020 06:41
Install Google Chrome on Ubuntu 18.04/16.04/20.04
#!/bin/bash
sudo_prefix=""
if [[ $UID != 0 ]]; then
sudo_prefix="sudo "
fi;
# References: https://www.linuxbabe.com/ubuntu/install-google-chrome-ubuntu-18-04-lts
@peter279k
peter279k / docker_installer.sh
Last active December 7, 2023 12:13
This is a Docker (docker-ce) installation for Ubuntu 16.04 and Ubuntu 18.04
#!/bin/bash
# This bash script is referenced by https://www.hostinger.com/tutorials/how-to-install-docker-on-ubuntu
# Reference: https://docs.docker.com/engine/install/ubuntu/
echo 'Check your Linux Distribution....'
which lsb_release > /dev/null 2>&1
if [[ $? != 0 ]]; then
@peter279k
peter279k / Dockerfile
Last active June 15, 2020 04:19
This is cURL with SFTP feature on Dockerfile
# Reference: https://askubuntu.com/questions/195545/how-to-enable-sftp-support-in-curl
FROM ubuntu:18.04
ENV CPPFLAGS=-I/usr/local/include
ENV LDFLAGS="-L/usr/local/lib -Wl,-rpath,/usr/local/lib"
ENV LIBS="-ldl"
RUN sed -i -e "s/# deb-src /deb-src /g" /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y build-essential debhelper libssh-dev
@peter279k
peter279k / Instagram-API.md
Last active June 12, 2020 14:36
This is an Instagram API doc reference with organized stuffs.

Legacy API Platform

March 30, 2020 Update: We understand these are challenging times for our developer community, so we are postponing disabling the Instagram > Legacy API Platform by 90 days to June 29, 2020. Remaining endpoints on the Legacy API will no longer be available after this date and your app's users may lose functionality.

Instagram Graph API (Only for business process usage)

@yanqd0
yanqd0 / dl_requests_tqdm.py
Last active April 30, 2024 11:23
Python requests download file with a tqdm progress bar
import requests
from tqdm import tqdm
def download(url: str, fname: str, chunk_size=1024):
resp = requests.get(url, stream=True)
total = int(resp.headers.get('content-length', 0))
with open(fname, 'wb') as file, tqdm(
desc=fname,
total=total,