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 / tshark_details
Last active February 20, 2019 12:50
using tshark to debug late server hello packets
tshark -E separator=: -r capture.cap -Tfields -e tcp.srcport -e tcp.dstport -e frame.time_epoch -e frame.number -e _ws.col.Info ssl.record.version==0x0303 or ssl.record.version==0x0301 | grep "Hello" | grep -v "Done" > ~/Downloads/tls.csv
@palashkulsh
palashkulsh / backup_mysql
Created June 6, 2019 05:26
backup mysql database
#how to backup database
mysqldump -v -hlocalhost -pstocks_pass -ustocks_user stocks| pv | gzip > stocks_database.sql.gz
@palashkulsh
palashkulsh / using_devicons_plantuml
Created June 14, 2019 17:24
how to use devicons in plantuml
#link to devicons https://github.com/tupadr3/plantuml-icon-font-sprites/blob/master/devicons/index.md
@startuml
' We only include the icon files.
!include <devicons/github>
!include <font-awesome/gitlab>
!include <devicons/redis>
frame redis [
@palashkulsh
palashkulsh / aws_icons_plantuml
Last active June 14, 2019 18:18
how to use aws icons in plantuml
#https://github.com/milo-minderbinder/AWS-PlantUML
##to extract all the alias for usable format use
find dist/ -iname "*.puml" -exec grep -H "\!define " {} \; | sed 's_dist/\(.*\).puml:!define \([A-Z0-9a-z_]*\).*_!include <aws/\1>\n\2(varname,"icon heading")\n\n_g'
##along with file name
find dist/ -iname "*.puml" -exec grep -H "\!define " {} \; | sed 's_dist/\(.*\)/\(.*\).puml:!define \([A-Z0-9a-z_]*\).*_\2\n!include <aws/\1/\2>\n\3(var-name,"icon heading")\n\n_g'
#more good table
echo "" > /tmp/awstest.html && echo "<table><thead><th>name</th><th>Include Statement</th><th>Usage</th></thead><tbody>" >> /tmp/awstest.html && find dist/ -iname "*.puml" -type f \( ! -iname "*common.puml" \) -exec grep -H "\!define " {} \; | sed 's_dist/\(.*\)/\(.*\).puml:!define \([A-Z0-9a-z_]*\).*_<tr>\n<td>\2</td>\n<td>!include \&ltaws/\1/\2\&gt</td>\n<td>\3(var-name,"icon heading")</td></tr>\n\n_g' >> /tmp/awstest.html && echo "</tbody></table>" >> /tmp/awstest.html
@palashkulsh
palashkulsh / plantuml_sprite_from_image
Created June 17, 2019 06:12
resize and make plantuml sprite from image to be used in plantuml diagram
#resize the image to desired size
convert /tmp/consul.png -resize 64x64 /tmp/consul_64.png
# make sprite for plantuml
plantuml -encodesprite 8 /tmp/consul_64.png
sprite $consul [45x64/8] {
0000000000000234CKSaaaaaSSKC32000000000000000
00000000014KaaaaaaaaaaaaaaaaaaaK4200000000000
00000003SaaaaaaZXWOOGGGGOWXYZaaaaaH0000000000
@palashkulsh
palashkulsh / resume.json
Created June 27, 2019 19:13 — forked from thomasdavis/resume.json
{ "theme": "elegant"}
{
"basics": {
"name": "Thomas Davis",
"label": "Web Developer",
"summary": "I’m a full stack web developer who loves working with open source technology. I work best at planning the architecture of web applications and their development life cycles. I also love to get the community involved and have had much experience with building and organizing large open source groups. Specialties: React, Redux, Javascript - Full stack developer with lots of experience in lots of stuff.",
"website": "https://ajaxdavis.com",
"email": "[email protected]",
"location": {
"city": "Melbourne",
"countryCode": "AU"
@palashkulsh
palashkulsh / grafana_PCRE_expression
Created July 31, 2019 09:55
grafana elb filtering pcre expression
/.*loadbalancer\/(?:app\/)?([a-zA-Z0-9-]*)\/?(?:.*)?/
@palashkulsh
palashkulsh / jira_jql_csv.sh
Last active August 13, 2019 08:13
make jira jql in csv
jira jql 1300 -j 1 | jq '.[]| "\(.key),\(.fields.summary),\(.fields.status.name)"' | sed 's/"//' | csvlook -H
@palashkulsh
palashkulsh / prepare-commit-msg
Created September 9, 2019 07:38
.git/hooks/prepare-commit-msg putting branch name in every commit message to avoid manually typing . ch
#!/bin/sh
#chmod +x prepare-commit-msg
BRANCH=`git branch | grep '^\*' | cut -b3-`
FILE=`cat "$1"`
echo "$BRANCH $FILE" > "$1"
@palashkulsh
palashkulsh / custom_telnet.sh
Created September 11, 2019 07:37
custom telnet script for db connection in python
import sys
import socket
s=0
try:
s=socket.create_connection((sys.argv[1],3306),timeout=(1))
except:
s=0
if s:
print("{},yes".format(sys.argv[1]))
else: