Skip to content

Instantly share code, notes, and snippets.

View rubyonrailsworks's full-sized avatar

RubyonRailsWorks rubyonrailsworks

  • Shanghai,China
View GitHub Profile
@rubyonrailsworks
rubyonrailsworks / before.log
Created October 21, 2012 11:28
Why sendmail sucks
Oct 21 19:11:39 sendmail[20611]: unable to qualify my own domain name (AY1210150342185b33738) -- using short name
Oct 21 19:11:39 sendmail[20611]: q9LBBdDv020611: [email protected], size=2840, class=0, nrcpts=3, msgid=<[email protected]>, relay=root@localhost
Oct 21 19:11:39 sm-mta[20624]: q9LBBdEI020624: from=<[email protected]>, size=2971, class=0, nrcpts=3, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Oct 21 19:11:39 sendmail[20611]: q9LBBdDv020611: [email protected],[email protected],[email protected], [email protected] (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=92840, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q9LBBdEI020624 Message accepted for delivery)
Oct 21 19:11:40 sm-mta[20626]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-RC4-SHA, bits=128/128
Oct
@rubyonrailsworks
rubyonrailsworks / before.log
Created October 21, 2012 11:28
Why sendmail sucks
Oct 21 19:11:39 sendmail[20611]: unable to qualify my own domain name (AY1210150342185b33738) -- using short name
Oct 21 19:11:39 sendmail[20611]: q9LBBdDv020611: [email protected], size=2840, class=0, nrcpts=3, msgid=<[email protected]>, relay=root@localhost
Oct 21 19:11:39 sm-mta[20624]: q9LBBdEI020624: from=<[email protected]>, size=2971, class=0, nrcpts=3, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Oct 21 19:11:39 sendmail[20611]: q9LBBdDv020611: [email protected],[email protected],[email protected], [email protected] (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=92840, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q9LBBdEI020624 Message accepted for delivery)
Oct 21 19:11:40 sm-mta[20626]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-RC4-SHA, bits=128/128
Oct
@rubyonrailsworks
rubyonrailsworks / database.yml.erb
Created October 20, 2012 18:39 — forked from thbar/database.yml.erb
ERB template for git-branch aware database.yml (development/test only)
<%
# if you need to work on a branch with a different schema, use
# git config --bool branch.the-new-branch.database true
# http://mislav.uniqpath.com/rails/branching-the-database-along-with-your-code/
branch = `git symbolic-ref HEAD 2>/dev/null`.chomp.sub('refs/heads/', '')
suffix = `git config --bool branch.#{branch}.database`.chomp == 'true' ? "_#{branch}" : ""
%>
common: &common
@rubyonrailsworks
rubyonrailsworks / basic
Created October 20, 2012 15:00
SUBlime text2 Keybinds
ctrl+up, ctrl+down可以一行一行的滚动屏幕,pageUp pageDown一页一页翻动
ctrl+L 选择当前行,ctrl+d 选择当前文字块,ctrl+shift+d是直接复制当前行
ctrl + j join lines
Survive Before Multi-Selection
1.Press Alt or Command and then click in each region where you require a cursor.
2.Select a block of lines, and then press Shift + Command + L.
@rubyonrailsworks
rubyonrailsworks / gist:3903447
Created October 17, 2012 02:49 — forked from hisea/gist:3363163
Rake task with param and dependency
require 'resque/tasks'
namespace :ns do
desc "test task accepts param"
task :task, [:param] => [:environment] do |t,args|
abort "Please specify a param!" unless args[:param]
puts args[:param]
end
end
To get started, press Ctrl – Alt – Ton your keyboard to open the terminal. When it opens, run the commands below to download the deb package.
wget https://launchpad.net/~clipgrab-team/+archive/ppa/+files/clipgrab_3.2.0.9~precise2_i386.deb
Next, run the commands below to install ClipGrab.
sudo dpkg -i clipgrab*
If the above commands fail to install ClipGrab, run the commands below to force the installation.
@rubyonrailsworks
rubyonrailsworks / Crontab.sh
Created October 8, 2012 08:23
MagicOrders DBBAK SHELL SCRIPT
30 2 * * * `/bin/sh /bin/dbbak.sh`
@rubyonrailsworks
rubyonrailsworks / deploy.rb
Created October 2, 2012 18:58 — forked from Mic92/deploy.rb
My mina deploy setup
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'
# Basic settings:
# domain - The hostname to SSH to
# deploy_to - Path to deploy into
# repository - Git repo to clone from (needed by mina/git)
# user - Username in the server to SSH to (optional)
@rubyonrailsworks
rubyonrailsworks / update.sh
Created October 2, 2012 05:58
Hourly update taobaoapp token
0 * * * * /bin/bash -l -c 'cd /home/geek/www2/magic_orders && /home/geek/.rvm/gems/ruby-1.9.3-p194/bin/rails runner '\''TaobaoAppToken.first.check_or_refresh!'\'''
[global_config]
title_transmit_bg_color = "#839496"
title_inactive_fg_color = "#93a1a1"
title_transmit_fg_color = "#eee8d5"
title_inactive_bg_color = "#586e75"
[keybindings]
[profiles]
[[default]]
palette = "#073642:#d30102:#859900:#b58900:#6c71c4:#d33682:#2aa198:#839496:#586e75:#cb4b16:#859900:#b58900:#268bd2:#d33682:#2aa198:#93a1a1"
login_shell = True