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 / download_full_website_using_wget.sh
Last active July 15, 2017 19:07
Downloading entire website using wget
wget -l 1 --recursive --page-requisites --html-extension --domains elastic.co --no-parent https://www.elastic.co/guide/en/logstash/current/
--page-requisites > all css pics and all that
--html-extension > files downloaded with html extenstion
--domains > scrape files only of this domain
--no-parent > don't follow links outside the directory https://www.elastic.co/guide/en/logstash/current/.
converting website to pdf
find ../www.elastic.co/guide/en/logstash/current/ -iname "*.html" -exec electron-pdf {} {}.pdf \;
how to find all forks of a github repository
http://forked.yannick.io/
#! /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)
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 {}
@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 / 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 / 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" {} \;
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 / 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

@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