Month: July 2017

git list remote branches

Sometimes you may need to figure out what branches exist on a remote repository so you can pull them down and check them out, merge them into your local branches, etc. If you’re using GitHub or gitweb to host your repository it’s usually easy to determine the branch names, but if you need to get them in general or for scripts it’s not exactly clear. UPDATE: The comments have enlightened me quite a bit…there seems to always be more than one way to skin a cat using…

Read More »

Encrypt file with openssl RSA

生成一个密钥: openssl genrsa -out test.key 1024 这里-out指定生成文件的。需要注意的是这个文件包含了公钥和密钥两部分,也就是说这个文件即可用来加密也可以用来解密。后面的1024是生成密钥的长度。 openssl可以将这个文件中的公钥提取出来: openssl rsa -in test.key -pubout -out test_pub.key -in指定输入文件,-out指定提取生成公钥的文件名。至此,我们手上就有了一个公钥,一个私钥(包含公钥)。现在可以将用公钥来加密文件了。 我在目录中创建一个hello的文本文件,然后利用此前生成的公钥加密文件: openssl rsautl -encrypt -in hello -inkey test_pub.key -pubin -out hello.en -in指定要加密的文件,-inkey指定密钥,-pubin表明是用纯公钥文件加密,-out为加密后的文件。 解密文件: openssl rsautl -decrypt -in hello.en -inkey test.key -out hello.de -in指定被加密的文件,-inkey指定私钥文件,-out为解密后的文件。   Source: https://www.cnblogs.com/alittlebitcool/archive/2011/09/22/2185418.html

Read More »

Gradle to maven conversion and vice versa

A N M Bazlur Bazlur RahmanJuly 20, 2014Java, Tips How to convert maven to gradle The first thing is, you have to install gradle. Its easy. I know you can do it.  Go to the installing guide: http://www.gradle.org/docs/current/userguide/installation.html Now the second step is to run ‘gradle init‘ in the directory containing the POM file. This will  convert the maven build to a gradle build generating a setting.gradle file and one or  ore more build.gradle files. Thats all. How to convert gradle to…

Read More »

Understand JMeter APDEX

1. Concept APDEX is explained here To compute it JMeter needs 2 values: Satisfied count Tolerating count Satisfied count is the Number of requests for which response time is lower than “Toleration threshold” Tolerating count is the Number of requests for which response time is higher than Toleration threshold but lower than “Frustration threshold” So JMeter let’s you customize those 2 values as it depends on your SLR/SLA. APDEX = (SatisfiedCount + ToleratingCount / 2) / TotalSamples 2. How to…

Read More »