This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sequel.migration do | |
up do | |
run 'CREATE EXTENSION "uuid-ossp"' | |
create_table :products do | |
column :id, :uuid, :default => Sequel.function(:uuid_generate_v4), :primary_key => true | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
MY_SERVER="192.168.0.150" | |
#Solution 1 | |
#VPN_GW=$(ifconfig | grep -A2 ppp | grep inet | awk '{print $4}') | |
##Add route to host only | |
#sudo route add -host $MY_SERVER $VPN_GW |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Idempotent way to build a /etc/hosts file with Ansible using your Ansible hosts inventory for a source. | |
# Will include all hosts the playbook is run on. | |
# Inspired from http://xmeblog.blogspot.com/2013/06/ansible-dynamicaly-update-etchosts.html | |
- name: "Build hosts file" | |
lineinfile: dest=/etc/hosts regexp='.*{{ item }}$' line="{{ hostvars[item].ansible_default_ipv4.address }} {{item}}" state=present | |
when: hostvars[item].ansible_default_ipv4.address is defined | |
with_items: groups['all'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
## This is called to back up the WAL files to the slave. | |
## This is on top of replication and is used as another | |
## method to secure data successfully transferring from one | |
## database server to another. | |
ARCHIVE_DIR_ON_SLAVE="/var/lib/postgresql/walfiles" | |
LOG=1 | |
LOG_FILE="/tmp/postgres_wal_archiving.log" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parents | |
include Anima.new(:mother_name, :father_name) | |
end | |
person_hash = { name: "eduardo", :parents=>#<Parents mother_name="Mary" father_name="Joe"> } | |
class PersonHashToNewHash < ::ROM::Mapper | |
relation :person | |
register_as :person_to_new_hash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'transproc/all' | |
require 'addressable/uri' | |
## | |
# Convert string keys to symbols | |
# | |
transform = Transproc(:symbolize_keys) | |
data = { | |
'name' => 'Mark Rickerby', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# /etc/rc.d/init.d/is24-statsd | |
# | |
# Starts the is24 statsd daemon | |
# | |
# chkconfig: 2345 20 80 | |
# description: Frontend aggregatation of messages destined for graphite daemon | |
# processname: is24-statsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: carbon-cache | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: carbon-cache init script | |
# Description: An init script for Graphite's carbon-cache daemon. | |
### END INIT INFO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# GITLAB | |
# Maintainer: @randx | |
# App Version: 3.0 | |
# Modified by @eduardodeoh (Start GITLAB Resque only) | |
### BEGIN INIT INFO | |
# Provides: gitlab | |
# Required-Start: $local_fs $remote_fs $network $syslog redis-server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: GitLab git repository management | |
# Description: GitLab git repository management | |
### END INIT INFO | |
APP_ROOT="/opt/graphite/webapp/graphite" | |
NAME="gunicorn-graphite" | |
DESC="Gunicorn Workers" |
OlderNewer