Skip to content

Instantly share code, notes, and snippets.

@tinderfields
Last active October 5, 2015 19:28

Revisions

  1. tinderfields revised this gist Feb 3, 2015. 1 changed file with 8 additions and 12 deletions.
    20 changes: 8 additions & 12 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner

    # Get packages
    apt-get -y update
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev ruby ruby-dev
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev ruby ruby-dev chef
    gem install chef ruby-shadow --no-ri --no-rdoc

    #Install pg and mysql gem later
    @@ -14,28 +14,24 @@ gem install chef ruby-shadow --no-ri --no-rdoc
    root@Ubuntu-1204-precise-64-minimal ~ # ruby -v
    ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
    root@Ubuntu-1204-precise-64-minimal ~ # chef-solo -v
    Chef: 0.10.10
    Chef: 11.8.2
    exit


    # CD to chef dir and
    rsync -r . hetzner:/etc/chef
    ssh hetzner "chef-solo"
    #You may need to create and grant permissions on the /etc/chef and /var/chef dir if your user is not root


    # Once setup with librarian use
    librarian-chef install && rsync -r . hetzner:/etc/chef && ssh hetzner "chef-solo"

    # CD to chef dir, check server then
    ./push
    # Ideally we could set this up with scripts as per http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/

    Had to change user deployer to create first before manage in databags/user/deployer.json

    ---

    Had to run the following commands on the server
    mkdir /etc/ssl_certs
    chmod 750 /etc/ssl_certs/
    chown root.ssl-cert /etc/ssl_certs/

    Also had to change user deployer to create first before manage


    Had to muck around with passenger
    /usr/local/rvm/gems/ruby-1.8.7-p371@passenger/gems/passenger-4.0.44 # cp buildout/apache2/mod_passenger.so ext/apache2/
  2. tinderfields revised this gist Jun 30, 2014. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -5,8 +5,10 @@ ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner

    # Get packages
    apt-get -y update
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev ruby
    gem install chef ruby-shadow mysql pg --no-ri --no-rdoc
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev ruby ruby-dev
    gem install chef ruby-shadow --no-ri --no-rdoc

    #Install pg and mysql gem later

    # Check installs
    root@Ubuntu-1204-precise-64-minimal ~ # ruby -v
    @@ -19,6 +21,8 @@ exit
    # CD to chef dir and
    rsync -r . hetzner:/etc/chef
    ssh hetzner "chef-solo"
    #You may need to create and grant permissions on the /etc/chef and /var/chef dir if your user is not root


    # Once setup with librarian use
    librarian-chef install && rsync -r . hetzner:/etc/chef && ssh hetzner "chef-solo"
  3. tinderfields revised this gist Jun 19, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -45,3 +45,5 @@ http://stackoverflow.com/questions/15349869/undefined-method-source-index-for-ge
    gem update --system 1.8.25

    For the senate site I had to: add tmp/rates/exchange_rates.xml

    Also had to add /home/deployer/.aws/access_key and secret_key for backup
  4. tinderfields revised this gist Jun 5, 2014. 1 changed file with 9 additions and 19 deletions.
    28 changes: 9 additions & 19 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,28 +1,20 @@
    root@Ubuntu-1204-precise-64-minimal ~ #
    apt-get -y update
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
    cd /tmp
    # Look at getting the latest version
    wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
    tar -xvzf ruby-1.9.3-p125.tar.gz
    cd ruby-1.9.3-p125/
    ./configure --prefix=/usr/local
    make
    make install
    gem install chef ruby-shadow mysql --no-ri --no-rdoc
    # Add entry to .ssh/config
    # See: http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
    brew install ssh-copy-id
    ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner

    # Get packages
    apt-get -y update
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev ruby
    gem install chef ruby-shadow mysql pg --no-ri --no-rdoc

    # Check installs
    root@Ubuntu-1204-precise-64-minimal ~ # ruby -v
    ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
    root@Ubuntu-1204-precise-64-minimal ~ # chef-solo -v
    Chef: 0.10.10
    exit

    # Add entry to .ssh/config
    brew install ssh-copy-id
    ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner
    # See
    http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/

    # CD to chef dir and
    rsync -r . hetzner:/etc/chef
    @@ -41,8 +33,6 @@ chown root.ssl-cert /etc/ssl_certs/

    Also had to change user deployer to create first before manage

    Had to to add pg and mysql gem: gem install pg mysql

    Had to muck around with passenger
    /usr/local/rvm/gems/ruby-1.8.7-p371@passenger/gems/passenger-4.0.44 # cp buildout/apache2/mod_passenger.so ext/apache2/

  5. tinderfields revised this gist Jun 5, 2014. No changes.
  6. tinderfields revised this gist Jun 4, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -52,4 +52,6 @@ chmod g+w /var/www/sites/

    For the orbit gemset I had to:
    http://stackoverflow.com/questions/15349869/undefined-method-source-index-for-gemmodule-nomethoderror
    gem update --system 1.8.25
    gem update --system 1.8.25

    For the senate site I had to: add tmp/rates/exchange_rates.xml
  7. tinderfields revised this gist Jun 3, 2014. 1 changed file with 22 additions and 1 deletion.
    23 changes: 22 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -31,4 +31,25 @@ ssh hetzner "chef-solo"
    # Once setup with librarian use
    librarian-chef install && rsync -r . hetzner:/etc/chef && ssh hetzner "chef-solo"

    # Ideally we could set this up with scripts as per http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/
    # Ideally we could set this up with scripts as per http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/


    Had to run the following commands on the server
    mkdir /etc/ssl_certs
    chmod 750 /etc/ssl_certs/
    chown root.ssl-cert /etc/ssl_certs/

    Also had to change user deployer to create first before manage

    Had to to add pg and mysql gem: gem install pg mysql

    Had to muck around with passenger
    /usr/local/rvm/gems/ruby-1.8.7-p371@passenger/gems/passenger-4.0.44 # cp buildout/apache2/mod_passenger.so ext/apache2/

    Had to mkdir /var/www/sites
    chown www-data.admin /var/www/sites/
    chmod g+w /var/www/sites/

    For the orbit gemset I had to:
    http://stackoverflow.com/questions/15349869/undefined-method-source-index-for-gemmodule-nomethoderror
    gem update --system 1.8.25
  8. tinderfields revised this gist Oct 9, 2012. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -30,3 +30,5 @@ ssh hetzner "chef-solo"

    # Once setup with librarian use
    librarian-chef install && rsync -r . hetzner:/etc/chef && ssh hetzner "chef-solo"

    # Ideally we could set this up with scripts as per http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/
  9. tinderfields revised this gist Jun 26, 2012. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -24,6 +24,9 @@ ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner
    # See
    http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/

    #CD to chef dir and
    # CD to chef dir and
    rsync -r . hetzner:/etc/chef
    ssh hetzner "chef-solo"

    # Once setup with librarian use
    librarian-chef install && rsync -r . hetzner:/etc/chef && ssh hetzner "chef-solo"
  10. tinderfields revised this gist Jun 12, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ cd ruby-1.9.3-p125/
    ./configure --prefix=/usr/local
    make
    make install
    gem install chef ruby-shadow --no-ri --no-rdoc
    gem install chef ruby-shadow mysql --no-ri --no-rdoc


    root@Ubuntu-1204-precise-64-minimal ~ # ruby -v
  11. tinderfields revised this gist Jun 12, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,7 @@ root@Ubuntu-1204-precise-64-minimal ~ #
    apt-get -y update
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
    cd /tmp
    # Look at getting the latest version
    wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
    tar -xvzf ruby-1.9.3-p125.tar.gz
    cd ruby-1.9.3-p125/
  12. tinderfields revised this gist Jun 9, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -24,5 +24,5 @@ ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner
    http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/

    #CD to chef dir and
    rsync -r . hetzner:/var/chef
    rsync -r . hetzner:/etc/chef
    ssh hetzner "chef-solo"
  13. tinderfields revised this gist Jun 9, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -25,4 +25,4 @@ http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-passwor

    #CD to chef dir and
    rsync -r . hetzner:/var/chef
    ssh hetzner "chef-solo -c /var/chef/solo.rb"
    ssh hetzner "chef-solo"
  14. tinderfields revised this gist Jun 7, 2012. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -15,8 +15,6 @@ root@Ubuntu-1204-precise-64-minimal ~ # ruby -v
    ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
    root@Ubuntu-1204-precise-64-minimal ~ # chef-solo -v
    Chef: 0.10.10

    mkdir /var/chef
    exit

    # Add entry to .ssh/config
  15. tinderfields revised this gist Jun 5, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -20,6 +20,7 @@ mkdir /var/chef
    exit

    # Add entry to .ssh/config
    brew install ssh-copy-id
    ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner
    # See
    http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
  16. tinderfields revised this gist Jun 5, 2012. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -16,4 +16,14 @@ ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
    root@Ubuntu-1204-precise-64-minimal ~ # chef-solo -v
    Chef: 0.10.10

    mkdir /var/chef
    mkdir /var/chef
    exit

    # Add entry to .ssh/config
    ssh-copy-id -i ~/.ssh/id_rsa.pub hetzner
    # See
    http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/

    #CD to chef dir and
    rsync -r . hetzner:/var/chef
    ssh hetzner "chef-solo -c /var/chef/solo.rb"
  17. tinderfields created this gist Jun 3, 2012.
    19 changes: 19 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    root@Ubuntu-1204-precise-64-minimal ~ #
    apt-get -y update
    apt-get -y install build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev
    cd /tmp
    wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
    tar -xvzf ruby-1.9.3-p125.tar.gz
    cd ruby-1.9.3-p125/
    ./configure --prefix=/usr/local
    make
    make install
    gem install chef ruby-shadow --no-ri --no-rdoc


    root@Ubuntu-1204-precise-64-minimal ~ # ruby -v
    ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]
    root@Ubuntu-1204-precise-64-minimal ~ # chef-solo -v
    Chef: 0.10.10

    mkdir /var/chef