Skip to content

Instantly share code, notes, and snippets.

// SSH tunnel on remote host
ssh -f -N -L 127.0.0.1:5453:127.0.0.1:5432 [email protected]
netstat -lt
// Check connection
psql -h 93.158.192.89 -p 5432 -U bpms -d dictionaries
mvn clean install -T 16 -pl :mail-adapter-app -am
git stash
git checkout master
git merge dev
mvn versions:set -DnewVersion=1.19.0
application.version=1.19.0 in application.properties
.env set 1.19.0
git add *
git commit -m "release 1.19.0"
git push
git checkout -b release/1.19.0
sudo df -h
sudo du -h | grep '^\s*[0-9\.]\+G'
\\ports
sudo netstat -ntulp
docker rmi $(docker images | grep '1.14.1\|1.15.0\|1.16.' | tr -s ' ' | cut -d ' ' -f 3)
tcpdump
https://losst.ru/search_commands/command/?search=tcpdump
package ru.utair.esb._1c.adapter.script;
import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.ProducerConfig;
import org.apache.kafka.clients.producer.ProducerRecord;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.apache.kafka.common.serialization.LongSerializer;
import org.apache.kafka.common.serialization.StringSerializer;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.List;

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@AlexeyLevin
AlexeyLevin / consumer.sh
Created November 13, 2018 22:47 — forked from dongjinleekr/consumer.sh
Kafka benchmark commands
## Consumer Throughput: Single consumer thread, no compression
## Consumer Throughput: 3 consumer thread, no compression
bin/kafka-consumer-perf-test.sh --topic benchmark-3-3-none \
--zookeeper kafka-zk-1:2181,kafka-zk-2:2181,kafka-zk-3:2181 \
--messages 15000000 \
--threads 1
public String toDsv(String fileName) {
StringBuilder stringBuilder = new StringBuilder();
InputStream inp = null;
try {
inp = FileUtils.getInputStream(fileName);
Workbook wb = WorkbookFactory.create(inp);
addSheets(stringBuilder, wb);
} catch (IOException ex) {
log.error(null, ex);
} finally {
Download Postgresql binary file:
http://www.enterprisedb.com/products-services-training/pgbindownload
Version: 9.4.4
Setup Postgresql (One time setup):
For Windows:
Download postgresql-*-binaries.zip file from the download link
Extract the zip file
Set environment variable PG_HOME as the parent folder of bin
Add %PG_HOME%\bin to PATH environment variable