Skip to content

Instantly share code, notes, and snippets.

View liming2012usa's full-sized avatar

liming2012usa

View GitHub Profile
@liming2012usa
liming2012usa / OpenSourceCRM.rst
Created June 28, 2023 18:56 — forked from cstroe/OpenSourceCRM.rst
A distilled list of open-source CRM software
@liming2012usa
liming2012usa / .env
Created May 23, 2023 20:18 — forked from degitgitagitya/.env
Next JS + Next Auth + Keycloak + AutoRefreshToken
# KEYCLOAK BASE URL
KEYCLOAK_BASE_URL=
# KEYCLOAK CLIENT SECRET
KEYCLOAK_CLIENT_SECRET=
# KEYCLOAK CLIENT ID
KEYCLOAK_CLIENT_ID=
# BASE URL FOR NEXT AUTH
@liming2012usa
liming2012usa / elasticsearch.md
Created July 26, 2022 18:58 — forked from dominicsayers/elasticsearch.md
Configuring ElasticSearch to use less memory

What I actually did

/etc/security/limits.conf

elasticsearch hard memlock 100000

/etc/default/elasticsearch

@liming2012usa
liming2012usa / xtrabackup_full_increment_restore.sh
Created April 23, 2021 20:39 — forked from SQLadmin/xtrabackup_full_increment_restore.sh
Automate xtrabackup for FULL/Incremental and restore
#!/bin/bash
# This is my production backup script.
# https://sqlgossip.com
set -e
set -u
usage() {
echo "usage: $(basename $0) [option]"
echo "option=full: Perform Full Backup"
@liming2012usa
liming2012usa / cf-wp-cache-worker.js
Created April 19, 2021 19:36 — forked from KoolPal/cf-wp-cache-worker.js
Basic Cloudflare Worker that allows efficient page caching for Wordpress websites
// Version 1.4
const DAY_IN_SECONDS = 60*60*24;
const BLACKLISTED_URL_PARAMS = [
'fbclid', // Google Ads click Id
'gclid', // Facebook click Id
'msclkid', // Micorosft Ads Click Id
];
addEventListener('fetch', event => {
@liming2012usa
liming2012usa / cloudflare-worker-edge-cache.js
Created April 17, 2021 22:13 — forked from 2shrestha22/cloudflare-worker-edge-cache.js
Cloudflare workers script to enable edge-cache. Use Official cloudflare wordpress pulgin for auto cache purge management
// Stop CF edge from caching your site when specific wordpress cookies are present
// script found in https://www.mmaton.com/2018/07/02/cloudflare-cache-anonymous-requests/
addEventListener('fetch', event => {
event.respondWith(noCacheOnCookie(event.request))
})
async function noCacheOnCookie(request) {
// Determine which group this request is in.
const cookie = request.headers.get('Cookie')