Skip to content

Instantly share code, notes, and snippets.

View wjimenez5271's full-sized avatar

William Jimenez wjimenez5271

  • San Jose, CA
  • 20:09 (UTC -07:00)
View GitHub Profile
input {
lumberjack {
port => 5043
# The paths to your ssl cert and key
ssl_certificate => "mycert"
ssl_key => "mykey"
}
}
filter {
Reading config file {:file=>"logstash/agent.rb", :level=>:debug, :line=>"326", :method=>"local_config"}
Compiled pipeline code:
@inputs = []
@filters = []
@outputs = []
@periodic_flushers = []
@shutdown_flushers = []
@input_lumberjack_1 = plugin("input", "lumberjack", LogStash::Util.hash_merge_many({ "port" => 5043 }, { "ssl_certificate" => ("/opt/mycert.crt") }, { "ssl_key" => ("/opt/mykey.key") }))
@wjimenez5271
wjimenez5271 / check_tmux_session.sh
Last active August 29, 2015 14:21
check_tmux_session.sh
if ! { [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; } then
sessions="$(tmux list-sessions 2> /dev/null)"
if [ $? -eq 0 ]
then
echo "------------- you have open tmux sessions --------------"
echo "$sessions"
echo "--------------------------------------------------------"
fi
fi
@wjimenez5271
wjimenez5271 / wemo_data_sample.csv
Created June 26, 2015 17:02
wemo_data_sample.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 7 in line 1.
Exported Data for WeMo Insight
Last Updated,Device Name,Device MAC,Signal Strength (%),Energy Cost per kWh,Currency,Threshold (Watts)
2015/06/25 21:58,WeMo Insight,EC1A59F7EF3C,31,0.11100,$,8
Daily Usage Summary
Date,Time ON (Hours:Minutes),Power Consumption ON (kWh),Time STANDBY (Hours:Minutes),Power Consumption STANDBY (kWh),Average Day Connected Device is ON (Hours),Average Power When ON (Watts),Estimated Monthly Cost,Day's Cost,Energy Cost per kWh
2015/06/25,1:0,0.06486,0:58,0.00084,2.77423,66,0.62344,0.00729,0.11100
2015/06/24,3:31,0.22614,0:28,0.00120,2.75671,66,0.62661,0.02524,0.11100
2015/06/23,2:44,0.17470,1:15,0.00000,2.73232,67,0.62963,0.01939,0.11100
2015/06/22,0:0,0.00000,3:59,0.00000,2.72940,66,0.63269,0.00000,0.11100
@wjimenez5271
wjimenez5271 / keybase.md
Created July 18, 2015 17:15
keybase.md

Keybase proof

I hereby claim:

  • I am wjimenez5271 on github.
  • I am wjimenez5271 (https://keybase.io/wjimenez5271) on keybase.
  • I have a public key whose fingerprint is 0CE3 E8BD E183 CE16 6166 D898 1FCE 33EC 418F 4FD7

To claim this, I am signing this object:

actions :create
default_action :create
attribute :user, :name_attribute => true, :kind_of => String,
:required => true
attr_accessor :exists
5 provisioner:
6 name: chef_solo
7 client_rb:
8 node_name: foo-bar01
21 resp, err := client.CreateImage(create_image_opts)
22 es, ok := err.(ec2.Error)
23 if ok {
24 log.Print(fmt.Sprintf(es.Code))
25 } else {
26 log.Print(fmt.Sprintf("No value for response Code"))
27 }
@wjimenez5271
wjimenez5271 / read_aws_credentials.py
Created January 13, 2016 22:54
Simple python 2.7 implementation of a config reader for ~/.aws/credentials file
def get_profile_credentials(profile_name):
from ConfigParser import ConfigParser
from ConfigParser import ParsingError
from ConfigParser import NoOptionError
from ConfigParser import NoSectionError
from os import path
config = ConfigParser()
config.read([path.join(path.expanduser("~"),'.aws/credentials')])
try:
aws_access_key_id = config.get(profile_name, 'aws_access_key_id')
---> Making bundle: dynbinary (in bundles/1.11.2/dynbinary)
Building: bundles/1.11.2/dynbinary/docker-1.11.2
# github.com/ugorji/go/codec
2016/07/01 18:00:55 writing output: write $WORK/github.com/ugorji/go/codec.a: no space left on device
make: *** [cross] Error 1