Skip to content

Instantly share code, notes, and snippets.

View dvopsway's full-sized avatar

Padmakar Ojha dvopsway

View GitHub Profile
@dvopsway
dvopsway / athena.py
Created October 18, 2018 05:45 — forked from quiver/athena.py
query SQL to Amazon Athena and save its results from Amazon S3 Raw
#!/usr/bin/env python
# vim: set fileencoding=utf8 :
```
$ pip install -U boto3 retrying
$ export AWS_DEFAULT_PROFILE=test
$ cat foo.sql
select count(*)
from bar
$ python athena.py foo.sql
$ ls -1
@dvopsway
dvopsway / 1_kubernetes_on_macOS.md
Created April 27, 2018 07:05 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@dvopsway
dvopsway / change_hostname.sh
Created February 12, 2017 16:29
Change hostname centos
#!/usr/bin/env bash
OLD_HOSTNAME="$( hostname )"
NEW_HOSTNAME="$1"
if [ -z "$NEW_HOSTNAME" ]; then
echo -n "Please enter new hostname: "
read NEW_HOSTNAME < /dev/tty
fi
#!/bin/sh
############################################################################################################################
# Name : setup_elk.sh #
# Purpose : Setup elasticsearch, kibana , logstash and nginx and congure them #
# ------ ------------------- ------------------------------ --------------------------------------- #
# Ver Date Author Description #
# ------ ------------------- ------------------------------ --------------------------------------- #
# 1.0 6-Jan-16 Padmakar Ojha Initial Development of script #
############################################################################################################################
@dvopsway
dvopsway / autoscaling_boto.py
Last active September 10, 2015 12:55 — forked from numan/autoscaling_boto.py
Example of setting up AWS auto scaling using boto API
"""
The MIT License (MIT)
Copyright (c) 2011 Numan Sachwani
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
<?php
// Lives at html/pages/device/graphs/asa-sessions.inc.php
if ($device['os'] == "asa" || $device['os_group'] == "firewall")
{
$graph_title = "Firewall Sessions";
$graph_type = "asa_sessions";
include("includes/print-device-graph.php");