Skip to content

Instantly share code, notes, and snippets.

View zh-f's full-sized avatar
:shipit:
Focusing

Fan Zhang zh-f

:shipit:
Focusing
View GitHub Profile
@koichirok
koichirok / testlink-xml-to-csv.py
Last active July 9, 2022 16:25
Small Python 2 script to convert exported TestLink test cases (test suite) to CSV.
@dtodt
dtodt / Retry.java
Last active February 23, 2023 18:18
Retrofit2@2.5.0 - Retry Adapter Factory - Call & CompletableFuture
package com.company.retrofit2.annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
@rise-worlds
rise-worlds / For Mac 4.2.6 unlimited trial.md
Last active April 24, 2024 06:44 — forked from satish-setty/trial.md
Beyond Compare 4 license for Windows, Mac, Linux

for 4.2.4 or higher, 4.2.5,4.2.6,4.3.7, it's works, this is the way which makes Always in evaluation mode.

  1. open Terminal, go to the dir : cd /Applications/Beyond Compare.app/Contents/MacOS
  2. change the name BCompare to BCompare.bak: mv BCompare BCompare.bak
  3. touch a file name BCompare , and chmod a+ux BCompare : touch BCompare && chmod a+ux BCompare
  4. open BCompare with text editor, insert the script :
#!/bin/bash
rm "/Users/$(whoami)/Library/Application Support/Beyond Compare/registry.dat"
"`dirname "$0"`"/BCompare.bak $@
@caisan
caisan / gist:efd158a059432d5e7618011a2edfbc5d
Created October 20, 2017 08:02
create replica_set mongoDB
#!/bin/bash
TENANT_NAME=
ADMIN_USERNAME=
ADMIN_PASSWORD=
REQUEST="{\"auth\": {\"tenantName\":\"$TENANT_NAME\", \"passwordCredentials\": {\"username\": \"$ADMIN_USERNAME\", \"password\": \"$ADMIN_PASSWORD\"}}}"
RAW_TOKEN=`curl -s -d "$REQUEST" -H "Content-type: application/json" "http://{KeyStone_IP_ADDR:Port}/v2.0/tokens"`
TOKEN=`echo $RAW_TOKEN | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
echo $TOKEN\
@xynova
xynova / redis-cli-in-docker.sh
Last active June 9, 2020 17:20
Start redis-cli-in-docker
docker run --rm -ti --name rediscli \
--net host \
redis:alpine \
redis-cli -h localhost -p 6379 -a THE-XXXX-PASSWORD ping
@wisdomfusion
wisdomfusion / install-gcc-4.9.3-on-centos6.txt
Last active March 29, 2021 03:18
Install gcc-4.9.3 on CentOS 6
yum install libmpc-devel mpfr-devel gmp-devel
cd /usr/src/
curl ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-4.9.3/gcc-4.9.3.tar.bz2 -O
tar xvfj gcc-4.9.3.tar.bz2
cd gcc-4.9.3
./configure --disable-multilib --enable-languages=c,c++
make -j `grep processor /proc/cpuinfo | wc -l`
make install
@relaxdiego
relaxdiego / install-tmux
Last active December 7, 2021 16:09 — forked from rothgar/install-tmux
Install tmux 2.2 on CentOS 7.1
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
make
sudo make install
@jriguera
jriguera / segurity_group_rules.sh
Created February 24, 2016 22:52
Neutron cmd to add security group rules
# Add Neutron security groups for ping and ssh
neutron security-group-rule-create \
--protocol icmp \
--direction ingress \
--remote-ip-prefix 0.0.0.0/0 \
default
neutron security-group-rule-create \
--protocol tcp \
@imminent
imminent / Api.java
Last active June 13, 2023 02:50
Call retrying with Retrofit 2.0
package com.example.api;
import java.util.Map;
import retrofit.Call;
import retrofit.http.Body;
import retrofit.http.GET;
import retrofit.http.POST;
public interface Api {

Set rz and sz on Mac

There are a mess of troubles in sending and receiving files from my macbook to dev server, since I had no permission to excute command scp on dev server. Here is a lightweight, quick, and convenience tools which related with ssh, called lrzsz. lrzsz is a unix communication package providing the XMODEM, YMODEM, ZMODEM file transefer protocol which usually has been already installed in most of servers.

Prerequisites

  • iTerm2 is necessary. [Here][] is the official website.