Skip to content

Instantly share code, notes, and snippets.

View anveo's full-sized avatar
🤘

Brian Racer anveo

🤘
View GitHub Profile
$ apt-get install nginx
......
unpacking nginx (from .../nginx_1.0.2-0ppa1~natty_all.deb) ...
Setting up nginx (1.0.2-0ppa1~natty) ...
$ which nginx
/usr/sbin/nginx
$ nginx -V
@anveo
anveo / gist:1058994
Created July 1, 2011 17:17
Puppet + RVM gem install
rvm install ruby-1.8.7-p334
rvm use 1.8.7-p334 --default
rvm use --create ruby-1.8.7-p334@system
gem install facter --version '1.6.0' --no-ri --no-rdoc
gem install puppet --version '2.7.1' --no-ri --no-rdoc
rvm wrapper 1.8.7-p334@system --no-prefix puppet
rvm wrapper 1.8.7-p334@system --no-prefix puppetca
setsockopt(29, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not supported)
futex(0xb78d6e44, FUTEX_WAKE_OP_PRIVATE, 1, 1, 0xb78d6e40, {FUTEX_OP_SET, 0, FUTEX_OP_CMP_GT, 1}) = 1
futex(0xb78d6760, FUTEX_WAKE_PRIVATE, 1) = 1
select(13, [10 12], NULL, NULL, NULL) = 1 (in [12])
fcntl64(12, F_SETFL, O_RDWR|O_NONBLOCK) = 0
accept(12, {sa_family=AF_FILE, NULL}, [2]) = 868
fcntl64(12, F_SETFL, O_RDWR) = 0
getsockname(868, {sa_family=AF_FILE, path="/var/run/mysql\1"}, [30]) = 0
fcntl64(868, F_SETFL, O_RDONLY) = 0
fcntl64(868, F_GETFL) = 0x2 (flags O_RDWR)
@anveo
anveo / zerolog.sh
Created August 4, 2011 22:03
Reset logs
cat /dev/null > /var/www/api/shared/log/god.log
cat /dev/null > /var/www/api/shared/log/nginx_access.log
cat /dev/null > /var/www/api/shared/log/unicorn.stderr.log
cat /dev/null > /var/www/api/shared/log/unicorn.stdout.log
cat /dev/null > /var/www/api/shared/log/resque.log
cat /dev/null > /var/www/api/shared/log/production.log
# resync logs
kill -s USR1 `ps -ef | sed -n '/unicorn_rails master/{/grep/!p;}' | awk '{print$2}'`
kill -s HUP `ps -ef | sed -n '/resque:scheduler/{/grep/!p;}' | awk '{print$2}'`
2011-08-20 15:53:01] DEBUG accept: 192.168.1.201:54767
[2011-08-20 15:53:01] ERROR OpenSSL::SSL::SSLError: SSL_accept returned=1 errno=0 state=SSLv3 read client certificate A: tlsv1 alert unknown ca
/usr/local/rvm/gems/ruby-1.9.2-p290@system/gems/puppet-2.7.3/lib/puppet/network/http/webrick.rb:44:in `accept'
/usr/local/rvm/gems/ruby-1.9.2-p290@system/gems/puppet-2.7.3/lib/puppet/network/http/webrick.rb:44:in `block (3 levels) in listen'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `call'
/usr/local/rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
#!/usr/bin/env bash
# This script assumes 'deploy' user already exists
RUBY_19_RELEASE='ruby-1.9.2-p290' # if this changes, change the /etc/puppet/puppet.conf below
PUPPET_VERSION='2.7.3'
apt-get update
apt-get install -y linux-headers-`uname -r`
apt-get install -y ntp openssh-server
∴ uname -a
Linux ip-10-160-229-93 2.6.32-317-ec2 #36-Ubuntu SMP Fri Jul 8 18:12:30 UTC 2011 x86_64 GNU/Linux
∴ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.04.3 LTS
Release: 10.04
Codename: lucid
# (ebs) AMI - ami-97c694d2 - (ubuntu 10.04.3)
apt-get update
apt-get upgrade #currently this requires a reboot
apt-get install -y ntp openssh-server
apt-get install -y build-essential binutils-doc gcc autoconf flex bison git-core
apt-get install -y libreadline5-dev zlib1g-dev libssl-dev libxml2-dev libxslt1-dev
apt-get install -y debconf-utils python-software-properties
apt-get install -y bash-completion curl dnsutils htop iotop ncurses-term nmap strace tmux tree sysstat unzip vim-nox
[13:43:12] anveo: deryl ok. These are the exact commands I'm running after instance create: https://gist.github.com/1235814
[13:44:20] deryl: instance create?
[13:46:14] deryl: umm you don't have to do the usermod line at alland the ps1 lines go in bash_profile not bashrc. you don't have to add root to the group
[13:46:48] deryl: the installer autoadds you and root to the group proviuded you sudo bash < <(curl..)
[13:46:55] deryl: also you HAVE to log out then back in
[13:47:07] deryl: group membership into rvm is done at login time
[13:47:45] deryl: and you do NOT run the installers AS root
[13:47:56] deryl: you sudo. do NOT run it directly as root
[13:48:28] deryl: clean out everything RVM related, then AS YOUR USER: sudo bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
[13:48:40] deryl: but first delete EVERYTHING rvm related and log out completely from your session
ubuntu@ip-10-168-153-3:~$ groups ubuntu
ubuntu : ubuntu adm dialout cdrom floppy audio dip video plugdev admin
ubuntu@ip-10-168-153-3:~$ rvm install ruby-1.8.7-p352
Installing Ruby from source to: /home/ubuntu/.rvm/rubies/ruby-1.8.7-p352, this may take a while depending on your cpu(s)...
/usr/local/rvm/scripts/functions/manage/base: line 142: cd: /home/ubuntu/.rvm/src: No such file or directory
ruby-1.8.7-p352 - #fetching