Skip to content

Instantly share code, notes, and snippets.

View pmoranga's full-sized avatar

Pmoranga pmoranga

View GitHub Profile
@bradleyboy
bradleyboy / create_koken.sh
Last active December 19, 2024 04:10
Docker script for Koken
#!/bin/bash
echo ""
# Root check
if [[ "$UID" -ne 0 ]]; then
echo "!! This script requires root privileges. sudo ./create_koken.sh"
echo ""
exit
fi
@eerien
eerien / shaco.py
Last active January 4, 2022 18:23
Zabbix screen reporting script by using Selenium. It send email includes screenshot of pre-defined Zabbix screen. You can use this for periodical statistics report with Cron.
#!/usr/bin/python
#-*- coding: utf-8 -*-
# Install
# apt-get install xvfb python-imaging (firefox or chromium-chromedriver)
# pip install selenium pyvirtualdisplay boto
import sys
import os
import socket
@digital-wonderland
digital-wonderland / README.md
Last active April 6, 2022 17:22
Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet

What

Unit files to deploy an ElasticSearch cluster on CoreOS via Fleet.

Service discovery & registration is done via etcd.

[email protected] provides a dumb discovery service by registering an elasticsearch host if it should be up. [email protected] registers the service only if it is running.

A service & timer unit for elasticsearch curator is provided which does some housekeeping.

@gordonbisnor
gordonbisnor / nginx.conf
Created November 10, 2014 23:41
Nginx Conf Example Where Multiple Apps Deployed (Based on Talking Quickly book and blog posts)
upstream unicorn_thisapp {
server unix:/tmp/unicorn.<%= fetch(:full_app_name) %>.sock fail_timeout=0;
}
server {
server_name <%= fetch(:server_name) %>;
listen 80;
root <%= fetch(:deploy_to) %>/current/public;
location ^~ /assets/ {
This is a simple OpenVPN setup, with shared HTTPS port. To set up your own Certificate Authority, the easiest way is to follow: https://openvpn.net/index.php/open-source/documentation/howto.html#pki.
Once everything is set up, distribute client.ovpn + client's crt + client's key to each client and everything should work.
@montanaflynn
montanaflynn / proxy.go
Last active June 10, 2025 01:42
Golang reverse proxy
package main
import (
"log"
"net/http"
"net/http/httputil"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
@jewelia
jewelia / gist:595200aae5f9a437a634
Last active August 29, 2015 14:12
Books: 2014 retrospective and to-read for 2015

Many of my friends have shared their reading lists of all the books they read in 2014 (thank you!) -- this gave me some excellent ideas of books to read for 2015.

So I have decided to share my reading list as well, and the list of books I plan to read in 2015. If you have any ideas for additional books, I'd love them (especially in the topic areas of business, finance, nonfiction).

Favorite books I read in 2014:

  • The Hard Thing About Hard Things: Building a Business When There Are No Easy Answers by Ben Horowitz
  • The Everything Store: Jeff Bezos and the Age of Amazon by Brad Stone
  • The Effective Executive: The Definitive Guide to Getting the Right Things Done by Peter F Drucker
  • Zero to One: Notes on Startups, or How to Build the Future by Peter Thiel
@jewelia
jewelia / gist:0b8f26e91f2818bef460
Last active August 29, 2015 14:15
3 Great Engineering Management Talks from 2014

General key themes:

  • Hiring is really hard. You’re not just hiring a “Rails Engineer” or a “Python Programmer” you’re hiring someone who can help you change the world. Tell them why! Talk about the hard problems you’re solving. 2/3 of these talks give ideas and insight into hiring from sourcing to actual interview processes.

  • Rewriting systems is hard. People think they are going to replace their broken down horse and buggie with a bullet train and this often ends up in disaster. Successful rewrites require an incremental approach that takes months/years and often runs way over schedule. 2/3 of these talks go over how to handle rewrites not only from a high level technical perspective but a cultural/management perspective as well.

Two Developers, Many Lines of Code, and A Campaign that Made History

Harper Reed (CTO of Obama for America, now CEO of Modest) and Dylan Richard (Director of Eng of Obama for America, now CTO of Modest)

<?php
/**
*
*
* @source https://gist.github.com/andypotanin/edad00eb3ff1c2a31f70
*/
header( 'cache-control:no-cache,no-store,private' );
die(json_encode(array(
# Transactions with parent-child relationships.
# Delete the index, just in case it still exists.
DELETE /myindex
# Create the index with a mapping for the actual documents and a mapping for the parent transaction type.
PUT /myindex
{
"mappings": {
"transaction": {