Skip to content

Instantly share code, notes, and snippets.

View saiyam1814's full-sized avatar
🎯
Focusing

Saiyam Pathak saiyam1814

🎯
Focusing
View GitHub Profile
@saiyam1814
saiyam1814 / gitissues.py
Created January 15, 2018 16:16
Exports Issues from a GIT repository to a CSV file Raw
"""
Exports Issues from a GIT repository to a CSV file
you can also change the status from open to all or closed to get specific issue list
TO USE:
-use your GitHub Usernam and Token in GITHUB_USER and GITHUB_PASSWORD respectively
-give the repository name in REPO
-run the file python gitissues.py
You are all set !!
"""
import csv
@saiyam1814
saiyam1814 / inactiveuserlist.sh
Created January 15, 2018 16:18
Inactive user list in DTR Raw
#!/usr/bin/env bash
#Below will create a inactive.txt file with names of inactive users.
#change the username and password to proper one
#replace {DTRURL} with actual DTR URL
curl -u "$1":"$2" https://{DTRURL}/enzi/v0/accounts?limit=1000000 | jq '.accounts[] | select(.isActive == false)'| jq '.name' > inactive.txt
@saiyam1814
saiyam1814 / curlflow.sh
Created January 15, 2018 16:20
This is the curl command for posting to flowdock Raw
# Replace FLOWTOKEN with actual Token
# get token for different flows from : https://www.flowdock.com/account/tokens
curl -X POST \
https://api.flowdock.com/v1/messages/chat/FLOWTOKEN \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: 6d81aa94-23d1-3999-c28b-c82012acd002' \
-d '
{
@saiyam1814
saiyam1814 / dockerinstallation.txt
Created February 1, 2018 10:48
Docker Ubuntu Installation
export http_proxy="http://proxyURL/"
export https_proxy="http://proxyURL/"
wget --no-check-certificate -q -O - https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
sudo mkdir -p /etc/systemd/system/docker.service.d
@saiyam1814
saiyam1814 / dockerinstallation.txt
Created February 1, 2018 10:48
Docker Ubuntu Installation
export http_proxy="http://proxyURL/"
export https_proxy="http://proxyURL/"
wget --no-check-certificate -q -O - https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
apt-cache policy docker-ce
sudo apt-get install -y docker-ce
sudo systemctl status docker
sudo mkdir -p /etc/systemd/system/docker.service.d
@saiyam1814
saiyam1814 / How To run MAVEN commands as Jenkins User
Created May 29, 2018 02:10
How To run MAVEN commands as Jenkins User
You might encounter into an issure where you are running a Jenkins Job and you have Maven commands in that and you might be facing 2 types of issues:
1) mvn command not found
2) cannot create the repository
So if you just have installed maven as root so you need to change the settings.xml
go to settings.xml and put <localRepository>/var/lib/jenkins/.m2/repository</localRepository>
also export the environment variables.
export M2_HOME=/usr/local/apache-maven-3.5.3
export PATH=$PATH:$M2_HOME/bin
export JAVA_HOME=/opt/jdk1.8.0_171
#!/usr/bin/env bash
if [ "$#" -ne 1 ]
then
echo "Usage: $0 <db_name>"
exit 1
fi
db_name=$1
@saiyam1814
saiyam1814 / k3supazure
Last active April 22, 2020 18:58
This is the gist for setting up k3s using k3sup on Azure
# Create 2 VMS and have the networking opend 22,80,443,6443 with user as app
# ssh into the instance that you want to make the master for k3s and Run Following commands. Alsocopy the key in /root/.ssh/id_rsa
# SERVER_IP = ip address of master vm
# AGENT_IP = ip address of worker vm
curl -sLS https://raw.githubusercontent.com/alexellis/k3sup/master/get.sh | sh
Export SERVER_IP=ipaddr
Export USER=app
Export AGENT_IP=ipaddr
k3sup install --ip $SERVER_IP --user $USER
export KUBECONFIG=`pwd`/kubeconfig
kubectl create ns istio-system
kubectl label namespace default istio-injection=enabled
kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.3/samples/bookinfo/platform/kube/bookinfo.yaml
kubectl apply -f https://raw.githubusercontent.com/chrisurwin/rancher-istio/master/istio-gateway.yaml
kubectl apply -f https://raw.githubusercontent.com/chrisurwin/rancher-istio/master/istio-bookinfo-vs.yaml
echo "body boom" | mail -S smtp="xx.xx.xx.xx:xx" -r "sender" -s "Subject" -v <recipient email address>