Skip to content

Instantly share code, notes, and snippets.

View vladwa's full-sized avatar
👨‍💻
Dev, Ops and everything in between

Vinayaka V Ladwa vladwa

👨‍💻
Dev, Ops and everything in between
View GitHub Profile
@mugifly
mugifly / docker-clean.sh
Created August 18, 2016 07:17
Cleanup Script for Docker Images and Containers
#!/bin/sh
echo -e "-- Removing exited containers --\n"
docker ps --all --quiet --filter="status=exited" | xargs --no-run-if-empty docker rm --volumes
echo -e "\n\n-- Removing untagged images --\n"
docker rmi --force $(docker images | awk '/^<none>/ { print $3 }')
echo -e "\n\n-- Removing volume directories --\n"
docker volume rm $(docker volume ls --quiet --filter="dangling=true")
@ivanitskiy
ivanitskiy / gist:c5fdddce7180dcf7bfc962e545fea1bf
Created November 15, 2016 01:18 — forked from ombre42/gist:cb6bc804c876a7f07c45
email template for Robot Framework test results
<%
import java.text.DateFormat
import java.text.SimpleDateFormat
%>
<STYLE>
BODY, TABLE, TD, TH, P {
font-family:Verdana,Helvetica,sans serif;
font-size:11px;
color:black;
}
@tlhakhan
tlhakhan / ansible-rpm-build.sh
Last active December 3, 2019 19:53
Ansible - Building RPM
#!/bin/bash
#
# let's make an ansible rpm for offline deployment
#
yum makecache
yum -y update
# rpm build deps
@vladwa
vladwa / PostRestReponse.py
Last active December 30, 2017 11:48
Python code to make HTTP post request. This function returns Response object.
# importing the requests library
import requests
def getPostRestResponse(restUrl,inputRequest,contentType):
"""Sends a POST request.
:param url: URL for the new :class:`Request` object.
:param inputRequest: Data to send in the body of the request.
:return: :class:`Response <Response>` object.
"""
content = {'content-type': contentType}
@rezamt
rezamt / gcloud-fiters.sh
Created December 2, 2018 00:53
GCloud Filter Examples
List all Google Compute Engine instance resources:
$ gcloud compute instances list
List Compute Engine instance resources that have machineType f1-micro:
$ gcloud compute instances list --filter="machineType:f1-micro"
List Compute Engine instance resources with zone prefix us and not
MachineType f1-micro:
@vladwa
vladwa / gcpComputeInstanceDetails.py
Last active July 21, 2020 07:56
Python code snippet to fetch the compute instance details by connecting to Google API Client using Python client library for Google's discovery.
#vars
# SERVICE_ACCOUNT_FILE --> Service Account Json file
# project --> Gcp Project Name
# zone --> zone in which instance is created
# instance_name --> Instance name
from google.oauth2 import service_account
from googleapiclient import discovery
SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]