Skip to content

Instantly share code, notes, and snippets.

😀
Haha

vamdt vamdt

😀
Haha
Block or report user

Report or block vamdt

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@vamdt
vamdt / ssh_connection_test.sh
Last active Aug 16, 2017
ssh_connection_test
View ssh_connection_test.sh
for i in $(cat ip.txt)
do
ssh -q -p 16322 -o "BatchMode=yes" -o "ConnectTimeout=3" "$i" "echo 2>&1" && echo "$i OK" || echo "$i NOK"
done
@vamdt
vamdt / KafkaTopicUtil.java
Last active Aug 22, 2018
Dynamic create kafka topic
View KafkaTopicUtil.java
package com.hello.world;
import joptsimple.internal.Strings;
import kafka.admin.AdminUtils;
import kafka.admin.RackAwareMode;
import kafka.utils.ZKStringSerializer$;
import kafka.utils.ZkUtils;
import org.I0Itec.zkclient.ZkClient;
import org.I0Itec.zkclient.ZkConnection;
@vamdt
vamdt / ajax_window_open.js
Created Aug 4, 2017
ajax async set false to make window open works
View ajax_window_open.js
$.ajax({
url: "/",
async: false,
dataType: "json",
success: function() {
window.open("http://google.com", "_blank");
}
});
@vamdt
vamdt / high_cpu_threads.sh
Created May 11, 2017
Print high cpu thread jstack message
View high_cpu_threads.sh
#!/bin/bash
usage() {
echo "Usage: $0 -p <pid> [-n <thread number>]"
}
# args check
while getopts ":p:n:" arg; do
case "$arg" in
p)
@vamdt
vamdt / .ideavimrc
Last active Jul 5, 2019
ideavim config
View .ideavimrc
set hls
set ignorecase smartcase
set incsearch
set showmode
" minimum nr. of lines above and below cursor
set so=5
" enable vim-surround plugin
set surround
View bugn_Config.ini
; bug.n - tiling window management
; @version 9.0.0
Monitor_#1_aView_#2=3
View_#1_#1_layout_#1=2
View_#1_#1_layoutMFact=0.250000
Config_fontName=微软雅黑
Config_fontSize=10
@vamdt
vamdt / proxy.conf
Created Aug 3, 2016
nginx proxy cache configuration
View proxy.conf
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding 'gzip';
client_max_body_size 100m;
client_body_buffer_size 256k;
proxy_connect_timeout 60;
proxy_send_timeout 60;
@vamdt
vamdt / UTF8MB4ConnectionCustomizer.java
Created Jun 18, 2016
UTF8MB4ConnectionCustomizer
View UTF8MB4ConnectionCustomizer.java
package com.vamdt.api.common
import com.mchange.v2.c3p0.AbstractConnectionCustomizer;
import java.sql.Connection;
import java.sql.Statement;
public class UTF8MB4ConnectionCustomizer extends AbstractConnectionCustomizer {
@Override
public void onAcquire(Connection c, String parentDataSourceIdentityToken) throws Exception {
@vamdt
vamdt / Cmder踩坑记录.md
Last active Sep 12, 2018
Cmder踩坑记录
View Cmder踩坑记录.md

Cmder踩坑记录

  1. 执行超过4个字符长的命令,按up或者down之后第一个字符没有消失。

    解决方案:

    找到cmder安装目录 cmder\vendor\ 修改clink.lua文件

    将如下代码

View cmder下git-for-windows乱码解决方案.md
  1. git status时中文文件名乱码

    现象:

    \344\275\240\345\245\275
    

    执行以下命令即可:

You can’t perform that action at this time.