Skip to content

Instantly share code, notes, and snippets.

View einyx's full-sized avatar

alessio einyx

  • PID 1
View GitHub Profile
# -*- mode: ruby -*-
# vi: set ft=ruby :
require File.join(File.dirname(__FILE__), 'lib', 'root.rb')
Vagrant.configure("2") do |config|
puppetbase = "~/Dropbox/puppet-playground/"
config.vm.box = "dummy"
config.ssh.username = "alessiog"
config.vm.hostname = "jenkins.test"
config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
config.vm.define :customerapi do |customerapi|
puppetbase = "~/Dropbox/puppet-playground/"
config.vm.box = "dummy"
config.ssh.username = "ubuntu"
config.vm.hostname = "customerapi.test"
config.vm.box_url = "https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box"
customerapi.vm.provider :aws do |aws, override|
aws.user_data = File.read("user_data.txt")
(redash)alessiog@ip-10-2-2-76:/opt/redash/redash$ cat redash/settings.py
import json
import os
import urlparse
def parse_db_url(url):
url_parts = urlparse.urlparse(url)
connection = {
'engine': 'peewee.PostgresqlDatabase',
require 'rubygems'
require 'aws-sdk'
r53 = AWS::Route53.new
# unique id - could be the instance id
instance_name = 'webserver-autoscaling-{unique-id}.example.org'
public_ip = '123.123.123.123'
hosted_zone_id = 'ABC123'
#!/usr/bin/env ruby
require 'aws-sdk'
require 'net/http'
AWS.config({})
hostname = ARGV[0].to_s
domain = 'i.domain.com'
zone = ''
ttl = 60
Running /usr/bin/nodejs /etc/statsd/localConfig.js log
/etc/statsd/localConfig.js:3
graphiteHost: "127.0.0.1",
^
SyntaxError: Unexpected token :
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

Keybase proof

I hereby claim:

  • I am einyx on github.
  • I am einyx (https://keybase.io/einyx) on keybase.
  • I have a public key whose fingerprint is 191E D385 31DC EFEA 9AD1 DB96 C8D3 437A 3E11 FBFF

To claim this, I am signing this object:

@einyx
einyx / gist:573d53a6d087df6a40b2
Last active August 29, 2015 14:20
force bluetooth restart on mac
All of the following will require sudo if run from the command line:
defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 0
#set bluetooth pref to off
defaults write /Library/Preferences/com.apple.Bluetooth.plist ControllerPowerState 1
#set bluetooth pref to on
DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch x86_64 -arch i386 -pipe -I/usr/include/libxml2 -I/private/var/folders/0b/fjlqmqr15y5755cl1kqsj1700000gn/T/pip-build-9egv3x/lxml/src/lxml/includes -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.10-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace
In file included from src/lxml/lxml.etree.c:239:
/private/var/folders/0b/fjlqmqr15y5755cl1kqsj1700000gn/T/pip-build-9egv3x/lxml/src/lxml/includes/etree_defs.h:14:10: fatal error: 'libxml/xmlversion.h' file not found
#include "libxml/xmlversion.h"
^
1 error generated.
error: command 'cc' failed with exit status 1
================ SOLUTION
@einyx
einyx / gist:d77406f7dfd5ae5f79f4
Last active August 29, 2015 14:21
ssl iam aws
openssl genrsa -out something-staging.pem 2048
openssl req -sha256 -new -key something-staging.pem -out something-staging.csr
openssl x509 -req -days 3650 -in something-staging.csr -signkey something-staging.pem -out something-staging-self.pem
aws iam upload-server-certificate --server-certificate-name something-staging --certificate-body file://something-staging-self.pem --private-key file://something-staging.pem