cat count.txt | awk '{sum+=$1} END {print sum}'
linux: netstat -lnptu
mac: netstat -a -p tcp
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
require 'fileutils' | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
box = { | |
:django_fwd => 9000, | |
:elasticsearch_fwd => 9200, |
master: localhost | |
file_client: local | |
file_roots: | |
base: | |
- /srv/salt/base | |
dev: | |
- /srv/salt/dev | |
- /srv/salt/base | |
qa: |
get-pip: | |
file.managed: | |
- name: /usr/local/sbin/get-pip.py | |
- source: https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | |
- source_hash: md5=3f120892a637a59a9c497d516eb2ca76 | |
cmd.run: | |
- name: /usr/bin/python /usr/local/sbin/get-pip.py | |
- unless: which pip | |
- require: |
import sys | |
import SimpleHTTPServer | |
import SocketServer | |
try: | |
PORT = int(sys.argv[1]) | |
except IndexError: | |
PORT = 8888 | |
class EchoHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): |
{% set instance_type = grains.get('instance_type', '') %} | |
{% set logstash_servers = salt['pillar.get'](instance_type + ':logstash_servers') %} | |
{% set logstash_paths = salt['pillar.get'](instance_type + ':logstash_paths') %} | |
{% set logstash_fields = salt['pillar.get'](instance_type + ':logstash_fields') %} | |
{% if logstash_servers and logstash_paths and logstash_fields %} | |
{ | |
"network": { | |
"servers": {{ logstash_servers|json }} |
#!/bin/bash | |
# | |
# steps taken verbatim from: | |
# http://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker | |
# | |
sudo yum update -y | |
sudo yum install -y docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user | |
# log out and log in to pickup the added group |
"""Simple script to read stdin postgresql csv logs and output the SQL statements | |
To use, do something like this: | |
tail -f /path/to/your/postgres.log | python -u parse-postgresql-logs.py | |
""" | |
import csv | |
import sys |
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP) | |
while True: | |
input_state = GPIO.input(18) | |
if input_state == False: |
from setuptools import setup, find_packages | |
setup( | |
name = 'calculator_service', | |
packages=find_packages(), | |
version = '1.0', | |
description = 'Example application with Servant', | |
author='Brian Zambrano', | |
author_email='[email protected]', | |
classifiers=[ |