Skip to content

Instantly share code, notes, and snippets.

View jamedge's full-sized avatar

Marko Jamedzija jamedge

View GitHub Profile
@jamedge
jamedge / csshx_install.sh
Last active December 30, 2018 15:24
[sh: csshx install] installation and example of running #shell #install
# Install csshx (or `brew install csshx`, but the official version is not working on osx moave)
brew tap parera10/csshx
brew install parera10/csshx/csshx
# Example of running
csshX --ssh_args "-i ~/.ssh/some_key" -l username someIP1 someIP2
@jamedge
jamedge / myslq2_install.sh
Created December 30, 2018 14:58
[ruby: install myslq2 package] For problems with installing mysql2 gem for ruby (when using another location of mysql rather than the default one), provide the path for mysql in the install command #ruby #shell #install
# e.g. if mysql is installed on path /usr/local/Cellar/mysql@5.7/5.7.24
gem install mysql2 -- --with-mysql-dir=/usr/local/Cellar/mysql@5.7/5.7.24
@jamedge
jamedge / brew_cask.sh
Last active April 17, 2019 12:12
[sh: brew: cask installation commands] install/unistall/upgrade macOS gui apps with homebrew examples #homebrew #install #shell
# list installed casks
brew cask list
# show info about the cask
brew cask info lepton
# install lepton
brew cask install lepton
# unistall lepton
@jamedge
jamedge / git_crypt_add_user.sh
Last active March 30, 2019 23:58
[git-crypt: add user] add user to truster users for specific repo #git #gitcrypt
git-crypt add-gpg-user --trusted <user_id_or_email>
@jamedge
jamedge / druid_disable_segment.sh
Created March 18, 2019 15:02
[druid: disable segment] Disables a druid segment (doesn't remove it from cold storage though) #druid #shell
curl -XDELETE http://<coordinator_domain>:<coordinator_port>/druid/coordinator/v1/datasources/<datasource_name>/segments/<segment_id>
@jamedge
jamedge / git_config_gpg_signing_setup.sh
Created March 30, 2019 22:22
[git: config gpg signing setup] Set up the automatic signing of each commit #git #shell
# For setting up gpg not to require password upon each commit, do this (https://stackoverflow.com/questions/39494631/gpg-failed-to-sign-the-data-fatal-failed-to-write-commit-object-git-2-10-0)
brew upgrade gnupg # This has a make step which takes a while
brew link --overwrite gnupg
brew install pinentry-mac
echo "pinentry-program /usr/local/bin/pinentry-mac" >> ~/.gnupg/gpg-agent.conf
killall gpg-agent
# to test it, use this
echo "test" | gpg --clearsign # on linux it's gpg2 but brew stays as gpg
# to show the signature of a commit message
git log --show-signature -1
@jamedge
jamedge / git_crypt_add_new_file.sh
Last active March 30, 2019 23:59
[git-crypt: add file] Add a new file to be enrypted #git #shell #gitcrypt
cd <repo_name>
echo "<file_path_inside_repo> filter=git-crypt diff=git-cryp" >> .gitattributes
git add .gitattributes
git commit
git push origin <branch_name>
@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
@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_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>