Skip to content

Instantly share code, notes, and snippets.

View cparedes's full-sized avatar

Ian Paredes cparedes

View GitHub Profile
@cparedes
cparedes / gist:1233555
Created September 21, 2011 22:55
I win
err: Could not apply complete catalog: Found dependency cycles in the following relationships:
File[/var/lib/postgresql] => File[/var/lib/postgresql/backups], Package[postgresql-9.0] =>
File[/var/lib/postgresql/backups], Exec[move /var/lib/postgresql] => File[/var/lib/postgresql],
Package[postgresql-9.0] => Exec[move /var/log/postgresql], File[/etc/postgresql] => Mount[/etc/postgresql],
Exec[move /etc/postgresql] => File[/etc/postgresql], Package[postgresql-9.0] =>
Exec[move /etc/postgresql-common], File[/etc/postgresql-common] => Mount[/etc/postgresql-common],
File[/var/log/postgresql] => Package[postgresql-9.0], File[/var/lib/postgresql] => Package[postgresql-9.0],
File[/etc/postgresql-common] => Package[postgresql-9.0], Exec[move /etc/postgresql-common] =>
Package[postgresql-9.0], Exec[move /etc/postgresql] => Package[postgresql-9.0], Mount[/etc/postgresql-common]
=> Package[postgresql-9.0], Mount[/var/log/postgresql] => Package[postgresql-9.0],
Thu Apr 7 12:46:36 [initandlisten] recover create file /srv/data/mongodb/local.ns 16MB
Thu Apr 7 12:46:37 [initandlisten] recover create file /srv/data/mongodb/local.0 2047MB
Thu Apr 7 12:48:43 [initandlisten] recover create file /srv/data/mongodb/local.1 2047MB
Thu Apr 7 12:50:46 [initandlisten] recover create file /srv/data/mongodb/local.2 2047MB
Thu Apr 7 12:52:29 [initandlisten] recover create file /srv/data/mongodb/local.3 2047MB
$ knife data bag from file admins cparedes.json
/Library/Ruby/Gems/1.8/gems/chef-0.10.0.beta.5/lib/chef/knife.rb:323:in `load_from_file': uninitialized constant Chef::Role (NameError)
from /Library/Ruby/Gems/1.8/gems/chef-0.10.0.beta.5/lib/chef/knife/data_bag_from_file.rb:66:in `run'
from /Library/Ruby/Gems/1.8/gems/chef-0.10.0.beta.5/lib/chef/knife.rb:157:in `run'
from /Library/Ruby/Gems/1.8/gems/chef-0.10.0.beta.5/lib/chef/application/knife.rb:114:in `run'
from /Library/Ruby/Gems/1.8/gems/chef-0.10.0.beta.5/bin/knife:25
from /usr/bin/knife:19:in `load'
from /usr/bin/knife:19
$ knife --version
not_if do
result = 1
if File.exists?(file)
iptables_file = IO.read(file).split("\n")
grepped_val = iptables_file
params.each_value do |val|
grepped_val = grepped_val.grep(/#{val}/)
result = 1 if grepped_val.empty?
end
result = 0
@cparedes
cparedes / syslog-ng.conf
Created January 19, 2011 21:49
syslog-ng.conf
options {
sync (0);
time_reopen (10);
log_fifo_size (1000);
long_hostnames (off);
use_dns (no);
use_fqdn (no);
create_dirs (yes);
keep_hostname (yes);
log_msg_size(8192);
@cparedes
cparedes / client.rb
Created January 19, 2011 21:47
client.rb
require 'rubygems'
require 'syslog_logger'
Chef::Log.logger = SyslogLogger.new("ruby-chef-client")
log_level :info
log_location STDOUT
chef_server_url "REDACTED"
validation_client_name "REDACTED"
node_name "REDACTED"
Ohai::Config[:plugin_path] << '/etc/chef/ohai_plugins'
@cparedes
cparedes / client.rb
Created January 19, 2011 19:02
client.rb
require 'syslog_logger'
Chef::Log.logger = SyslogLogger.new('chef')
log_level :info
#log_location STDOUT
chef_server_url "REDACTED"
validation_client_name "REDACTED"
node_name "node.REDACTED.com"
Ohai::Config[:plugin_path] << '/etc/chef/ohai_plugins'
@cparedes
cparedes / syslog-ng.conf
Created January 19, 2011 19:01
Relevant portions of the syslog-ng.conf file
...
source s_sys {
file ("/proc/kmsg" log_prefix("kernel: "));
unix-stream ("/dev/log");
internal();
# udp(ip(0.0.0.0) port(514));
};
...
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, "ree"
set :rvm_type, :system
# Your Applications "Name"
set :application, "vertu"
# The URL to your applications repository
set :repository, "git@github.com:sholton311/Vertu.git"