Skip to content

Instantly share code, notes, and snippets.

View cloverstd's full-sized avatar
🀄
Working for living

cloverstd cloverstd

🀄
Working for living
View GitHub Profile
#!/bin/sh
apt update && apt install -y curl sudo && \
adduser --gecos "" cloverstd && \
usermod -aG sudo cloverstd && \
echo "cloverstd ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/90-cloverstd && \
runuser -u cloverstd -- bash -c "ssh-import-id-lp cloverstd && ssh-import-id-gh cloverstd" && \
echo "PasswordAuthentication no" >> /etc/ssh/sshd_config && \
echo "PermitRootLogin no" >> /etc/ssh/sshd_config && \
systemctl reload ssh && \
<script>
/**
* [js-sha3]{@link https://github.com/emn178/js-sha3}
*
* @version 0.8.0
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2015-2018
* @license MIT
*/
@cloverstd
cloverstd / config.yml
Last active March 5, 2023 16:46
clash 旁路由配置
mixed-port: 17890
redir-port: 17892
allow-lan: true
mode: rule
log-level: info
@cloverstd
cloverstd / id_rsa_vps.pub
Created February 25, 2023 07:10
id_rsa_vps.pub
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDI+CFCrtFoUCO5StL3hFD5nyvPNutLmkazMEHC43nLQfj+ZtsOHJUyhj5TSsFHogoi3XdTi1MexFk5zPfwgRnXvWAYRlhqiG0fx7zKaqy/1RI2t/+JWcOGhEy91s2t8gHOj2Tub/vAzKWvgJRzhTjDlZ+LumkpuWL3tIHXcd9X2R16JQ92PpkTwgSefpcogOObiQbuYVTpjq9WCCjKktxR7G/BxfeoOjQbDjzhEkqI96Bsl73cMPn9VyLazZVXacLF0C7KZ19GWSER0+3d3KYOFSUdS22OfnirwVwaoFnDvCX7bBStzVdpT4q2M/6uSTRpp5JjL69hiXwFemjksWOT cloverstd@hui.lu
@cloverstd
cloverstd / temp.lua
Created February 8, 2023 11:19
OpenWrt temperature monitor for prometheus-collectors
--[[
function print_metric(metric, labels, value)
local label_string = ""
if labels then
for label,value in pairs(labels) do
label_string = label_string .. label .. '="' .. value .. '",'
end
label_string = "{" .. string.sub(label_string, 1, -2) .. "}"
end
io.write(string.format("%s%s %s", metric, label_string, value))
@cloverstd
cloverstd / main.py
Created October 22, 2016 09:31
Handle file upload by Tornado and Nginx Upload Module
#!/usr/bin/env python
# encoding: utf-8
import tornado.ioloop
import tornado.web
import tornado.log
import tornado.httpserver
from tornado.options import define, options
import logging
import tornado.gen
@cloverstd
cloverstd / sshpass.rb
Last active March 14, 2022 20:15 — forked from lalyos/sshpass.rb
brew install sshpass
require 'formula'
class Sshpass < Formula
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz'
homepage 'http://sourceforge.net/projects/sshpass'
sh256 'c6324fcee608b99a58f9870157dfa754837f8c48be3df0f5e2f3accf145dee60'
def install
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--prefix=#{prefix}"
@cloverstd
cloverstd / cache.py
Last active October 27, 2021 05:35
tornado cache
# coding: utf-8
try:
import cPickle as pickle
except ImportError:
import pickle
try:
import hashlib
sha1 = hashlib.sha1
@cloverstd
cloverstd / main.go
Last active April 21, 2021 09:43
publish npm package by Golang
package main
import (
"archive/tar"
"bytes"
"compress/gzip"
"crypto/sha1"
"crypto/sha512"
"encoding/base64"
"encoding/hex"
@cloverstd
cloverstd / script.sh
Created April 15, 2021 04:48
Convert RFC4716 private id_rsa to PEM
ssh-keygen -f id_rsa -m pem -p