如果god用到新的gem,需要重启god
god -h
god -c config/god/resque.god
>god load config/god/resque.god # if god has running, u can do this
# python demo/infer.py 原始图片路径 模型文件 结果输出文件 | |
# python demo/infer.py /data/photos/car_trash.jpeg demo/output/frozen_inference_graph.pb demo/result.json | |
import sys | |
sys.path.append('..') | |
import os | |
import time | |
import tensorflow as tf | |
import numpy as np | |
import json |
由于git pull,push慢,一般我是多次commit,一次push. 并且在 commit 中填写 fix #xxx, 随手把pm上 issue的状态改为已解决. 不手动关的话,不够实时,没人点击版本库,测试人员看不到已解决. | |
手动关的话,带来一个问题,状态已解决, 测试人员就开始验证了,但是代码没push. | |
我写了个脚本自动化完成这个任务. | |
>vi .git/config | |
[push] | |
default = current | |
[alias] | |
xpush = !git push && .git/hooks/post-push |
#!/usr/bin/env ruby | |
# 修改 www.vic360.com中图片链接错误问题 | |
# localhost/~w/projects/vic360 => www.vic360.com | |
# http://stackoverflow.com/questions/2693862/how-do-i-require-a-specific-version-of-a-ruby-gem | |
# TIP: | |
#localhost:wxianfeng_com wangxianfeng$ ruby script/tools/07_update_vic360_image_url.rb | |
#/Users/wangxianfeng/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.3/lib/active_record/relation/batches.rb:68:in `find_in_batches': undefined method `gteq' for nil:NilClass (NoMethodError) | |
# from /Users/wangxianfeng/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.3/lib/active_record/relation/batches.rb:20:in `find_each' | |
# from /Users/wangxianfeng/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.0.3/lib/active_record/base.rb:440:in `find_each' |
# 单台机器配置两个mysql实例,UBUNTU | |
# 把原先的mysqld变成mysqld1,然后新建一个mysqld2 | |
>vim /etc/mysql/my.cnf | |
[mysqld_multi] | |
mysqld = /usr/bin/mysqld_safe | |
mysqladmin = /usr/bin/mysqladmin | |
user=root | |
password=root |
# mysql主从复制,两台机器 | |
# 主: 192.168.10.107 UBUNTU | |
# 从: 192.168.10.105 UBUNTU | |
# 主配置 | |
>vim /etc/mysql/my.cnf | |
[mysqld] | |
log-bin=mysql-bin // 启用二进制日志 | |
server-id=107 // 服务器唯一ID,一般取IP最后一段 | |
bind-address=192.168.10.107 |
#encoding: utf-8 | |
#!/usr/bin/env ruby | |
require 'net/smtp' | |
FROM = 'noreply@entfield.com' | |
TO = 'kd-wangxf@chinaunicom.cn' | |
value = ["[www.entfield.com]请激活您的帐号"].pack("M").gsub(/=\n/, "") | |
subject = "=?UTF-8?Q?#{value}?=" |
# http://www.centos.bz/2011/09/centos-setup-process-startup-boot/ | |
one method: | |
>chkconfig httpd on | |
生成了 /etc/rc.d/init.d/httpd | |
another method: | |
>vi /etc/rc.local | |
see list: |
# 表结构 | |
users(login) | |
# 生成 一千万 条数据 | |
#!/usr/bin/env ruby | |
require 'uuid' | |
uuid = UUID.new | |
File.open("./data.txt","a+") do |f| |
wxianfeng@wxianfeng:/data/projects/entos$ RAILS_ENV=development rake db:create --trace | |
rake aborted! | |
no such file to load -- kgio_ext | |
fixed: | |
upgrade kgio 2.7.2 -> 2.7.4 |