Skip to content

Instantly share code, notes, and snippets.

@caio2k
caio2k / 0-self-publishing.md
Created July 25, 2021 15:16 — forked from caseywatts/0-self-publishing.md
Self-Publishing via Markdown
@caio2k
caio2k / config.ini
Last active May 14, 2018 22:20 — forked from parkerlreed/config.ini
Support Surface Pro onboard buttons in Debian 9
; Example configuration file for inputexec
[DEFAULT]
; ---traceback : Include full stack trace on exception
#traceback =
## Source
[source]
; --source-file : The source to read from (e.g /dev/input/event0)
file = /dev/input/by-id/usb-MICROSOFT_SAM_0.1.0000-if01-event-mouse
@caio2k
caio2k / README.md
Created February 12, 2018 14:49 — forked from iMilnb/README.md
AWS Terraform configuration: Stream CloudWatch Logs to ElasticSearch

Rationale

This snippet is a sample showing how to implement CloudWatch Logs streaming to ElasticSearch using terraform. I wrote this gist because I didn't found a clear, end-to-end example on how to achieve this task. In particular, I understood the resource "aws_lambda_permission" "cloudwatch_allow" part by reading a couple of bug reports plus this stackoverflow post.

The js file is actually the Lambda function automatically created by AWS when creating this pipeline through the web console. I only added a endpoint variable handling so it is configurable from terraform.

@caio2k
caio2k / install-apache-mesos.sh
Last active August 8, 2017 13:09 — forked from anubhavsinha/install-apache-mesos.sh
Install single node Mesos ( Latest ) cluster on Centos 7.1
sudo yum update
sudo yum install -y tar wget
# Install Mesos dependencies
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
#sudo vi /etc/yum.repos.d/wandisco-svn.repo and add the following content
#[WANdiscoSVN]
#name=WANdisco SVN Repo 1.9
#enabled=1
#baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
#gpgcheck=1
@caio2k
caio2k / README-python-service-on-systemd-activated-socket.md
Created February 10, 2017 09:58 — forked from drmalex07/README-python-service-on-systemd-activated-socket.md
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.

@caio2k
caio2k / pedantically_commented_playbook.yml
Last active June 20, 2016 16:49 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@caio2k
caio2k / oracle_curl.sh
Last active November 29, 2023 02:22 — forked from mvanvuuren/oracle_curl.sh
Download from OTN Oracle
#!/bin/bash
curl -L -O -H "Cookie: oraclelicense=accept-securebackup-cookie" $1
#ORACLE Solaris download links
#http://download.oracle.com/otn/solaris/11.2/sol-11_2-text-sparc.iso
#http://download.oracle.com/otn/solaris/11.2/sol-11_2-text-sparc.usb
#http://download.oracle.com/otn/solaris/11.2/sol-11_2-text-x86.iso
#http://download.oracle.com/otn/solaris/11.2/sol-11_2-text-x86.usb
#http://download.oracle.com/otn/solaris/11.2/sol-11_2-text-x86.iso #c09f40ed91d43b0adf109c124154a2b4
#http://download.oracle.com/otn/solaris/11.2/sol-11_2-vbox.ova #448619f56f48cd6dc7490ce379599f9a
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'yaml'
ANSIBLE_PATH = '.' # path targeting Ansible directory (relative to Vagrantfile)
# Set Ansible roles_path relative to Ansible directory
ENV['ANSIBLE_ROLES_PATH'] = File.join(ANSIBLE_PATH, 'vendor', 'roles')
@caio2k
caio2k / Vagrantfile
Created October 16, 2015 16:02 — forked from tknerr/Vagrantfile
Sample Vagrantfile that works with all providers (virtualbox, aws, managed) and in combination with the vagrant-omnibus plugin
#
# Vagrantfile for testing
#
Vagrant::configure("2") do |config|
# the Chef version to use
config.omnibus.chef_version = "11.4.4"
def configure_vbox_provider(config, name, ip, memory = 384)
config.vm.provider :virtualbox do |vbox, override|
@caio2k
caio2k / Vagrantfile
Last active October 16, 2015 16:13 — forked from damphyr/Vagrantfile
Refactored multiple Vagrant provider configuration (alternative to https://gist.github.com/tknerr/5753319)
#
# Vagrantfile for testing
#
def configure_provider provider,config,cfg_lmbd
config.vm.provider provider do |prvdr,override|
cfg_lmbd.call(prvdr,override)
end
end
def vbox_config name,ip,memory_size=384