Skip to content

Instantly share code, notes, and snippets.

View junaid18183's full-sized avatar

Juned Memon junaid18183

View GitHub Profile
@junaid18183
junaid18183 / collaborator api
Last active April 4, 2017 05:05 — forked from marchampson/collaborator api
Add collaborator from command line
curl -i -u "my_user_name:my_password" -X PUT -d '' 'https://api.github.com/repos/my_gh_userid/my_repo/collaborators/my_collaborator_id'
@junaid18183
junaid18183 / Dockerfile
Created April 6, 2017 11:21
how to do docker healthcheck using Goss
From busybox
COPY goss.yaml /tmp/goss.yaml
COPY goss /usr/local/bin/
COPY goss-serve /usr/local/bin/
HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
CMD /usr/local/bin/goss --gossfile /tmp/goss.yaml v --format documentation
@junaid18183
junaid18183 / backup-github.sh
Created September 6, 2017 11:35 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
# NOTE: if you have more than 100 repositories, you'll need to step thru the list of repos
# returned by GitHub one page at a time, as described at https://gist.github.com/darktim/5582423
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
@junaid18183
junaid18183 / gist:17c5b94e38a3072722440051074c9b5d
Created January 8, 2018 09:21 — forked from cktricky/gist:8f4e9912f757d1ccdcd00ad8e8630620
Lambda Function to Alert (Slack) of Unauthorized IAM Attempt
var AWS = require('aws-sdk');
var url = require('url');
var https = require('https');
var hookUrl, kmsEncyptedHookUrl, slackChannel;
kmsEncyptedHookUrl = 'abcd1234'; // Enter the base-64 encoded, encrypted key (CiphertextBlob)
slackChannel = 'example_channel'; // Enter the Slack channel to send a message to
var postMessage = function(message, callback) {
@junaid18183
junaid18183 / vault_ssh_otp_demo.sh
Last active May 10, 2020 11:11
vault_ssh_otp_demo
#!/bin/bash
download_vault(){
wget https://releases.hashicorp.com/vault/0.9.1/vault_0.9.1_linux_amd64.zip?_ga=2.165144251.566422628.1516357846-2059600638.1516357846 -O vault_0.9.1_linux_amd64.zip
apt-get install -y zip
unzip vault_0.9.1_linux_amd64.zip
mv vault /usr/local/bin/
rm vault_0.9.1_linux_amd64.zip
}
########################
download_ssh_helper(){
@junaid18183
junaid18183 / taint_module.sh
Created February 15, 2018 05:47 — forked from justinclayton/taint_module.sh
Terraform: taint all resources from one module
#!/bin/bash
module=$1
for resource in `terraform show -module-depth=1 | grep module.${module} | tr -d ':' | sed -e 's/module.${module}.//'`; do
terraform taint -module ${module} ${resource}
done
@junaid18183
junaid18183 / check_vpn_status.py
Created March 9, 2018 13:06 — forked from mjbommar/check_vpn_status.py
This script monitors and logs to CSV the status of all tunnels for all VPNs for a single EC2 region.
'''
@author Bommarito Consulting, LLC; http://bommaritollc.com/
@date 20131029
This script monitors and logs to CSV the status of all tunnels for all VPNs for a single EC2 region.
'''
# Imports
import boto
import boto.ec2
import boto.vpc
@junaid18183
junaid18183 / ssm-cft.json
Last active April 3, 2018 07:35
CFT template to create the Sample Lambda which takes config value from SSM Parameter
{
"AWSTemplateFormatVersion": "2010-09-09",
"Metadata": {
"AWS::CloudFormation::Interface": {
"ParameterGroups": [
{
"Label": {
"default": "HelloWorld Parameters"
},
"Parameters": [
@junaid18183
junaid18183 / sssd_on_redhat.sh
Last active November 28, 2018 13:29
sssd_on_redhat
#https://mapr.com/support/s/article/How-to-configure-LDAP-client-by-using-SSSD-for-authentication-on-CentOS?language=en_US
#https://gist.github.com/mazgi/3dbfe99fb2b3e8d1e50b
#http://www.ateam-oracle.com/part-3-of-4-sssd-linux-authentication-implementation-step-by-step-guideline/
yum install openldap openldap-clients sssd sssd-client
cp /etc/openldap/ldap.conf /etc/openldap/ldap.conf.orig
> /etc/openldap/ldap.conf
cat << EOF > /etc/openldap/ldap.conf
BASE dc=example,dc=com
@junaid18183
junaid18183 / keybase.md
Created April 1, 2020 05:38
keybase.md

Keybase proof

I hereby claim:

  • I am junaid18183 on github.
  • I am junaid18183 (https://keybase.io/junaid18183) on keybase.
  • I have a public key whose fingerprint is 125A B028 4F43 4538 0570 9A8A B7C1 868E 3994 DA9E

To claim this, I am signing this object: