Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
set -e
echo "请输入 cron 表达式(如:0 2 * * *):"
read CRON_EXPR
echo "请输入要定时执行的命令(如:./cfst_hosts.sh 或 /opt/CloudflareST/cfst_hosts.sh):"
read RUN_CMD
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
# --------------------------------------------------------------
# 项目: CloudflareSpeedTest 自动更新 Hosts
# 版本: 1.0.4
# 作者: XIU2
# 项目: https://github.com/XIU2/CloudflareSpeedTest
# --------------------------------------------------------------
#!/bin/bash
set -e
INSTALL_DIR="/opt/mosdns"
BIN_PATH="$INSTALL_DIR/mosdns"
CONFIG_PATH="$INSTALL_DIR/config.yaml"
VERSION="v4.5.3"
SERVICE_NAME="mosdns"
SCRIPT_PATH="$(readlink -f "$0" 2>/dev/null || realpath "$0" 2>/dev/null || echo "$0")"
# 日志
log:
level: info # 日志级别,可选 debug 、 info 、 warn 、 error 。默认 info
file: "/tmp/mosdns.log" # 留空代表不输出日志
# 服务器
servers:
- exec: main_sequence # 本服务器运行插件的 tag
listeners:
@lockcp
lockcp / readme.md
Created December 23, 2023 06:38 — forked from firexcy/readme.md
DIY a Rewind.ai

This Gist provides a solution to periodically capture screenshots of your Mac, and create therefrom a searchable PDF archive so that you can always get an answer to the “what, when, and where” questions about your usages.

To use these scripts:

  1. Download the shell script rewind, then:
    1. put it under ~/bin (or other fixed path you prefer);
    2. execute
#/bin/bash
# Ubuntu20 桌面环境配置(arm兼容)
# 2021 flyqie
# 遇到错误马上退出,避免出现其他问题
set -e
# ...
set -x
# Xrdp
@lockcp
lockcp / tabsoutlinerdupes.js
Created July 30, 2022 19:10 — forked from Luckz/tabsoutlinerdupes.js
Tabs Outliner: kill duplicate windows
// ctrl - shift - J on Tabs Outliner to open dev tools,
// then Sources -> Snippets -> New Snippet.
// Rightclick -> Run to execute.
// cyrb53 stolen from https://stackoverflow.com/a/52171480
const cyrb53 = function(str, seed = 0) {
let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed;
for (let i = 0, ch; i < str.length; i++) {
ch = str.charCodeAt(i);
h1 = Math.imul(h1 ^ ch, 2654435761);
@lockcp
lockcp / Sudoku.shell
Created May 15, 2022 09:53 — forked from JimmyLv/Sudoku.shell
roam/templates Sudoku
- General Sudoku [[九宫格]]
- [学习课题 + 应用场景 + 截止日期] #.jiugong
- {{[[kanban]]}}
- ↖
-
-
-
- ↑
-
-
;(function () {
// Don't show navigation controls on mobile
var initialize_back_forward_buttons = () => {
// Don't show navigation controls on mobile
if(/Android|iPhone/i.test(navigator.userAgent)){
return;
}
if(window.initialized_back_forward_buttons) {
@lockcp
lockcp / README.md
Created January 15, 2022 17:34 — forked from shodty/README.md
Create a Toggle button for the right sidebar in Roam.

Move the right sidebar toggle to a button in the upper right icon tray.

Demo

You can add this to Roam using {{[[roam/js]]}}

Grab the code in roam-sidebar-toggle.js and drop it in a javascript code block, nested underneath a {{[[roam/js]]}} block:

  ```javascript```