This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // https://github.com/kgolding/go-simple-http-server/blob/master/main.go | |
| package main | |
| import ( | |
| "flag" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "strconv" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # OpenWrt random mac address changer | |
| # https://github.com/krabelize/openwrt-random-mac-changer | |
| interface="wlan0" | |
| current_mac=$(ifconfig ${interface} | grep "HWaddr" | awk '{print$5}') | |
| new_mac=$(dd if=/dev/random bs=1 count=3 2>/dev/null | hexdump -C | head -1 | cut -d' ' -f2- | awk '{ print "34:36:3b:"$1":"$2":"$3 }') | |
| if [ $? -eq 0 ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SOCAT=/usr/bin/socat | |
| print_help() { | |
| echo "Usage: $0 [--bind-v6] <--bind PORT> [--remote-v6] <--remote-ip IP> <--remote-port PORT>" | |
| exit 1 | |
| } | |
| BIND_PORT= | |
| BIND_IP_VER=4 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 深度学习 | |
| # 将图片拷贝或者创建软链接到另一个目录中 | |
| # bash 1.sh /path/to/src /path/to/dest jpg | |
| src_dir=$1 | |
| dest_dir=$2 | |
| suffix=$3 | |
| [ $# -eq 3 ] || { echo "Usage $0 SRC_DIR DEST_DIR SUFFIX"; exit 1; } | |
| [ -d $dest_dir ] || { echo "dest dir not exists"; exit 1; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 用于bitwarden导出的明文json文件,删除对应的json键 | |
| # 目的是用于BeyondCompare或者meld手工对比两份密码库的差异 | |
| import json | |
| def remove_key(d: dict, k: str): | |
| if k in d: | |
| del d[k] | |
| def cleanup(filename:str): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <string> | |
| #include <algorithm> | |
| #include <cstring> | |
| //#include <cmath> | |
| #include <cstdio> | |
| //#include <limits> | |
| #include <stack> | |
| #include <queue> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from pathlib import Path | |
| # /tmp/1.txt获取方式 | |
| # find /path/to/dir -type f -name '*.md' > /tmp/1.txt | |
| with open("/tmp/1.txt", 'r') as mdList: | |
| for md in mdList: | |
| filepath = md.strip() | |
| filename = Path(md).stem | |
| #print(filename) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Get top dir | |
| # https://github.com/imp/dnsmasq/blob/master/Makefile | |
| TOP_DIR != pwd | |
| TOP_DIR ?= $(CURDIR) | |
| BIN_DIR := $(TOP_DIR)/bin | |
| TARGET := $(BIN_DIR)/SimulateServer | |
| OBJ_DIR := $(TOP_DIR)/obj | |
| OBJECTS := $(patsubst %.cpp, %.o, $(wildcard *.cpp)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "Employee.h" | |
| #include <QString> | |
| class EmployeeData : public QSharedData | |
| { | |
| public: | |
| EmployeeData() | |
| : id(-1) | |
| {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| # | |
| # 递归移动某个文件夹下的所有文件到另一个文件,作为深度学习划分测试集 | |
| # 2022-06-18 | |
| # | |
| # 参数: | |
| # python3 main.py -s <SRC-DIR> -d <DEST-DIR> -p <MOVE-PERCENT> | |
| # 例子: | |
| # python3 main.py E:\image-src E:\image-dest -p 90 |
NewerOlder