Skip to content

Instantly share code, notes, and snippets.

View v5tech's full-sized avatar
🎯
Focusing

v5tech

🎯
Focusing
  • Xi'an China
  • 21:37 (UTC +08:00)
View GitHub Profile
@v5tech
v5tech / GoogleAuthenticationTool.java
Created May 15, 2024 05:54
Google Authenticator 验证工具类
import com.google.zxing.BarcodeFormat;
import com.google.zxing.MultiFormatWriter;
import com.google.zxing.WriterException;
import com.google.zxing.client.j2se.MatrixToImageWriter;
import com.google.zxing.common.BitMatrix;
import de.taimos.totp.TOTP;
import org.apache.commons.codec.binary.Base32;
import org.apache.commons.codec.binary.Hex;
import sun.misc.BASE64Encoder;
@v5tech
v5tech / HttpGetRequestWithBodyAppliaction.java
Created April 19, 2024 03:23
http get request with body
package net.aimeizi;
import cn.hutool.json.JSONObject;
import org.apache.commons.io.IOUtils;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpEntityEnclosingRequestBase;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
@v5tech
v5tech / jd.js
Last active February 6, 2024 03:25
JD自动评价
/**
浏览器打开www.jd.com登录账号,按F12点击Console->复制下列代码->粘贴回车键坐等即可
*/
document.body.innerHTML = "";$("html").css("overflow","hidden");$("body").append('<div id="topTitle" style="padding:20px;display:block;font-size:48px;color:#FFFFFF;background-color:#e2231a;width:100%;text-align:center">京东自动评价JS脚本 </div><iframe src="https://club.jd.com/myJdcomments/myJdcomment.action?sort=0" style="width:99%;height:800px" id="JDifr"></iframe>');$("#J-global-toolbar").remove();let isFiveStar = true;$("#topTitle").click(function(){(isFiveStar = !isFiveStar) ? $("#topTitle").css("background-color","#e2231a"):$("#topTitle").css("background-color","#8B0000");});let pendingNum = 1;let waitSubmitIds;let curId = 0;let maxCurId = 0;$("#JDifr").load(function(){if($("#JDifr").attr("src").indexOf("sort") > 0){pendingNum = ($("#JDifr").contents().find("a.text:first").siblings().length>0 && $("#JDifr").contents().find("a.text:first").attr("href")=="?sort=0")?parseInt($("#JDifr").contents().find("a.text:first").next().text()):0;waitSubmitIds = $("#
@v5tech
v5tech / ffmpeg.md
Last active January 16, 2024 09:19
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@v5tech
v5tech / 知乎日报API.md
Last active May 27, 2023 00:49
知乎日报API
@v5tech
v5tech / getip
Created March 12, 2023 15:08
获取外网IP
https://tbip.alicdn.com/api/queryip
https://ip.cn/api/index?type=0
https://r.inews.qq.com/api/ip2city?otype=jsonp
http://mam.netease.com/api/config/getClientIp
https://api.live.bilibili.com/xlive/web-room/v1/index/getIpInfo
@v5tech
v5tech / linux-http-tcp.md
Last active February 3, 2023 07:13
linux下查看http 并发和 tcp连接数

linux查看httpd进程数

ps -ef | grep httpd | wc -l

查看Apache的并发请求数及其TCP连接状态

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
@v5tech
v5tech / README.md
Created January 29, 2023 04:58 — forked from magnetikonline/README.md
Bash getopt long options with values usage example.

Bash getopt long options with values usage example

#!/bin/bash -e

ARGUMENT_LIST=(
  "arg-one"
  "arg-two"
  "arg-three"
)
@v5tech
v5tech / rename.md
Last active January 19, 2023 03:48
巧妙使用cmd和xls批量重命名文件

巧妙使用cmd和xls批量重命名文件

1. 迅速切换到目标文件目录

C:\Windows\System32>cd /d E:\images

E:\images>
apiVersion: v1
kind: ConfigMap
metadata:
name: slim-shady-configmap
data:
slim-shady.sh: |
#!/bin/bash
echo "Hi!"
echo "My name is"