This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 \<aws/\1/\2\></td>\n<td>\3(var-name,"icon heading")</td></tr>\n\n_g' >> /tmp/awstest.html && echo "</tbody></table>" >> /tmp/awstest.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#how to backup database | |
mysqldump -v -hlocalhost -pstocks_pass -ustocks_user stocks| pv | gzip > stocks_database.sql.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install calibre | |
ebook-convert file.epub file.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
put this file in .git/hooks/prepare-commit-msg file and run chmod 755 .git/hooks/prepare-commit-msg file . this prepends the branch name in the commit msg. it is useful when you have to mention jira id in every commit. then you can make a branch name with jira id in it and branch name would be prepended in every commit msg. | |
#!/bin/sh | |
BRANCH=`git branch | grep '^\*' | cut -b3-` | |
FILE=`cat "$1"` | |
echo "$BRANCH $FILE" > "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo -e "\\n\"start,name,qry_rtio,http_opn,srch_rej,bulk_rej,heap_usd_pcnt,heap_cmmt_diff,old_gc_count,ld1,fd_evic,disk_q,disk_time,net_out2_retrans_ratio,net_in2_err_ratio,end\"" && curl -s -XGET localhost:9200/_nodes/stats?pretty | jq '.nodes[] | "start\",\(.name),\(.indices.search.query_time_in_millis/(.indices.search.query_total+1)|floor),\(.http.total_opened),\(.thread_pool.search.rejected),\(.thread_pool.bulk.rejected),\(.jvm.mem | .heap_used_percent),\(.jvm.mem|.heap_committed_in_bytes - .heap_max_in_bytes),\(.jvm.gc.collectors.old.collection_count),\(.os.load_average[1]),\(.indices.fielddata.evictions),\(.fs.total.disk_queue),\(.fs.total.disk_service_time),\((.network.tcp.retrans_segs /.network.tcp.out_segs)*100|floor),\((.network.tcp.in_errs / .network.tcp.in_segs)*100|floor),\"end"' | column -t -s, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)"' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -s 'https://endpoint/orders/mktorders-49*/_mapping' | jq '.' | jq '.[].mappings.items.properties |keys[]' | sort|uniq | sed 's/"//g' | xargs -I {} sh -c "if ! grep -q {} config/staging/elasticsearch_mapping.txt ; then echo {} ;fi;" \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//http://astexplorer.net/#/84e8ZqEAwQ/6 | |
//http://www.datasciencecentral.com/profiles/blogs/write-code-to-rewrite-your-code-jscodeshift?utm_content=buffer598df&utm_medium=social&utm_source=linkedin.com&utm_campaign=buffer | |
//https://github.com/reergymerej/jscodeshift-article | |
//https://vramana.github.io/blog/2015/12/21/codemod-tutorial/ | |
//https://github.com/benjamn/recast | |
function extractNodes(node){ | |
if (node.type === 'FunctionDeclaration') { | |
var arr=[]; | |
arr.concat(extractNodes(node.left)); |