Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit 13c3416d31b39ece4239de3680194d435f6f5116 @phlipper committed Apr 27, 2012
Showing with 143 additions and 0 deletions.
  1. +6 −0 .gitignore
  2. +20 −0 LICENSE.txt
  3. +60 −0 README.md
  4. +4 −0 attributes/default.rb
  5. +13 −0 metadata.rb
  6. +29 −0 recipes/default.rb
  7. +11 −0 templates/default/75-personality.erb
@@ -0,0 +1,6 @@
+*.tgz
+*.tar.gz
+vendor/bundle
+.bundle
+.DS_Store
+build/*
@@ -0,0 +1,20 @@
+The MIT License (MIT)
+Copyright © 2012 Phil Cohen <github@phlippers.net>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the “Software”), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
@@ -0,0 +1,60 @@
+# chef-personality
+
+## Description
+
+This cookbook customizes the motd/login feedback (for Ubuntu servers only at the moment) by adding fortunes, read by adorable [`cowsay`](http://www.nog.net/~tony/warez/cowsay.shtml) characters, wrapped up in rainbow [`lolcat`](https://github.com/busyloop/lolcat) sprinkles.
+
+![The cow says...](https://img.skitch.com/20120428-r3365hcrqrjbdhh1nyccan4giw.png)
+
+This was a quick extraction from a larger existing project, so it's a little rough around the edges at the moment. I have had a fair amount of external interest so I'm putting this out in the hopes that more people help make it more awesome.
+
+
+## Requirements
+
+This cookbook currently relies on the excellent [`chef-rvm`](https://github.com/fnichol/chef-rvm) cookbook from @fnichol and assumes a system-level `rvm` install. It would be great if this cookbook were totally standalone someday...
+
+
+### Supported Platforms
+
+The following platforms are supported by this cookbook, meaning that the recipes run on these platforms without error:
+
+* Ubuntu
+
+
+## Recipes
+
+* `personality` - The default recipe.
+
+# Usage
+
+This cookbook sets up a file using the `update-motd.d` system. There's nothing to do beyond that.
+
+
+## Attributes
+
+* `default["personality"]["characters"]` = "default daemon eyes bong ghostbusters beavis.zen bud-frogs calvin cheese cock milk dragon dragon-and-cow elephant gnu head-in stegosaurus turtle tux"
+
+
+## Basic Settings
+
+None
+
+
+## Contributing
+
+This cookbook could have way more personality... Help make it so!
+
+1. Fork it
+2. Create your feature branch (`git checkout -b my-new-feature`)
+3. Commit your changes (`git commit -am 'Added some feature'`)
+4. Push to the branch (`git push origin my-new-feature`)
+5. Create new Pull Request
+
+
+## License
+
+**chef-personality**
+
+* Freely distributable and licensed under the [MIT license](http://phlipper.mit-license.org/2012/license.html).
+* Copyright (c) 2012 Phil Cohen (github@phlippers.net) [![endorse](http://api.coderwall.com/phlipper/endorsecount.png)](http://coderwall.com/phlipper)
+* http://phlippers.net/
@@ -0,0 +1,4 @@
+default["personality"]["characters"] = %w[
+ default daemon eyes bong ghostbusters beavis.zen bud-frogs calvin cheese
+ cock milk dragon dragon-and-cow elephant gnu head-in stegosaurus turtle tux
+].join(" ")
@@ -0,0 +1,13 @@
+name "traceroute"
+maintainer "Phil Cohen"
+maintainer_email "github@phlippers.net"
+license "MIT"
+description "Installs traceroute"
+long_description IO.read(File.join(File.dirname(__FILE__), "README.md"))
+version "1.0.0"
+
+recipe "traceroute", "Installs traceroute"
+
+%w[debian ubuntu].each do |os|
+ supports os
+end
@@ -0,0 +1,29 @@
+#
+# Cookbook Name:: personality
+# Recipe:: default
+#
+# Copyright 2012, Phil Cohen
+#
+
+
+# give our server some personality
+package "cowsay"
+
+# give our personality something to say
+%w[ubuntu-server debian-hints bofh-excuses off spam].each do |pkg|
+ package "fortunes-#{pkg}"
+end
+
+# colorize all the things
+rvm_global_gem "lolcat" do
+ action :install
+end
+
+# motd hook
+template "/etc/update-motd.d/75-personality" do
+ source "75-personality.erb"
+ owner "root"
+ group "root"
+ mode "0755"
+ variables(:characters => node["personality"]["characters"])
+end
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+source /etc/profile.d/rvm.sh
+
+# a little personality
+characters=(<%= @characters %>)
+num_characters=${#characters[*]}
+
+/usr/games/fortune | \
+ /usr/games/cowsay -f ${characters[$((RANDOM%num_characters))]} | \
+ rvm default exec lolcat -f

0 comments on commit 13c3416

Please sign in to comment.