Skip to content

Instantly share code, notes, and snippets.

View jamedge's full-sized avatar

Marko Jamedzija jamedge

View GitHub Profile
@jamedge
jamedge / psql_create_user.sql
Created April 7, 2021 14:58
[psql: create user] Creates a user that can create a database #postgres #sql
CREATE USER <username> WITH PASSWORD '<password>' CREATEDB;
@jamedge
jamedge / readlink.sh
Created November 7, 2020 18:51
[sh: symlink location] Finds the full path of the followed symlink source. Requires `brew install coreutils` beforhand. #shell
@jamedge
jamedge / ssh_keypair_generate.sh
Created November 3, 2020 08:32
[sh: generate ssh key pair] Generates ssh key pair in the default ~/.ssh location #shell #git
ssh-keygen -t rsa

Keybase proof

I hereby claim:

  • I am jamedge on github.
  • I am markojamedzija (https://keybase.io/markojamedzija) on keybase.
  • I have a public key whose fingerprint is E9C1 D715 62C1 B87B BF4C 2745 7701 938B 943A B8BF

To claim this, I am signing this object:

@jamedge
jamedge / get_cpu_features.sh
Created July 8, 2019 08:11
[sh: get cpu features] Gets the cpu features #shell
sysctl -a | grep machdep.cpu.features
@jamedge
jamedge / kapacitor_list_tasks.sh
Created April 20, 2019 13:49
[sh: kapacitor: list tasks] list all tasks in kapacitor #kapacitor #shell
kapacitor -url <kapacitor_url> list tasks
@jamedge
jamedge / brew_link.sh
Created April 17, 2019 12:22
[sh: brew: link package installation] Symlink all of formula's installed files into the Homebrew prefix #homebrew #shell
@jamedge
jamedge / kafka_data_manipulation.sh
Last active March 31, 2019 21:10
[kafka: data manipulations] Data manipulations using kafka docker image #docker #shell #kafka
# Run and connect to the container
docker run --net host -it wurstmeister/kafka:0.9.0.1 bin/bash
# NOTE: if `kafka-docker` is used and container is already sterted, connecting can be done directly to started container with `docker exec -it <containerId> bash`
# navigate to kafka dir
cd $KAFKA_HOME
# listing topics
bin/kafka-topics.sh --zookeeper <zookeeper_ip>:2181 --list
# creating a kafka topic
bin/kafka-topics.sh --create --zookeeper <zookeeper_ip>:2181 --replication-factor 1 --partitions 1 --topic <topic_name>
@jamedge
jamedge / kafka_local_service_start_and_restart.sh
Last active March 31, 2019 17:54
[kafka: start and restart local service] Starts and restarts local kafka service #docker #shell #kafka
# start
docker-compose start kafka
# restart
docker-compose restart kafka
@jamedge
jamedge / kafka_local_service_start_single_broker.sh
Last active March 31, 2019 17:54
[kafka: start a single broker locally] Start a single broker locally (using kafka-docker) -> kafka + zookeeper #docker #shell #kafka
# from kafka-docker repo
docker-compose -f docker-compose-single-broker.yml up