Skip to content

Instantly share code, notes, and snippets.

View elebertus's full-sized avatar

elebertus elebertus

View GitHub Profile
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
<!-- Console Appender -->
<appender name="stdout-appender" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.EnhancedPatternLayout">
<param name="ConversionPattern" value="%-5p | %d{MM-dd-yyyy HH:mm:ss.SSS} | %t | %c(0) - %m%n"/>
</layout>
action :sqlite3_gem do
begin
require 'sqlite3'
rescue LoadError
package "sqlite-devel" do
action :install
end
gem "sqlite3" do
action :install
#!/usr/bin/env ruby
require 'sqlite3'
db = SQLite3::Database.new( "test.db")
begin
db.query("SELECT * from dashboard_dashboard")
rescue
puts "dashboard_dashboard not found\nCreating table dashboard_dashboard\n"
db.execute("CREATE TABLE \"dashboard_dashboard\" (
\"name\" varchar(128) NOT NULL PRIMARY KEY,
\"state\" text NOT NULL);"
# LAX -> linode
[root@eblack-vagrant01 mtr-0.82]# mtr brofist.net --report-cycles 30 --report
HOST: eblack-vagrant01 Loss% Snt Last Avg Best Wrst StDev
1.|-- 10.0.2.2 0.0% 30 0.4 2.1 0.2 42.3 7.7
2.|-- 1-1-12-12.attalascom.net 0.0% 30 4.2 3.1 1.1 32.5 5.7
3.|-- cpe-76-173-0-1.socal.res. 0.0% 30 33.9 33.9 22.9 62.2 8.9
4.|-- tge7-1.wlvgcabn-cer02.soc 0.0% 30 17.6 15.5 11.5 32.5 5.0
5.|-- tge0-8-0-8.vnnycajz-ccr01 3.3% 30 23.5 27.4 18.5 78.6 13.1
6.|-- 72.129.13.0 0.0% 30 19.0 25.1 17.5 51.9 7.6
7.|-- 107.14.19.32 0.0% 30 21.6 24.3 16.7 52.7 7.0
action :start_stop do
begin
@new_resource.start_service(node[:service_status][:state])
rescue
Chef::Log.warn("----------")
Chef::Log.warn("Application default state is missing. Defaulting to start the service. If this cluster or service should not automatically start defined node[:service_status][:state]")
Chef::Log.warn("----------")
@new_resource.start_service("start")
@new_resource.env_state("start")
foo = node[:ntp][:test]
template "foo.conf" do
source "foo.conf.erb"
variables( :foobar => foo[:platform])
end
function prompt {
local bc="\[\e[0m\]"
local ob="\[\e[1;31m\][\]"
local cb="\[\e[1;31m\]]\]"
local spc="\[\e[0;32m\]"
local host="\[\e[30;34m\]\u@\h\]"
local lwd="\[\e[30;34m\]\w\]"
export PS1="$ob"$bc"$host"$bc"$cb"$bc"$spc:$ob"$bc"$lwd"$bc"$cb"$bc""$spc"$"$bc" "
}
prompt
# Up the kernel's SHMMAX
raisit = execute "raise_tha_roof" do
if ["t1.micro","c1.medium","m1.small"].include? node[:ec2][:instance_type] then
shmmax=1073741824
else
shmmax=17179869184
end
command "sysctl -w kernel.shmmax=#{shmmax}"
end
yum erase $(yum list installed | grep ruby | awk '{printf $1" "}' | sed -e 's/libselinux-ruby.x86_64//g' -e 's/\.x86_64//g') && cd /tmp ; curl -O http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz && tar xzf ruby-1.9.2-p290.tar.gz && cd ruby-1.9.2-p290 && ./configure && make && make install && gem i chef && wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-5.noarch.rpm && rpm -i epel-release-6-5.noarch.rpm && mkdir /var/cache/chef ; mkdir /var/cache/chef/cookbooks
#!/usr/bin/env perl
# -*- perl -*-
# location of the server-side scp we want to run
$scp_server = "/usr/bin/scp";
sub fail {
my ($msg) = @_;
print STDERR $msg, "\n";
exit 1;