Skip to content

Instantly share code, notes, and snippets.

@binjoo
binjoo / shell.md
Last active August 15, 2023 05:33
人大金仓Kingbase的备份与还原

备份

备份二进制文件

#备份TEST库 
/home/kingbase/ES/V8/Server/bin/sys_dump -U username -F c -f /home/kingbase/test.dmp TEST
#备份TEST库下的test模式
/home/kingbase/ES/V8/Server/bin/sys_dump -U username -F c -n test -f /home/kingbase/test.dmp TEST
#备份TEST库下的test模式的test表
@binjoo
binjoo / Dockerfile
Created March 2, 2022 02:30
SpringBoot Dockerfile
FROM openjdk:8-jdk-alpine
ADD springboot.jar app.jar
EXPOSE 8080
ENV ACTIVE dev
ENTRYPOINT ["java", "-Xmx128m", "-Xss256k", "-XX:ParallelGCThreads=2", "-Djava.compiler=NONE", "-jar", "/app.jar", "--spring.profiles.active=${ACTIVE}"]
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
@binjoo
binjoo / 📊 Weekly development breakdown
Last active June 14, 2022 01:43
📊 Weekly development breakdown
Java 3 hrs 40 mins ███████████░░░░░░░░░░ 52.6%
Markdown 1 hr 27 mins ████▍░░░░░░░░░░░░░░░░ 20.9%
YAML 45 mins ██▎░░░░░░░░░░░░░░░░░░ 11.0%
EJS 24 mins █▏░░░░░░░░░░░░░░░░░░░ 5.8%
JSON 13 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.2%
@binjoo
binjoo / DynamicCompile.java
Created January 3, 2020 09:00
动态编译Java代码
public class TrendsJava {
public static void main(String[] args) {
int i = 10;
String code = "System.out.println(\"Hello World!\"+(13+2*5/3));";
code += "for(int i=0;i<" + i + ";i++){";
code += " System.out.println(Math.pow(i,2));";
code += "}";
try {
run(code);
@binjoo
binjoo / banner.txt
Created December 23, 2019 08:42
Spring Boot 启动 Banner
${AnsiColor.BLACK}${AnsiBackground.BRIGHT_BLACK}
┌─┐ ┌─┐ ${AnsiColor.BRIGHT_YELLOW}+ +${AnsiColor.BLACK}
┌──┘ ┴───────┘ ┴──┐${AnsiColor.BRIGHT_YELLOW}++${AnsiColor.BLACK}
│ │
│ ─── │${AnsiColor.BRIGHT_YELLOW}++ + + +${AnsiColor.BLACK}
${AnsiColor.BRIGHT_WHITE}███████───███████${AnsiColor.BLACK} │${AnsiColor.BRIGHT_YELLOW}+${AnsiColor.BLACK}
│ │${AnsiColor.BRIGHT_YELLOW}+${AnsiColor.BLACK}
│ ─┴─ │
│ │
└───┐ ┌───┘
@binjoo
binjoo / browser_useragent.js
Created December 17, 2019 08:54
详细判断浏览器运行环境
export default function BrowserType () {
// 权重:系统 + 系统版本 > 平台 > 内核 + 载体 + 内核版本 + 载体版本 > 外壳 + 外壳版本
const ua = navigator.userAgent.toLowerCase();
const testUa = regexp => regexp.test(ua);
const testVs = regexp => ua.match(regexp)
.toString()
.replace(/[^0-9|_.]/g, "")
.replace(/_/g, ".");
// 系统
let system = "unknow";
@binjoo
binjoo / script.sh
Last active July 29, 2019 01:14
Shell脚本监控httpd服务80端口状态
# 这里是举例监控httpd服务端口状态,根据端口判断服务器是否启动,
# 如果没有启动则脚本自动拉起服务,如果服务正在运行则退出脚本程序;
# 如果换成别的服务端口也可以,但是脚本程序需要做调整。
#!/bin/bash
#实时每隔3秒监控HTTP服务状态,服务异常输出报警信息,并尝试启动,服务正常时提示正常运行。
web=`netstat -ant | grep 80 | awk '{print $4}' | awk -F : '{print $4}'`
apachelog=/var/log/httpd/service.log
if [ '$web' = '80' ]
then
@binjoo
binjoo / hp.js
Created March 5, 2018 01:19
点击回血特效
$("html,body").click(function(e) {
var gcd = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
var n = Math.floor(Math.random() * gcd.length);
var $i = $("<b/>").text(gcd[n]);
var x = e.pageX,
y = e.pageY;
$i.css({
"z-index": 99999,
"top": y - 20,
"left": x,
@binjoo
binjoo / win10.bat
Created September 8, 2017 03:32
WIN10家庭版启用组策略
@echo off
pushd "%~dp0"
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i"
pause
@binjoo
binjoo / oracle.sql
Last active August 29, 2015 14:04
SQL:插入日历数据
declare
i int;
now date;
date1 date;
week int;
begin
now := trunc(sysdate);
for i in 0..2000 loop
date1 := now + i;
week := to_number(to_char(date1 - 1, 'd'));