Skip to content

Instantly share code, notes, and snippets.

View philcryer's full-sized avatar
💭
Mostly harmless

Phil Cryer philcryer

💭
Mostly harmless
View GitHub Profile
@philcryer
philcryer / gist:7089685
Last active December 26, 2015 03:59
Need to put proxy into .curlrc during bootstrap so curl can get install.sh from chef and get started - but when it writes it into the .curlrc file, it contains 'unsupported trailing garbage' so it doesn't work
** I have the bootstrap_proxy set in knife.rb
$ cat .chef/knife.rb | tail -n1
knife[:bootstrap_proxy] = "http://111.111.111.9:8080"
** in bootstrap/chef-full.erb I tell it to write it to ~/.curlrc
(
cat <<'EOP'
<%= "http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" %>
EOP
@philcryer
philcryer / gist:7202672
Last active December 26, 2015 19:39
Install Ruby, rbenv, rubygems, chef, virtualbox, vagrant on OS X (10.9, Mavericks)
## Install RUBY
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
brew install rbenv
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
brew install ruby-build
rbenv install —list
rbenv install 1.9.3-p448
rbenv global 1.9.3-p448
@philcryer
philcryer / gist:7439401
Created November 12, 2013 21:48
[CHEF] error creating jenkins user with the sudo cookbook
[...CONFIG...]
user "jenkins" do
supports :manage_home => true
comment "The Jenkins user that handles all deploys"
home "/home/jenkins"
shell "/bin/bash"
password "12341234"
end
node['authorization']['sudo']['include_sudoers_d'] = true
include_recipe "sudo"
@philcryer
philcryer / gist:7549743
Created November 19, 2013 18:10
chef-client keeps randomly failing. I login to the node, stop chef-client, run it manually, and it works. 1) Why is it timing out on NTP, 4 times in a row? 2) Why doesn't it fix itself on the next run? It seems to fail, and then never recover.
[...full client.log output...]
[2013-11-19T09:31:05-06:00] INFO: Forking chef instance to converge...
[2013-11-19T09:31:05-06:00] INFO: *** Chef 11.6.0 ***
[2013-11-19T09:31:06-06:00] INFO: Run List is [role[base], role[web], recipe[logging], recipe[app-website]]
[2013-11-19T09:31:06-06:00] INFO: Run List expands to [base, web, logging, app-website]
[2013-11-19T09:31:06-06:00] INFO: Starting Chef Run for website03.corpycorp.com
[2013-11-19T09:31:06-06:00] INFO: Running start handlers
[2013-11-19T09:31:06-06:00] INFO: Start handlers complete.
[2013-11-19T09:31:06-06:00] INFO: Loading cookbooks [apache2, app-website, apt, aws, base, build-essential, chef-client, chef-varnish, chef_handler, couchbase, cron, database, dmg, drush, firewall, git, line, logging, logrotate, mysql, nfs, ntp, openssl, php, postgresql, runit, splunk_cookbook, sudo, ufw, users, web, windows, xfs, xml, yum, zabbix]
[2013-11-19T09:31:07-06:00] WARN: Cloning resource attributes for service[apache2] from prior resource (CHEF-3694)
@philcryer
philcryer / gist:8319780
Last active January 2, 2016 14:49
OSX apps I use for work and play
$ ls -1 ~/software/osx-apps/
Adium_1.5.8.dmg
AdobeFlashPlayerInstaller_11_ltrosxd_aaa_aih.dmg
CitrixReceiverWeb.dmg
Dropbox 2.4.4.dmg
Evernote_402146.dmg
Firefox 24.0.dmg
Flux.zip
Gimp-2.8.6p1-MountainLion.dmg
HandBrake-0.9.9-MacOSX.6_GUI_x86_64.dmg
@philcryer
philcryer / gist:8500594
Created January 19, 2014 04:49
chef-client issue - not sure what's up - took yum and yum::epel out of the cook books too, restarted chef-server, same issue.
# chef-client
Starting Chef Client, version 11.6.0
resolving cookbooks for run list: ["base", "web", "logging", "app-ctscom"]
Synchronizing Cookbooks:
- sudo
- users
- line
- nfs
- yum
- windows
@philcryer
philcryer / gist:8696300
Last active April 7, 2016 19:34
for the past week, running chef-client in my QA environment stalls for ~5mins... I cut out cookbooks, took out environments, and then built a new chef-server, but the problem persists.
chef-client -l debug
====
[2014-01-29T14:08:44-06:00] DEBUG: Sending HTTP Request via POST to dc2mgmtdpsqa01.mgmt.sdirect:443/reports/nodes/dc2ctscomqa01.mgmt.sdirect/runs
[2014-01-29T14:08:44-06:00] DEBUG: ---- HTTP Status and Header Data: ----
[2014-01-29T14:08:44-06:00] DEBUG: HTTP 1.1 404 Object Not Found
[2014-01-29T14:08:44-06:00] DEBUG: server: nginx/1.4.4
[2014-01-29T14:08:44-06:00] DEBUG: date: Wed, 29 Jan 2014 20:08:50 GMT
[2014-01-29T14:08:44-06:00] DEBUG: content-type: text/html
[2014-01-29T14:08:44-06:00] DEBUG: transfer-encoding: chunked
[2014-01-29T14:08:44-06:00] DEBUG: connection: close
@philcryer
philcryer / goose-lift.sh
Last active August 29, 2015 13:56
goose-lift is a strangely named, simple backup script that handles backing up a docroot and a mysql database, copying the files to a remote server via scp and (optionally) emailing a report. It's not doing much error checking, so configure it and run it manually first. I've had to rewrite this enough times over the years to make it worth having …
#!/bin/bash
set -e
#######################################################
## goose-lift is a strangely named simple backup script
## ----------------------------------------------------
## * modify variables below to match your needed values
## * create an ssh key, and transfer it via ssh-copy-id
## * set cron example 00 11 * * 0,2,4,6 ~/goose-lift.sh
## * you are all done, start goose-lifting your server!
@philcryer
philcryer / install_GO_ubuntu.sh
Last active August 29, 2015 13:58
I installed Go (golang) in Ubuntu 13.10, but the available package currently installs version 1.1.2, while I need at least 1.2 for a project. Online HOWTOs were weak, and or outdated, but I found this script online. I fixed some errors in it and then posted it here to share. As always, read the script to understand what it does before you run it…
#!/bin/bash
# Save the pwd
cwd=`pwd`
# Set the env
cat >> ~/.profile << EOT
export GOROOT=$HOME/go
export GOOS=linux
#export GOARCH=`arch`
#NOTE: last line errors with: go tool dist: unknown $GOARCH x86_64 - hard-coding for great justice!
export GOARCH=amd64
@philcryer
philcryer / gist:10026288
Last active August 29, 2015 13:58
Trying to ssh out, via Squid, to a Digital Ocean droplet. Notice Squid is running locally on :80, and SSH on the droplet is :22
➜ ssh 107.170.89.168 -vvv
OpenSSH_6.2p2 Ubuntu-6ubuntu0.2, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/phil/.ssh/config
debug1: /home/phil/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec corkscrew 127.0.0.1 80 107.170.89.168 22
debug1: permanently_drop_suid: 1000
debug3: Incorrect RSA1 identifier