Skip to content

Instantly share code, notes, and snippets.

View palashkulsh's full-sized avatar
💔
delusion of reprieve

palash kulshreshtha palashkulsh

💔
delusion of reprieve
View GitHub Profile
@vkroz
vkroz / Kafka commands.md
Last active January 21, 2024 12:12
Kafka frequent commands

Kafka frequent commands

Assuming that the following environment variables are set:

  • KAFKA_HOME where Kafka is installed on local machine (e.g. /opt/kafka)
  • ZK_HOSTS identifies running zookeeper ensemble, e.g. ZK_HOSTS=192.168.0.99:2181
  • KAFKA_BROKERS identifies running Kafka brokers, e.g. KAFKA_BROKERS=192.168.0.99:9092

Server

Start Zookepper and Kafka servers

@andyrbell
andyrbell / scanner.sh
Last active April 5, 2024 09:01
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@palashkulsh
palashkulsh / describe instaces of a given Service tag
Last active February 17, 2022 06:11
aws cli describe instance scripts
aws ec2 describe-instances --filters "Name=tag:Service,Values=marketplace-esclus" | jq '.Reservations[].Instances[] | "\(.PrivateIpAddress) , \(.EbsOptimized) , \(.SubnetId) , \(.Placement.AvailabilityZone) , \(.Tags[]| select(.Key == "Hostname") | .Value) , \(.InstanceType)"'
@namuan
namuan / aws-cli-examples.sh
Last active March 20, 2021 00:04
[AWS CLI examples] #aws #cli
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[*].Tags[?Key==`Name`]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `registration`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[?Tags[?starts_with(Value, `email`)]]'
aws autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[] | [?contains(Tags[?Key==`Name`].Value, `email-01`)]' --output table
@furquanuddin94
furquanuddin94 / portkey
Last active April 26, 2019 10:51
Utility to access server boxes (over SSH) via IP or ELB (specifically for AWS).
#!/bin/bash
#Script to access server boxes
#Put the script in any directory present on system's $PATH. Make the file executable via "chmod +x portkey". Then use "portkey help" for instructions on how to use.
#Prerequirements: Install JQ and Sponge
homeDir=$( echo $HOME )
configFile="${homeDir}/portkey.conf"
paramCount="$#"
if [ "$paramCount" = "0" ] || [ "$1" = "help" ]