gem install rails
rails new my_app -T
module ApplicationHelper | |
# Simple Navigation | |
# navigation nav_elements, :selected_class => "foo" | |
def navigation(links=[],options={}) | |
path = (options[:controller_only] == true) ? controller.controller_name.to_sym : request.path | |
content_tag :ul, :class => (options[:class] || 'navigation') do | |
links.each do |link| | |
klass = (path == link[:path]) ? options[:selected_class] || 'current' : "" |
multiuser on | |
acladd user1,user2,user3 | |
vbell off | |
hardstatus string "%1`" | |
# change the hardstatus settings to give an window list at the bottom of | |
# the screen, with the time and date and with the current window highlighted | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]' |
namespace :db do | |
desc "create db copy file" | |
task :sgl_dump => :environment do | |
system "cp #{Rails.root}/db/development.sqlite3 #{Rails.root}/db/#{Date.today.to_s.split('-').join}-devdb" | |
end | |
desc "load latest db file" | |
task :sgl_load => :environment do | |
puts "Are you sure you want over write your database? YES/NO" | |
yn = STDIN.gets |
ENV["RAILS_ENV"] ||= 'test' | |
# begin | |
# require 'rubygems' | |
# require 'spork' | |
# rescue LoadError => e | |
# end | |
def load_all(*patterns) | |
patterns.each { |pattern| Dir[pattern].sort.each { |path| load File.expand_path(path) } } |
#!/usr/bin/env bash | |
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 |
map <C-t> :CommandT<CR> | |
set number | |
set showcmd | |
set background=dark | |
map <Esc>[A <Up> | |
map <Esc>[B <Down> | |
map <Esc>[C <Right> | |
map <Esc>[D <Left> | |
syntax on |
# -*- encoding : utf-8 -*- | |
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path. | |
require "rvm/capistrano" # Load RVM's capistrano plugin. | |
set :rvm_ruby_string, '1.9.2' # Or whatever env you want it to run in. | |
require 'bundler/capistrano' | |
set :application, "yourapp" | |
set :use_sudo, false |
#! /usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'logger' | |
=begin | |
WHATIS | |
* ping monitoring once every 30 secs |
Disable-MicrosoftUpdate | |
Disable-UAC | |
Update-ExecutionPolicy Unrestricted | |
cinst git.install | |
cinst ruby | |
cinst powershell | |
cinst chef-client | |
cinst putty | |
cinst rubygems |