Skip to content

Instantly share code, notes, and snippets.

@ssig33
Created May 25, 2011 05:19
Show Gist options
  • Save ssig33/990390 to your computer and use it in GitHub Desktop.
Save ssig33/990390 to your computer and use it in GitHub Desktop.
#!/bin/zsh
source ${HOME}/.zshrc
mkdir -p ${HOME}/perl5/perlbrew
curl -L http://xrl.us/perlbrew > ${HOME}/perl5/perlbrew/perlbrew
perl ${HOME}/perl5/perlbrew/perlbrew install > /dev/null
${HOME}/perl5/perlbrew/bin/perlbrew init > /dev/null
perlbrew install perl-5.14.0
curl -L http://xrl.us/cpanm > ${HOME}/perl5/perlbrew/bin/cpanm
chmod +x ${HOME}/perl5/perlbrew/bin/cpanm
#!/bin/zsh
source ${HOME}/.zshrc
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
if [[ -s $HOME/.rvm/scripts/rvm ]] ; then source $HOME/.rvm/scripts/rvm ; fi
rvm install 1.9.2
#!/usr/bin/ruby -Ku
require "pathname"
require "fileutils"
require "rbconfig"
include FileUtils::Verbose
class String
def expand
ret = Pathname.new(self).expand_path
ret.parent.mkpath unless ret.parent.exist?
ret
end
end
def link(src, dst)
puts "#{src} =>\n\t#{dst}"
src = Pathname.new(src).expand_path
dst = Pathname.new(dst).expand_path
dst.parent.mkpath unless dst.parent.exist?
remove_file dst if dst.symlink?
remove_file dst if dst.file?
ln_sf src.to_s, dst.to_s
end
def sh(*args)
puts args.join(" ")
system(*args)
end
cd "~/rc/".expand
os = "linux"
os = "windows" if Config::CONFIG["host_os"].downcase =~ /mswin/
os = "osx" if Config::CONFIG["host_os"].downcase =~ /darwin/
#OS 毎の処理
case os
when "osx"
link "mac.zshrc", "~/.zshrc"
# sh "sudo port selfupdate"
# sh "sudo port upgrade outdated"
when "linux"
link "linux.zshrc", "~/.zshrc"
sh "sudo apt-get update"
sh "yes | sudo apt-get upgrade"
sh "yes | sudo apt-get install apache2-utils aria2 autoconf autotools-dev build-essential curl emacs23 git-core git-svn ia32-libs ia32-libs-dev libexpat1-dev libbz2-dev libmysqlclient-dev libncurses5-dev libreadline5-dev libsasl2-dev libssl-dev libxml2-dev libxslt1-dev ruby rubygems screen tightvncserver transmission unzip update-inetd vim vtun w3m wget wl zip zlib1g zlib1g-dev zsh irssi libhaml-ruby rsync mysql-server libsqlite3-dev"
end
link "dot.vimrc", "~/.vimrc"
link "dot.emacs", "~/.emacs"
link "vim", "~/.vim"
link "dot.zshrc.prompt", "~/.zshrc.prompt"
link "dot.offlineimaprc", "~/.offlineimaprc"
link "dot.irssi", "~/.irssi"
link "dot.mutt", "~/.mutt"
#rvm
sh "/bin/zsh", "./rvm-setup.zsh"
#perl
sh "/bin/zsh", "./perlbrew-setup.zsh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment