Skip to content

Instantly share code, notes, and snippets.

View subodhp's full-sized avatar

Subodh Pachghare subodhp

View GitHub Profile
@shunsukeaihara
shunsukeaihara / to_elasticsearch.js
Last active June 15, 2020 03:48
lambda script for kinesis firehose with cloudwatch logs
'use strict';
const zlib = require('zlib');
const AWS = require('aws-sdk');
function transformLogEvent(payload, logEvent) {
var source = buildSource(logEvent.message, logEvent.extractedFields);
source['@id'] = logEvent.id;
source['@timestamp'] = new Date(1 * logEvent.timestamp).toISOString();
source['@message'] = logEvent.message;
@estorgio
estorgio / Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS.md
Last active March 8, 2024 17:34
Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

Update 28 July 2019: An updated version of this guide for Ubuntu Server 18.04 LTS is now available. Feel free to check it out.

Update 23 May 2020: This guide is ALREADY OUTDATED and might no longer work with new versions of Ubuntu and VirtualBox. Please consider switching to the updated guide instead. I will no longer respond to the replies to this gist. Thank you.

Mounting VirtualBox shared folders on Ubuntu Server 16.04 LTS

This guide will walk you through steps on how to setup a VirtualBox shared folder inside your Ubuntu Server guest. Tested on Ubuntu Server 16.04.3 LTS (Xenial Xerus)

@ryu1kn
ryu1kn / Makefile
Last active March 19, 2023 13:02
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
KEY_ID=alias/my-key
SECRET_BLOB_PATH=fileb://my-secret-blob
SECRET_TEXT="my secret text"
ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
encrypt-text:
@real666maverick
real666maverick / Dockerfile.centos7-systemd
Last active October 7, 2021 22:45
inhuman playing with systemd (fedora and centos supported)
FROM centos:latest
# based on http://developers.redhat.com/blog/2014/05/05/running-systemd-within-docker-container/
MAINTAINER maverick <real666maverick@gmail.com>
RUN yum -y update; yum clean all
RUN yum -y install systemd; yum clean all; \
(cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/multi-user.target.wants/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/local-fs.target.wants/*; \
rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
@uffsalot
uffsalot / collectd.conf
Created July 16, 2016 12:23
sample collectd.conf
FQDNLookup true
Interval 120
LoadPlugin syslog
<Plugin syslog>
LogLevel info
</Plugin>
LoadPlugin disk
@dastergon
dastergon / ec2_info_retriever.py
Last active April 23, 2024 09:19
A basic boto3 based tool for retrieving information from running EC2 instances.
from collections import defaultdict
import boto3
"""
A tool for retrieving basic information from the running EC2 instances.
"""
# Connect to EC2
ec2 = boto3.resource('ec2')
@iMilnb
iMilnb / boto3_hands_on.md
Last active October 19, 2022 09:15
Programmatically manipulate AWS resources with boto3 - a quick hands on

boto3 quick hands-on

This documentation aims at being a quick-straight-to-the-point-hands-on AWS resources manipulation with [boto3][0].

First of all, you'll need to install [boto3][0]. Installing it along with [awscli][1] is probably a good idea as

  • [awscli][1] is boto-based
  • [awscli][1] usage is really close to boto's
@iMilnb
iMilnb / ec2.py
Created May 27, 2015 12:29
AWS EC2 simple manipulation script using python and boto3
#!/usr/bin/env python
# Simple [boto3](https://github.com/boto/boto3) based EC2 manipulation tool
#
# To start an instance, create a yaml file with the following format:
#
# frankfurt:
# - subnet-azb:
# - type: t2.micro
# image: image-tagname
@stucchio
stucchio / basic_income_monte_carlo.py
Last active August 28, 2021 01:42
Monte carlo simulation of basic income/basic job calculations, from blog.
from pylab import *
from scipy.stats import *
num_adults = 227e6
basic_income = 7.25*40*50
labor_force = 154e6
disabled_adults = 21e6
current_wealth_transfers = 3369e9
def jk_rowling(num_non_workers):