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
curl -s https://croinvest.eu/en/kampanja/zvjezdarnica-visnjan/ | \ | |
egrep '<td>|</td>' | \ | |
sed 's/.*amount">\(.*\)\ .*/\1/g' | \ | |
egrep '<td>.*</td>|,00' | \ | |
sed 's/.*December \(.*\),.*/\1/g' | \ | |
awk 'NR%2{printf "%s ",$0;next;}1' | \ | |
sed 's/,00//g' | sed 's/,//g' | sed 's/\.//g' | \ | |
awk '{arr[$2]+=$1} END {for (i in arr) {print i,arr[i]}}' | \ | |
sort -k1 -n | perl -lane 'print $F[0]," ",$F[1]," ", "\t", "." x ($F[1] / 1000)' | \ | |
tee result && \ |
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
lowercaseOutputName: true | |
rules: | |
- pattern : kafka.cluster<type=(.+), name=(.+), topic=(.+), partition=(.+)><>Value | |
name: kafka_cluster_$1_$2 | |
labels: | |
topic: "$3" | |
partition: "$4" | |
- pattern : kafka.log<type=Log, name=(.+), topic=(.+), partition=(.+)><>Value | |
name: kafka_log_$1 | |
labels: |
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
def callGet(String url) { | |
new groovy.json.JsonSlurper().parseText(url.toURL().getText()) | |
} | |
def callPost(String urlString, String queryString) { | |
def url = new URL(urlString) | |
def connection = url.openConnection() | |
connection.setRequestMethod("POST") | |
connection.doOutput = true |
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 IpUtils { | |
public static final int getFreePort() { | |
try { | |
ServerSocket s = new ServerSocket(0); | |
int port = s.getLocalPort(); | |
s.close(); | |
return port; | |
} catch (IOException e) { | |
throw new RuntimeException(e.getMessage(), e); | |
} |