Skip to content

Instantly share code, notes, and snippets.

@sitoto
sitoto / delayed_job_init_script.sh
Created March 28, 2017 09:52 — forked from mdesantis/delayed_job_init_script.sh
Delayed Job init script; it uses start-stop-daemon and supports every Ruby version manager (RVM, rbenv, chruby...)
#!/bin/sh
### BEGIN INIT INFO
# Provides: delayed_job
# Required-Start: $all
# Required-Stop: $local_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the delayed_job instances
# Description: starts the delayed_job server instances using start-stop-daemon
#
@sitoto
sitoto / mina
Created March 13, 2017 08:41 — forked from vincentjiang/mina
rails 4.1.0 -- mina + unicorn + nginx
# config/deploy.rb
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rvm'
# ter_mode 这个要设置,不然在 mac 下输密码有问题
set :term_mode, nil
set :rvm_path, '/usr/local/rvm/bin/rvm'
require 'csv'
class PartRequestsController < ApplicationController
def render_csv_header(filename = nil)
filename ||= params[:action]
filename += '.csv'
if request.env['HTTP_USER_AGENT'] =~ /msie/i
headers['Pragma'] = 'public'
headers["Content-type"] = "text/plain"
headers['Cache-Control'] = 'no-cache, must-revalidate, post-check=0, pre-check=0'
@sitoto
sitoto / monitrc
Created December 13, 2013 07:50 — forked from franck/monitrc
###############################################################################
## Monit control file
###############################################################################
##
## Comments begin with a '#' and extend through the end of the line. Keywords
## are case insensitive. All path's MUST BE FULLY QUALIFIED, starting with '/'.
##
## Below you will find examples of some frequently used statements. For
## information about the control file, a complete list of statements and
## options please have a look in the monit manual.
http://localhost:3000/categories/52733fcf7562750fa90d0000/csvfiles/52a04c1b7562751509770500/download
source : sourceUploader
<%= @csvfile.source.url %>
<%= @csvfile.source_identifier %>
<%= @csvfile.source.current_path %>
@sitoto
sitoto / gist:7745960
Created December 2, 2013 06:42
CentOS镜像为国内镜像
更改CentOS镜像为国内镜像
2011-06-21 12:22:51| 分类: LINUX |字号 订阅
国内镜像地址:
http://mirrors.163.com/centos/ 。(网易)
我们就用 http://mirrors.163.com/centos/ 网易)来修改配置文件
方法一:
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@sitoto
sitoto / mantisbt.sh
Created October 17, 2013 07:50
backup and upload from ftp
#!/bin/bash
#This is a ShellScript For Auto DB Backup
#Setting
DBName=mantis
DBUser=root
DBPasswd=×××(填写root密码)
BackupPath=/usr/fj/mantis/
LogFile=/usr/fj/mantis.log
@sitoto
sitoto / ssh-keygen
Created September 3, 2013 07:20
ssh-keygen -t rsa
ssh-keygen -t rsa
scp id_rsa.pub user@remote_ip:~/.ssh/authorized_keys
unicorn_rails -E development -c /home/hw/balingpei/config/unicorn.rb