This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias j8='export JAVA_HOME=/home/installs/java/jdk1.8.0_291; export PATH=$JAVA_HOME/bin:$PATH' | |
alias j11='export JAVA_HOME=/home/installs/java/jdk-11.0.12; export PATH=$JAVA_HOME/bin:$PATH' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for i in $(seq 1 408) | |
do | |
f=seg-$i-v1-a1.ts | |
# echo $f | |
wget "<URL>/$f" | |
cat $f >> all.ts | |
rm $f | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 2 ]; then | |
echo "usage: sh top-consumers.sh <pid> <number-of-consumers>" | |
exit | |
fi | |
lowerBound=$(expr "$2" + 1) | |
jstack -l $1 > top-consumers_thread_dump.txt & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 3 ]; then | |
echo "usage: sh thread-analyze.sh <pid> <number-of-dumps> <interval>" | |
exit | |
fi | |
count=$2 | |
for i in `seq 1 $count`; | |
do | |
jstack -l $1 > thread_dump_`date "+%F-%T"`.txt & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Sierpinski { | |
public static void main(String[] args) { | |
int no_of_row = 50; | |
int[][] tri = new int[no_of_row][no_of_row]; | |
for (int i = 0; i < no_of_row; i++) { | |
for (int j = 0; j <= i; j++) { | |
if (j == 0 || j == i) { | |
tri[i][j] = 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mvn -Dmaven.surefire.debug test --> surefire test | |
mvn versions:set -DnewVersion=2.50.1-M1 --> manually set version | |
mvn versions:commit --> apply the changes | |
mvn versions:revert --> revert the changes | |
mvn -Dmaven.repo.local=$HOME/.my/other/repository clean install | |
mvn -Dtest=org.my.pkg.Hello#testGreet test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
var carbon = require('carbon'); | |
var server = new carbon.server.Server(); | |
var options = {system: true, domain: carbon.server.tenantDomain() , tenantId: carbon.server.tenantId()}; | |
var dataStore = new carbon.registry.Registry(server, options); | |
var res; | |
var mycontent; | |
var path = "/_system/governance/sen/hello"; | |
try { | |
res = dataStore.get(path); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo "abc" | |
abc | |
$ echo "abc" | sed 's/b/z/' | |
azc | |
$ echo "abcb" | sed 's/b/z/' | |
azcb | |
$ echo "abcb" | sed 's/b/z/g' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* | |
When scp ing a file which has white spaces in its name have to escape twice, | |
because it's escaped locally and then on the remote end. | |
There are a couple of options you can do (in bash): | |
scp [email protected]:"'web/tmp/Master File 18 10 13.xls'" . | |
scp [email protected]:"web/tmp/Master\ File\ 18\ 10\ 13.xls" . | |
scp [email protected]:web/tmp/Master\\\ File\\\ 18\\\ 10\\\ 13.xls . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get the md5sum for files in a directory | |
---------------------------------------- | |
$ ls | xargs md5sum | |
If the file name contains white space, set the delimiter to new line (default delimiter is white space) | |
$ ls | xargs -d'\n' md5sum | |
Estimate the directories / files size | |
$ ls | xargs du -sh |
NewerOlder