Skip to content

Instantly share code, notes, and snippets.

View terrychan999's full-sized avatar

Terry Chan terrychan999

View GitHub Profile
import bme280
import time
import requests
import json
import datetime
firebase_url = 'https:/change_your_project_name.firebaseio.com/'
while True:
temperature,pressure,humidity = bme280.readBME280All()
@terrychan999
terrychan999 / default
Created January 30, 2021 12:17
Nginx Certbot PHP-fpm example
server {
root /var/www/html;
# Add index.php to the list if you are using PHP
index index.php;
server_name example.com; # managed by Certbot
autoindex off;
error_log /var/log/nginx/example_error.log;
@terrychan999
terrychan999 / source.list
Last active April 11, 2022 05:05
Ubuntu 20.04 best apt mirror for Taiwan users
deb http://free.nchc.org.tw/ubuntu/ focal main restricted universe multiverse
deb http://free.nchc.org.tw/ubuntu/ focal-updates main restricted universe multiverse
deb http://free.nchc.org.tw/ubuntu/ focal-security main restricted universe multiverse
deb http://free.nchc.org.tw/ubuntu/ focal-backports main restricted universe multiverse
@terrychan999
terrychan999 / font.css
Last active April 26, 2021 14:38
CSS font size using relative unit
html {
font-size: 16px;
}
html * {
font-size: 1rem;
}
h1 {
font-size: 2rem;
@terrychan999
terrychan999 / wordpress_lnmp.md
Last active March 29, 2024 01:28
Wordpress LNMP/LEMP 環境建置

Wordpress LNMP/LEMP 環境建置

Create by @terrychan999 on 2021-Apr-30, feel free to share :)

  1. Linux ENV: Ubuntu 20.04 Server

    此教學僅在Ubuntu 20.04測試過

  2. 更新apt套件庫
    sudo apt update && sudo apt upgrade

@terrychan999
terrychan999 / functions.php
Last active July 30, 2021 07:42
disable wp-embed and wp-emoji
<?php
// Disable wp-embed
function disable_embed_feature(){
wp_deregister_script( 'wp-embed' );
}
add_action('wp_footer', 'disable_embed_feature');
// Disable wp-emoji
function disable_emoji_feature()
@terrychan999
terrychan999 / centos6 glibc217.txt
Created April 11, 2024 05:45
centos6 glibc217
mkdir glibc217
cd glibc217
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-utils-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-static-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-common-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-devel-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/glibc-headers-2.17-55.el6.x86_64.rpm
wget http://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/glibc-2.17-55.fc20/nscd-2.17-55.el6.x86_64.rpm