Skip to content

Instantly share code, notes, and snippets.

@frankleng
frankleng / frpc.service
Created July 19, 2021 06:38 — forked from imyelo/frpc.service
run frp client as a service on windows and ubuntu / debian
# 1. put frpc and frpc.ini under /usr/local/frpc/
# 2. put this file (frpc.service) at /etc/systemd/system
# 3. run `sudo systemctl daemon-reload && sudo systemctl enable frpc && sudo systemctl start frpc`
# Then we can manage frpc with `sudo service frpc {start|stop|restart|status}`
# See also: https://nosame.net/use-frp-to-reverse-proxy-your-nas/
# Alternative for server:
# - Offical: https://github.com/fatedier/frp/blob/a4cfab6/conf/systemd/frpc%40.service
[Unit]
@frankleng
frankleng / dns-sync.sh
Created June 10, 2019 05:36 — forked from matthiassb/dns-sync.sh
Init.d script for keeping WSL resolv.conf in-sync with Windows
#! /bin/bash
### BEGIN INIT INFO
# Provides: dns-sync
# Required-Start:
# Required-Stop:
# Default-Start: S
# Default-Stop:
# Short-Description: Synchronizes /etc/resolv.conf in WLS with Windows DNS - Matthias Brooks
### END INIT INFO
@frankleng
frankleng / Syns2Syms.java
Created June 29, 2018 09:59 — forked from bradfordcp/Syns2Syms.java
Converts a WordNet prolog file into a flat file useful for Solr synonym matching.
/**
* Based off of the Lucene prolog parser in the wordnet contrib package within the
* main Lucene project. It has been modified to remove the Lucene bits and generate
* a synonyms.txt file suitable for consumption by Solr. The idea was mentioned in
* a sidebar of the book Solr 1.4 Enterprise Search Server by Eric Pugh.
*
* @see <a href="http://lucene.apache.org/java/2_3_2/lucene-sandbox/index.html#WordNet/Synonyms">Lucene Sandbox WordNet page</a>
* @see <a href="http://svn.apache.org/repos/asf/lucene/dev/trunk/lucene/contrib/wordnet/">SVN Repository of the WordNet contrib</a>
* @see <a href="https://www.packtpub.com/solr-1-4-enterprise-search-server/book">Solr 1.4 Enterprise Search Server Book</a>
*/
@frankleng
frankleng / webpack.dev.config.json
Last active July 26, 2017 22:19
Generate webpack dev config
{
"target":"web",
"node":{
"__dirname":true,
"__filename":true
},
"externals":[
],
"devtool":"source-map",

Multiple MySQL Versions with Homebrew

For homebrew version 0.9.5.

brew -v # => Homebrew 0.9.5

Install the current version of mysql.

# Install current mysql version

brew install mysql

@frankleng
frankleng / RHLclient.js
Last active August 1, 2016 19:05
Avoid RR warning in RHL 3.0
const createRoutes = require('../routes/root').default;
const routes = createRoutes(store);
const render = () => {
const { pathname, search, hash } = window.location;
return match({ routes, location: `${pathname}${search}${hash}` }, () => {
ReactDOM.render(
<AppContainer>
<Provider store={store}>
<Router
@frankleng
frankleng / dockerhost.sh
Created July 20, 2016 23:41 — forked from dimitrovs/dockerhost.sh
Add the IP of a dockerhost to the /etc/hosts file of a Docker container if not already there.
#!/bin/bash
if [[ -z $(grep dockerhost /etc/hosts) ]]
then
echo `/sbin/ip route|awk '/default/ { print $3 }'` dockerhost >> /etc/hosts
fi

Keybase proof

I hereby claim:

  • I am frankleng on github.
  • I am frankleng (https://keybase.io/frankleng) on keybase.
  • I have a public key whose fingerprint is 4093 E984 3A41 00D2 4D54 EA07 155B 6DAC CD26 A5C2

To claim this, I am signing this object: