These instructions install ruby and rubygems from source, not from RPMs. For instructions on installing from RPMs, look at something like http://wiki.opscode.com/display/chef/Installation+on+RHEL+and+CentOS+5+with+RPMs or http://mykestubbs.com/blog/2010/03/chef-installation-on-centos-54.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.prepare() | |
.then(() => { | |
const server = express() | |
global['Stack'] = Contentstack.Stack({ | |
api_key: config.contentstack.api_key, | |
access_token: config.contentstack.access_token, | |
environment: config.contentstack.environment | |
}); | |
server.get('*', (req, res) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<style> | |
* { | |
font-family: Arial; | |
font-size: 16px; | |
} | |
h1 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
log_file = "/var/log/mem_stats" | |
date = `date`.rstrip | |
mem_stats = `free -k`.split | |
output = "" | |
if Dir[log_file] == [] | |
output << "date,\t total memory,\t used memory,\t free memory\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
log_file = "/var/log/cpu_stats" | |
date = `date`.rstrip | |
cpu_stats = `uptime`.split | |
output = "" | |
if Dir[log_file] == [] | |
output << "date,\t 1min,\t 5min,\t 15min\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LettersCounter | |
def count word | |
word.gsub(/\s|-/, '').length | |
end | |
def sum_from_list words | |
lengths = words.map { |word| count word } | |
lengths.inject(:+) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'uri' | |
require 'cgi' | |
require 'iconv' | |
require 'date' | |
require 'rubygems' | |
require 'colorize' | |
device = 'en3' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
doc = Nokogiri::XML(File.open("deploy/data/BundleData.xml")) do |config| config.noblanks end | |
puts "Default Price:" | |
doc.xpath("//DefaultPrice/Choice").each { |p| puts "id: #{p['id']} price: #{p.content}" } | |
puts "ExistingCustPrice Price:" | |
doc.xpath("//ExistingCustPrice/Choice").each { |p| puts "id: #{p['id']} price: #{p.content}" } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (i=0; i<51; i++) { console.log(i+"\t"+i.toString(2)); } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Built-in python HTTP Server | |
python -m SimpleHTTPServer 8888 |
NewerOlder