Skip to content

Instantly share code, notes, and snippets.

@dishuostec
dishuostec / Dockerfile
Created September 26, 2023 01:45
A container of Openvpn to shadowsocks adapter.
FROM shadowsocks/shadowsocks-libev:latest
USER root
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
ENV DNS_ADDRS=
# ---------- openvpn ----------
ENV OPENVPN_CFG=client.ovpn
RUN set -x \
&& apk add --update --no-cache openvpn
@dishuostec
dishuostec / ObjectType.d.ts
Last active March 31, 2022 05:43
Typescript utility types
/**
* ObjectKeys
* @desc Extract name from type or class
* @param T type to analyze
* @param MatchType type to keep. Default is any - all types be included
* @param Reverse reverse match. Default is false
* @example
* class SimpleClass {
* static ZERO = 0;
* readonly one: string = '1';
@dishuostec
dishuostec / 词性标记.md
Created January 26, 2021 07:04 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词

nr 人名

@dishuostec
dishuostec / list.txt
Created February 13, 2020 02:20
split config file
[foo]
foo 1
foo 2
[bar]
bar 1
bar 2
@dishuostec
dishuostec / nanoeventsplus.js
Last active September 4, 2019 09:56
Simple and tiny event emitter library for JavaScript, support wildcard event name.
/*
fork from https://github.com/ai/nanoevents
changes:
- support listening wildcard event name
- return handler result, use Promise.all() to wait task done.
*/
(
/**
* Interface for event subscription.
@dishuostec
dishuostec / cloudflare-update-record.sh
Last active June 7, 2019 04:55 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@dishuostec
dishuostec / deploy_wildcards.sh
Last active December 8, 2020 19:43
synology dsm 6.2 deploy wildcard certs
#!/bin/bash
WORKING_DIR=/usr/syno/etc/certificate
ARCHIVE_DIR=${WORKING_DIR}/_archive
INFO=`cat ${ARCHIVE_DIR}/INFO`
KEYS=`echo $INFO | jq -r 'keys_unsorted|.[]'`
for key in ${KEYS}; do
SERVICES=`echo $INFO | jq -r --arg key ${key} '.[$key].services | .[] | [.subscriber, .service] | join("/")'`
@dishuostec
dishuostec / gist:e1df506515a72478a3351225e6d0b915
Created July 26, 2018 09:43
docker for windows. mount docker.sock to container
set COMPOSE_CONVERT_WINDOWS_PATHS=1
@dishuostec
dishuostec / docker-compose.yml
Created June 27, 2018 01:53
xdebug on docker for windows
version: '2'
php:
image: ...
environment:
XDEBUG_CONFIG: remote_connect_back=0 remote_host=docker.for.win.localhost
PHP_IDE_CONFIG: serverName=SERVER_NAME
@dishuostec
dishuostec / ddns.sh
Created February 24, 2018 06:26
pure shell dnspod ddns client
#!/bin/sh
HOST=https://dnsapi.cn
USERAGENT='DNSPOD DDNS Client/1.0.0 (dishuostec@gmail.com)'
if [ -n "$(which wget)" ];then
CMD=wget
fi
if [ -n "$(which curl)" ];then
CMD=curl
fi