Skip to content

Instantly share code, notes, and snippets.

@arloor
arloor / main.go
Created June 11, 2024 12:13
生成随机中文字符串
package main
import (
"fmt"
"math/rand"
"time"
"unicode/utf8"
)
const letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
(rsync -avtP -e "ssh -p 2222" /var/repo/ arloor@192.168.5.200:/share/CACHEDEV1_DATA/repo/ &)
@arloor
arloor / mo.py
Last active March 17, 2021 06:17
树莓派摄像头
# Web streaming example
# Source code from the official PiCamera package
# http://picamera.readthedocs.io/en/latest/recipes2.html#web-streaming
import io
import picamera
import logging
import socketserver
from threading import Condition
from http import server
@arloor
arloor / addr.py
Last active July 21, 2020 14:11
python3利用udp获取域名地址
import socket
def dns_query(domain):
addr = None
with socket.socket(type=socket.SOCK_DGRAM) as s:
try:
s.connect((domain, 80))
addr = s.getpeername()
return addr[0]
@arloor
arloor / index.html
Created May 28, 2020 03:25
markdown编辑器
<div>
<textarea id="textBox" oninput="mark()" cols=50 rows=10></textarea>
</div>
<div id="content">
</div>
<script>
function mark(){
document.getElementById('content').innerHTML = marked(document.getElementById('textBox').value);
}
@arloor
arloor / JAVA-MD5,sha1,sha256;
Created January 2, 2019 06:44
JAVA MD5,sha1,sha256;
import java.io.UnsupportedEncodingException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Scanner;
import org.apache.commons.codec.binary.Hex;
/**
* 常見的几种加密方式
*/
public class Encrypt {
public static void main(String[] args) {