Skip to content

Instantly share code, notes, and snippets.

View veryyoung's full-sized avatar

veryyoung veryyoung

View GitHub Profile
@veryyoung
veryyoung / premint.js
Last active June 30, 2022 10:29
Check premint raffle result using Tampermonkey
// ==UserScript==
// @name PreMint-UI
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author MurMurCats - LL
// @match https://www.premint.xyz/collectors/entries/
// @icon https://www.google.com/s2/favicons?sz=64&domain=tampermonkey.net
// @require https://unpkg.com/[email protected]/dist/jquery.min.js
// @grant GM_xmlhttpRequest
@veryyoung
veryyoung / batch_rename.sh
Created May 28, 2022 16:04
batch rename file
for i in `ls | grep .json`; do mv $i `echo "$i" | awk -F '.json' '{print $1}'`;done
#include <stdio.h>
int main(void) {
int nums[] = {1, 2, 3 , 4, 5};
int length = sizeof(nums) / sizeof(nums[0]);
for(int i=0; i<length; i++){
printf("%d,", nums[i]);
}
printf("%c", 8);
return 0;
#!/sh/bash
###
### 查询当月的每日 uv 详情, 接收 yyyyMMdd 格式的参数, 默认月份为当月
###
LOG_PATH='/var/log/nginx/'
FILE_PREFIX='access.log-'
month=$1
#!/sh/bash
###
### 查询当月 uv, 接收 yyyyMMdd 格式的参数, 默认月份为当月
###
LOG_PATH='/var/log/nginx/'
FILE_PREFIX='access.log-'
month=$1
#!/sh/bash
###
### 查询当日 uv, 接收 yyyyMMdd 格式的参数, 默认日期为今天
###
LOG_PATH='/var/log/nginx/'
FILE_PREFIX='access.log-'
date=$1
@veryyoung
veryyoung / db_backup.sh
Last active September 26, 2016 11:36
定时备份数据
#! /bin/Bash
# config in crontab 30 23
# 30 23 * * * sh /root/backup/backup.sh>>/root/backup/backup.log
DB_USER='root'
DB_PASSWORD=''
DB_NAME='test'
BACKDIR='/root/backup'
currentDate=`date +%F`
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simple_pinyin, city_type) VALUES ('110000', '北京市', '010', 'beijing', 'bj', 'PROVINCE');
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simple_pinyin, city_type) VALUES ('120000', '天津市', '022', 'tianjin', 'tj', 'PROVINCE');
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simple_pinyin, city_type) VALUES ('310000', '上海市', '021', 'shanghai', 'sh', 'PROVINCE');
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simple_pinyin, city_type) VALUES ('500000', '重庆市', '023', 'zhongqing', 'zq', 'PROVINCE');
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simple_pinyin, city_type) VALUES ('130000', '河北省', '', 'hebei', 'hb', 'PROVINCE');
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simple_pinyin, city_type) VALUES ('140000', '山西省', '', 'shanxi', 'sx', 'PROVINCE');
INSERT INTO `pp_common_city` (city_code, city_name, area_code, pinyin, simpl
@veryyoung
veryyoung / FileGathering.java
Last active October 10, 2015 08:40
合并文件,可用来制作传说中的图种。运行时把文件路径当做参数传入,最后一个参数为输出文件的路径。
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.channels.FileChannel;
public class FileGathering {
public static void main(String[] args) throws IOException {
combineFiles(args);
@veryyoung
veryyoung / auto_reload.sh
Last active August 29, 2015 14:24
自动化部署服务
#!/bin/bash
sh /data/tomcat8/bin shutdown.sh
cd /data/source && git pull origin branch
mvn clean package -Dmaven.test.skip=true
sh /data/tomcat8/bin startup.sh