根据启动Bash Shell的方式不同,对Shell有两种分类方式
根据Shell的启动方式不同,可以将Shell分为
tmp = 'c:/tmp/chef-solo' | |
file_cache_path tmp | |
data_bag_path File.join(tmp, 'data_bags') | |
cookbook_path [ File.join(tmp, 'site-cookbooks'), | |
File.join(tmp, 'cookbooks') ] | |
role_path File.join(tmp, 'roles') |
require 'fileutils' | |
require 'date' | |
require 'yaml' | |
require 'rexml/document' | |
require 'ya2yaml' | |
include REXML | |
doc = Document.new(File.new(ARGV[0])) |
#!/bin/bash | |
# bootstrap ruby1.9 on a fresh RHEL5.5/CentOS5.5 | |
# installs chef and bundler as well | |
# warning: this script does NOT make you breakfast | |
#enable EPEL repo, some packages (i.e. ruby-mysql) depend on this | |
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm | |
RUBY_19_VERSION="ruby-1.9.2-p180" |
This allows user to do automated installation of ubuntu. Provided here a a few different files/scripts for making this easier.
I've used this to verify that d-i kernel and initramfs from -proposed work as shown in bug 1511497.
The provided 'preseed' below can be used as a fully automated installation of ubuntu. Boot with qemu like:
require 'fiber' | |
fib = Fiber.new do | |
v = 0 | |
loop do | |
v += 1 | |
Fiber.yield v | |
v.times { print "-"} | |
puts v | |
end |
def block_new | |
puts Proc.new.call | |
end | |
block_new{"hello"} | |
#slow practice | |
def herp_pass_block(&block) | |
derp_call_block &block | |
end |
#Person | |
class Person | |
end | |
#class method | |
class Person | |
def self.address | |
puts "hangzhou" | |
end | |
end |
#0> non-block call | |
Thread.new do | |
blahbla... | |
end | |
#1> 4 simple ways to call shell or cmd | |
`ps aux` |
#!/bin/bash | |
# Renames subtitles files according to tv shows names found in a directory | |
# Acceped syntaxes for season/episode are: 304, s3e04, s03e04, 3x04 (case insensitive) | |
# | |
# Usage: | |
# Put this gist somewhere in your $PATH, like /usr/local/bin/subtitles-renamer | |
# Chmod +x it | |
# cd ~/YourHolidaysTvShowsWithSubtitles | |
# subtitles-renamer |