Skip to content

Instantly share code, notes, and snippets.

View jtimberman's full-sized avatar
🚀

Joshua Timberman jtimberman

🚀
View GitHub Profile

Easy one line Chef installation for all platforms (except windows)

curl https://www.opscode.com/chef/install.sh | sudo bash

That's it. This can be put in any instructions, such as a README or someone's blog, since the logic is in the shell script. Provided you download the script using https, the file has standard levels of authentication and encryption protecting it from manipulation.

This is obviously a shell script, if you're really concerned about the argument that it may contain nefarious activities within, you can easily review it before you run it.

@jtimberman
jtimberman / client.rb
Created March 2, 2012 17:58 — forked from fnichol/macosx_bootstrap.sh
Mac OS X 10.7 (Lion) Bootstrapping
ssl_verify_mode :verify_peer
ssl_ca_file CA_FILE
log_level :info
log_location STDOUT
chef_server_url 'SERVER_URL'
validation_client_name 'ORGNAME-validator'
node_name 'NODE_NAME'
base_dir = "#{ENV['HOME']}/.chef"
#!/usr/bin/env ruby
recipe_path = ARGV[0]
if recipe_path.nil?
STDERR.puts "usage: chef-apply RECIPE_FILE"
exit 1
end
recipe_path = File.expand_path(recipe_path)
@jtimberman
jtimberman / command line
Created October 31, 2009 19:37 — forked from auxesis/command line
shell script testing with cucumber
bin/cucumber --require features/ features/example-script.feature
@jtimberman
jtimberman / nginx.conf
Created March 5, 2010 21:01 — forked from johnthethird/nginx.conf
nginx front end for Riak
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;
@jtimberman
jtimberman / gist:639638
Created October 21, 2010 23:56 — forked from btm/gist:639581
different ways to get interface IPs
$ grep 'node\[:network\]\[:interfaces\].' \#chef.log
10:15 < mkent_> node[:network][:interfaces][:eth1][:addresses]
22:24 <+Damm> msf, just pulling in the node[:network][:interfaces] attributes
20:44 < randybias> node[:network][:interfaces][:eth0][:addresses]
09:13 < sinBot> so fujin if I wanted to use that in an erb template, it'd be <%= @node[:network][:interfaces]["en1"]["addresses"].select{address}.flatten.to_str %> ?
12:27 < cwj> if i have an ipv4 ip address set on eth0, will it always be in @node[:network][:interfaces][:eth0][1] ?
02:19 < pluesch0r> however, i don't seem to be able to access @node[:network][:interfaces]... from inside the attributes file.
19:52 <@jtimberman> or node[:network][:interfaces][:eth0][:addresses][0]
20:09 < seryl> well, it's searchable. I'm trying the @node[:network][:interfaces][:eth0][:addresses][0] route, but getting blanks right now, playing around with it in chef solo
20:29 < kallistec> pp node[:network][:interfaces].current_attribute
@jtimberman
jtimberman / gist:420eca4c2986e458120f963b80227bd5
Created May 1, 2018 22:30 — forked from spudbean/gist:1558257
Look of disapproval and other emoticons
ಠ_ಠ
( ͡° ͜ʖ ͡°)
¯\_(ツ)_/¯
(╯°□°)╯︵ ┻━┻
http://www.fileformat.info/convert/text/upside-down.htm
WRTTN http://wrttn.me/30dbfd/
Unicode Emoticons
#!/bin/sh
#Provides add-apt-repository
sudo apt-get install -y python-software-properties
#use jtimberman's chef ppa for installation
sudo add-apt-repository ppa:jtimberman/opschef
sudo apt-get update
sudo apt-get upgrade -y
#This step asks for a chef server url to put in /etc/chef/client.rb
sudo apt-get install -y chef
@jtimberman
jtimberman / dynamic-fonts.el
Last active May 23, 2016 17:08 — forked from arnab/dynamic-fonts.el
Dynamically adjust fonts in emacs based on screen resolution (Retina vs. Thunderbolt)
;; Gist-ed from in https://github.com/arnab/emacs-starter-kit
(defun fontify-frame (frame)
(interactive)
(if window-system
(progn
(if (> (x-display-pixel-width) 2000)
(set-frame-parameter frame 'font "Inconsolata 19") ;; Cinema Display
(set-frame-parameter frame 'font "Inconsolata 16")))))
#!/bin/bash
# user-data-hardening.sh
# Authors: Cody Bunch (bunchc@gmail.com)
#
# Script intended to be supplied as userdata to a cloud of some flavor.
# Enables some sane sysctl defaults, turns up iptables, and
# installs a HIDS / NIDS package
# Supply your email here
email_address="userdata@mailinator.com"