Kafka CLI kaf

Kafka is super popular and powerful data streaming platform but I’m surprised by lack of easy cli tool. To find out version, there is no such thing as kafka --version you do: $ find /opt/kafka/libs/ -name kafka_\* | head -1 /opt/kafka/libs/kafka_2.13-2.4.0-test-sources.jar where 2.13 is scala version and 2.4.0 is kafka version. One tool that I played with is lovely called kaf, “Modern CLI for Kafka”. to list topics, you do: sudo bin/kafka-topics.sh --list --bootstrap-server localhost:9092 whereas with kaf you do: ...

January 25, 2020 · 2 min · Naoko Reeves

Docker Image / Container Cleaning

Unused Docker image and container can quickly take up your disk spaces. Let’s check disk usage Summary of data used. You can add -v flag for detailed info. $ docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 87 1 63.39GB 63.17GB (99%) Containers 1 0 0B 0B Local Volumes 69 1 2.732GB 2.683GB (98%) Build Cache 0 0 0B 0B Remove unused data The following command will remove: all stopped containers all networks not used by at least one container all dangling images (see below fo dangling images) all build cache By default, volumes are not removed to prevent important data from being deleted. $ docker system prune WARNING! This will remove: - all stopped containers - all networks not used by at least one container - all dangling images - all dangling build cache Are you sure you want to continue? [y/N] y Deleted Containers: ... Total reclaimed space: 13.91GB Options: ...

August 25, 2019 · 1 min · Naoko Reeves

Create and Extract tar.gz on Ubuntu

Create tar.gz archives tar czf new-tar-file-name.tar.gz file-or-folder-to-archive c - create new archive z - compress the archive using gzip f - use archive file Extract archives tar -xzf tar-file-name.tar.gz x - extract the archive. z - uncompress the archive using gzip. f - use archive file. Let’s do it. I only want to compress 3 files. When I extract archive what I want to see is files in the directory. $ tree file_dir/ file_dir/ ├── file1.txt ├── file2.txt └── file3.txt $ cd file_dir $ tar czf files.tar.gz . tar: .: file changed as we read it # moved files.tar.gz to different directory $ tar -xzf files.tar.gz $ ls file1.txt file2.txt file3.txt file_dir files.tar.gz Cheers!

August 7, 2019 · 1 min · Naoko Reeves

Install GraalVM and run ptyhon with debugger

What is GraalVM? GraalVM is a high-performance, embeddable, polyglot virtual machine for running applications written in JavaScript, Python, Ruby, R, JVM-based languages like Java, Scala, Kotlin, and LLVM-based languages such as C and C++. Here is the Official doc link Hmm… Okay, I have to see it. Let’s install Below is the way I installed GraalVM Community Edition on Ubuntu 18.04. For other platform, the official doc installation guide is here. # update this number to latest version from here: https://github.com/oracle/graal/releases version=1.0.0-rc15 wget https://github.com/oracle/graal/releases/download/vm-${version}/graalvm-ce-${version}-linux-amd64.tar.gz tar -xvzf graalvm-ce-${version}-linux-amd64.tar.gz # clean up rm graalvm-ce-${version}-linux-amd64.tar.gz # to wherever you want. mv graalvm-ce-1.0.0-rc15/ ~/bin/graalvm # if you want to make it permanent, put this in your bashrc export PATH=$HOME/graalvm/bin:$PATH Now that your graalvm/bin in your path, you’ll get the GraalVM versions of those runtimes. ...

April 14, 2019 · 3 min · Naoko Reeves

Get my public IP address via CLI

How to determine my public IP address assigned by the ISP via CLI Use dig command dig +short myip.opendns.com @resolver1.opendns.com Use 3rd party curl ifconfig.me Cheers!

April 4, 2019 · 1 min · Naoko Reeves