Skip to content

Instantly share code, notes, and snippets.

View orihomie's full-sized avatar
:octocat:

Orkhan orihomie

:octocat:
View GitHub Profile
@codeinthehole
codeinthehole / userdata.sh
Created February 2, 2016 21:21
Terraform config for an EC2 instance with a replaceable EBS volume
#!/bin/bash
DEVICE=/dev/$(lsblk -n | awk '$NF != "/" {print $1}')
FS_TYPE=$(file -s $DEVICE | awk '{print $2}')
MOUNT_POINT=/data
# If no FS, then this output contains "data"
if [ "$FS_TYPE" = "data" ]
then
echo "Creating file system on $DEVICE"
@devStepsize
devStepsize / slack_webhook_post.py
Last active December 14, 2024 22:20
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests
@nkapliev
nkapliev / getftree.sh
Created June 28, 2016 16:12
Amazing fractal tree on bash
# @see https://www.hackerrank.com/challenges/fractal-trees-all
# Creating a Fractal Tree from Y-shaped branches
#
# This challenge involves the construction of trees, in the form of ASCII Art.
#
# We have to deal with real world constraints, so we cannot keep repeating the pattern infinitely.
# So, we will provide you a number of iterations, and you need to generate the ASCII version
# of the Fractal Tree for only those many iterations (or, levels of recursion). A few samples are provided below.
#
# Input Format
@meitei11
meitei11 / nginx-logs-template.json
Created September 11, 2018 11:48
Sample elasticsearch index template for nginx logs
_template/template_nginx_access_log
{
"index_patterns" : "*-nginx-access*",
"order" : 1,
"settings" : {
"number_of_shards" : 2,
"number_of_replicas" : 0,
"codec" : "best_compression"
},
"mappings" : {