Skip to content

Instantly share code, notes, and snippets.

Avatar

lifehome lifehome

  • Hong Kong
View GitHub Profile
@lifehome
lifehome / https-fpm.incl
Last active Aug 17, 2019
Default NGINX Configurations
View https-fpm.incl
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_param HTTPS true;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
@lifehome
lifehome / README.md
Last active Sep 20, 2020 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
View README.md

Cloudflare DDNS bash client with systemd

This is a bash script to act as a Cloudflare DDNS client, useful replacement for ddclient.

Look out!

A newer version is available!

This gist will no longer update, instead please go to https://github.com/lifehome/systemd-cfddns for more updated versions.

How to use?

  1. Put the cfupdater files to /usr/local/bin
  • If you are using IPv4 for A record, append -v4 to cfupdater in the following systemd service unit.
View jumboapi.js
const fs = require('fs'),
maths = require('mathjs'),
restify = require('restify'),
rp = require('request-promise'),
cheerio = require('cheerio'),
cheerioTableparser = require('cheerio-tableparser')
server = restify.createServer({
name: 'wrench-jumbo',
version: '1.0.1'
}),
@lifehome
lifehome / station.json
Last active Jul 29, 2017
MTR Stations listing
View station.json
{
"HUH": {
"vid": "000",
"en_name": "Hung Hom",
"zh_name": "紅磡"
},
"MKK": {
"vid": "001",
"en_name": "Mong Kok East",
"zh_name": "旺角東"
@lifehome
lifehome / Probability-v4.js
Last active Oct 23, 2016
ES2015 written script, use with caution.
View Probability-v4.js
/* NOTICE: This file is written in ES2015.
* Please use the --harmony flag for nodejs environment.
*
* License: CC BY-SA 4.0 by Ivan Ip<m@lifeho.me>
*/
var iconv = require('iconv-lite'),
request = require('request'),
cheerio = require('cheerio'),
cheerioTableparser = require('cheerio-tableparser'),
@lifehome
lifehome / webhook.gs
Created Aug 24, 2016
Google Forms + Webhook : JSON example
View webhook.gs
function onFormSubmit(e) {
var data = {
"form": {
"id": e.source.getId(),
"title": e.source.getTitle() ? e.source.getTitle() : "Untitled Form",
"is_private": e.source.requiresLogin(),
"is_published": e.source.isAcceptingResponses(),
},
"response": {
"id": e.response.getId(),
View keybase.md

Keybase proof

I hereby claim:

  • I am lifehome on github.
  • I am lifehome (https://keybase.io/lifehome) on keybase.
  • I have a public key whose fingerprint is 8248 46E2 166F 8EEE DB94 301B CD6B 42C3 56D7 BEF6

To claim this, I am signing this object:

View gist:aaed76348a92579d9af7
避難所、物資站及救護站更新
https://docs.google.com/document/d/1YepRdBZKcGNjUC6QcopmG7_jpaOucxbGxlQJOwI7BxM/pub
Latest list:
http://appsrv.cse.cuhk.edu.hk/~acmprog/
Latest data please read this map: https://www.google.com/maps/d/u/0/embed?mid=zIh97OmUhBNA.kGMqBtuPdCO4
各區物資需求表︰
https://docs.google.com/spreadsheets/d/1psp1mPDWoT29KAcjuBrbywNumUvBEPNJG5tuUjJ8uaQ/pubhtml
You can’t perform that action at this time.