An incoming mail processing microframework in Ruby: https://github.com/titanous/mailman
A Really Ruby Mail Library:
#connect to redis database (place at config/initializers/redis.rb) | |
$redis = Redis.new(host: 'localhost', port: 6379, db: 1) | |
#read hash values from json file: | |
ru_json = File.read("ru-RU.json") | |
en_json = File.read("en.json") | |
cn_json = File.read("zh-CN.json") | |
ar_json = File.read("ar-EG.json") | |
#Set hash value in db: |
n=10 | |
(1..n).inject(:*) || 1 | |
## 1 ######### 2 #### 3 | |
#1. this is a enum object | |
#2. Do an operation (*) with accumulated result and next element - 1..3: res = 1 * 2 * 3 | |
#3. this is a foolprof - if an enum object is nil, result alway be the 1 |
An incoming mail processing microframework in Ruby: https://github.com/titanous/mailman
A Really Ruby Mail Library:
#!/usr/bin/env ruby | |
require 'colorize' | |
require 'rubygems' | |
require 'bundler/setup' | |
require 'mailman' | |
Mailman.config.maildir = 'Mail' | |
Mailman.config.poll_interval = 5 | |
Mailman.config.logger = Logger.new('log/mailman.log') |
select your vm:
xe vm-list
detect id of dom of its vm:
xe vm-param-list uuid=8e2dd6ac-4883-0e6e-5cce-afbf214fa916 | grep dom-id
read vnc port by that dom_id:
####bash color example:
echo -e "\e[0;31mМонтирую каталоги с диска u120 как:\e[0m"
####bash colors:
Original info and image: http://zipizap.wordpress.com/2011/09/28/quick-bash-colors/
unicorn -c config/unicorn.rb |
tar:
tar -zcvf archive_name.tar.gz dir_name
untar:
tar -zxvf file.tar.gz
example, if you want to change gitignore, but only in your local repo, do next:
git update-index --assume-unchanged .gitignore