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
#to get id of vpn run | |
#nmcli con | |
#!/bin/bash | |
if [ "$1" = 'd' ]; | |
then | |
nmcli con down id VPN_USERNAME > /dev/null & | |
else | |
echo 'vpn.secrets.password':`oathtool --base32 --totp "SECRET"`>/tmp/pwd && nmcli con up id VPN_USERNAME passwd-file /tmp/pwd >/dev/null & | |
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
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 \; |
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
I've been trying to get started with json in c++ and i think i've finally found out a way. | |
Following are the steps. | |
run the following command and it will download the library to a folder | |
git clone https://github.com/miloyip/rapidjson | |
This will clone the following repo which provides json usage in c++ | |
now make a new folder where you will be writing your c++ code | |
now copy the rapidjson/include/rapidjson to your project folder you made in step 4 | |
now your folder should have YOUR_FOLDER_NAME/rapidjson present in it.we will use this directory to include rapidjson library in our file | |
now copy the attached file in your project folder you made in step 4 | |
compile the file using g++ testing.cpp |
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 find all forks of a github repository | |
http://forked.yannick.io/ |
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
#! /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) |
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
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 {} |
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
#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 |
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
adb logcat -b radio |
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
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 85% source.jpg result.jpg |
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
find . -iname "*.js" -not -path "./node_modules/*" -exec grep --color -H "merchant-model" {} \; |
OlderNewer