Skip to content

Instantly share code, notes, and snippets.

View maiernte's full-sized avatar

Yongfeng Mai maiernte

View GitHub Profile
# Example config file /etc/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
@maiernte
maiernte / summary.html
Created May 12, 2020 06:50
Gitbook 中修改菜单栏的注脚
{% macro articles(_articles) %}
{% for article in _articles %}
<li class="chapter {% if article.path == file.path and not article.anchor %}active{% endif %}" data-level="{{ article.level }}" {% if article.path %}data-path="{{ article.path|resolveFile }}"{% endif %}>
{% if article.path and getPageByPath(article.path) %}
<a href="{{ article.path|resolveFile }}{{ article.anchor }}">
{% elif article.url %}
<a target="_blank" href="{{ article.url }}">
{% else %}
<span>
{% endif %}
@maiernte
maiernte / alifun.js
Created September 17, 2019 18:45
阿里函数计算访问坚果云
var getRawBody = require('raw-body');
var getFormBody = require('body/form');
var body = require('body');
const http = require('https')
module.exports.handler = function(req, resp, context) {
console.log('hello world');
var params = {
path: req.path,
!function u(i,a,l){function f(r,e){if(!a[r]){if(!i[r]){var n="function"==typeof require&&require;if(!e&&n)return n(r,!0);if(c)return c(r,!0);var t=new Error("Cannot find module '"+r+"'");throw t.code="MODULE_NOT_FOUND",t}var o=a[r]={exports:{}};i[r][0].call(o.exports,function(e){return f(i[r][1][e]||e)},o,o.exports,u,i,a,l)}return a[r].exports}for(var c="function"==typeof require&&require,e=0;e<l.length;e++)f(l[e]);return f}({1:[function(e,r,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t=e("./libs/lunar");n.sayHello=function(e){return console.log(t),"Hallo von "+e+", "+t.Lunar.Gan}},{"./libs/lunar":2}],2:[function(e,r,n){Lunar={Gan:"Yongfeng",sayHallo:function(){return"i am Lunar"}},n.Lunar=Lunar},{}],3:[function(e,r,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var t,o,u=e("./greet");t="greeting",o="TypeScript",document.getElementById(t).innerText=u.sayHello(o)},{"./greet":1}]},{},[3]);
//# sourceMappingURL=bundle.js.map
@maiernte
maiernte / typora_windows_conf.user.json
Created August 6, 2019 07:19
Typora Windows 版的用户设置文件模板
/** For advanced users. */
{
"defaultFontFamily": {
"standard": null, //String - Defaults to "Times New Roman".
"serif": null, // String - Defaults to "Times New Roman".
"sansSerif": null, // String - Defaults to "Arial".
"monospace": null // String - Defaults to "Courier New".
},
"autoHideMenuBar": false, //Boolean - Auto hide the menu bar unless the `Alt` key is pressed. Default is false.
# 安装Caddy:
wget -N --no-check-certificate https://softs.fun/Bash/caddy_install.sh && chmod +x caddy_install.sh && bash caddy_install.sh install http.filemanager
# 配置Caddy:
mkdir -p /usr/local/caddy/www/file
echo ":80 {
root /usr/local/caddy/www/file
timeouts none
gzip
filemanager / /usr/local/caddy/www/file {
database /usr/local/caddy/filemanager.db
@maiernte
maiernte / validateTags.sh
Last active August 2, 2019 20:02
纯用shell命令校对分类和标签
#!bin/bash
# 读取头文件
parse_yaml(){
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
# 1,10s 表示只看前10行。
sed -ne "1,10s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "1,10s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
#!/bin/bash
# -r 递归搜索子目录
# -l 只显示文件
# -n 显示文件和匹配的行
read -p "Such nach Ordner (B. /D/TempDatei/): " directory
read -p "Such nach Begrif: " begrif
read -p "Befehle Arguments: " args
@maiernte
maiernte / checkMDCategories.js
Created July 28, 2019 16:15
检验分目录存储的.md文件,判断其内容里的分类是否与物理目录相同。
var fs = require('fs'),
path = require('path');
const lineReader = require('line-reader');
var startPath = '';
var doCorrect = false;
var hasInvalidedCategories = false;
/**
@maiernte
maiernte / shell-travel
Last active July 26, 2019 08:47
历遍目录内文件
# Commit
echo "请输入要查找的目录:"
# 等待用户输入, “D:\\Aufgaben”
read dir
# 当用户输入的时候,[ -z $dir ] 会报错
if [ -z "$dir" ];
then
# $dir 是空字符串。