Skip to content

Instantly share code, notes, and snippets.

View ashishmohite's full-sized avatar
😇

Ashish Mohite ashishmohite

😇
View GitHub Profile
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
variable "dest_account_id" {
description = "id of destination AWS account"
type = string
}
data "aws_iam_policy_document" "trust_relationship_document" {
data "aws_caller_identity" "current" {}
data "aws_region" "current" {}
variable "source_account_id" {
description = "id of source AWS account"
type = string
}
data "aws_iam_policy_document" "trust_relationship_document" {

Keybase proof

I hereby claim:

  • I am ashishmohite on github.
  • I am ashishmohite (https://keybase.io/ashishmohite) on keybase.
  • I have a public key ASDqMksF1pjsYg-w14zL_Vtio2msnw_JE2jg-znA9sDNggo

To claim this, I am signing this object:

import json
import subprocess, shlex
private_token = "mytoken"
groups = requests.get("https://[host]/api/v3/groups/?private_token={}".format(private_token)).json()
for group in groups:
print("=============================")
print(group)
projects = requests.get("https://[host]/api/v3/groups/{}/projects?private_token={}".format(group["id"], private_token))
@ashishmohite
ashishmohite / clone_repos.sh
Created April 24, 2018 11:46
How to clone all the repos in the github org
# for hosted enterprize git server
curl -H 'Authorization: token <secret_token>' 'https://[HOST]/api/v3/orgs/[ORG]/repos' | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
#for github
curl -H 'Authorization: token <secret_token>' 'https://api.github.com/orgs/[ORG]/repos' | ruby -rubygems -e 'require "json"; JSON.load(STDIN.read).each { |repo| %x[git clone #{repo["ssh_url"]} ]}'
@ashishmohite
ashishmohite / virtualhost
Last active August 29, 2015 14:03
Automation script for apache virtual host creation
#!/usr/bin/env bash
list() {
echo "-------------------------------------------------------------------------------------------------"
echo "Available virtual hosts:"
echo "-------------------------------------------------------------------------------------------------"
ls -l /etc/apache2/sites-available/
echo "-------------------------------------------------------------------------------------------------"
echo "Enabled virtual hosts:"
echo "-------------------------------------------------------------------------------------------------"
ls -l /etc/apache2/sites-enabled/