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
@palashkulsh
palashkulsh / backup_database.sh
Created April 2, 2018 05:32
backup database in zipped file
mysqldump -v -hlocalhost -pstocks_pass -ustocks_user stocks| pv | gzip > stocks_database.sql.gz
@palashkulsh
palashkulsh / syncing with grive
Last active September 20, 2019 09:15
grive sync list
#we need to find a better way to sync
grive -d -u
###now using
https://pypi.org/project/drive-cli/
@palashkulsh
palashkulsh / Kafka commands.md
Created March 8, 2018 09:43 — forked from vkroz/Kafka commands.md
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

wget percona.com/get/pt-query-digest
chmod 755 pt-query-digest
tcpdump -s 65535 -x -nn -q -tttt -i any -c 400000 port 3306 | pt-query-digest --type tcpdump --output slowlog
@palashkulsh
palashkulsh / grep_without_node_modules.sh
Created March 6, 2018 10:22
grep something in nodejs project without looking in node_modules folder
find . -iname "*.js" -not -path "./node_modules/*" -exec grep --color -H "merchant-model" {} \;
@palashkulsh
palashkulsh / compressing images
Created March 4, 2018 07:53
compressing images using imagemagik
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% source.jpg result.jpg
@palashkulsh
palashkulsh / using adb for radio debugging andtroid
Created February 15, 2018 06:20
using adb logcat for debugging android calls
adb logcat -b radio
@palashkulsh
palashkulsh / aws_tag_by_ip.sh
Created November 24, 2017 10:20
get aws tags of private ip address using aws cli and jq
#ip.csv file should have single column of private ip
cat ip.csv | xargs -I {} aws ec2 describe-instances --filter Name=private-ip-address,Values={} | jq --arg tag1 "Service" --arg tag2 "Team" '.Reservations[].Instances[] | "\(.PrivateIpAddress) , \(.Tags[]| select(.Key==$tag1) | .Value) , \(.Tags[]| select(.Key==$tag2) | .Value)"' > ip_service_team.csv
for i in {1..13}; do echo $(date -I -d "2017-10-10 +$i days"); done | xargs -I {} -P 1 node ../new_download_pib.js {}
#! /bin/bash/python2.7
from datadog import initialize, api
import pdb
import sys
options = {
'api_key': 'YOUR API KEY',
'app_key': 'YOUR APP KEY'
}
initialize(**options)