Skip to content

Instantly share code, notes, and snippets.

View qixiaobo's full-sized avatar
:octocat:
Coding

qixiaobo qixiaobo

:octocat:
Coding
View GitHub Profile
@qixiaobo
qixiaobo / limit.lua
Created July 24, 2018 08:59
redis lua openresty
local ip = ngx.var.remote_addr
local redis_connect_timeout = 1000
local redis_host = "192.168.12.203"
local redis_port = 6379
local redis_prefix = "sms:"
local redis_white_list_key = redis_prefix .. "white"
local redis_black_list_key = redis_prefix .. "black:"
local redis_limit_key = redis_prefix .. "limit:"
local redis_limit_mode_key = redis_prefix .. "mode"
local now = os.time()
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Function
# Find duplicate class among java libs.
#
# @Usage
# $ show-duplicate-java-classes # find jars from current dir
# $ show-duplicate-java-classes path/to/lib_dir1 /path/to/lib_dir2
# $ show-duplicate-java-classes -c path/to/class_dir1 -c /path/to/class_dir2
#
@qixiaobo
qixiaobo / find_unused_index
Created February 27, 2019 01:42
find_unused_index.sql
SELECT
t.TABLE_SCHEMA,
t.TABLE_NAME,
s.INDEX_NAME,
s.COLUMN_NAME,
s.SEQ_IN_INDEX,
(
SELECT
MAX( SEQ_IN_INDEX )
FROM
@qixiaobo
qixiaobo / changeRemoteUrl.sh
Created June 1, 2022 09:41 — forked from samirreza/changeRemoteUrl.sh
Shell script to bulk change git remote url
directoryContainingAllRepos="" # directory containing all git repo's
oldGitRemoteServer="" # current remote server url for example gitlab.com
newGitRemoteServer="" # new remote server url for example git.example.com
cd $directoryContainingAllRepos
find * -maxdepth 0 -type d \( ! -name . \) -print | while read dir
do
cd $dir
if [ -d ".git" ]
then
remoteUrl1="$(git config --get remote.origin.url)"