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
# -*- encoding: utf-8 -*- | |
require 'digest/md5' | |
require 'nestful' | |
class Smsbao | |
def initialize(login, passwd) | |
@login = login | |
@passwd = Digest::MD5.hexdigest(passwd.to_s) | |
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
# sudo ln -s ~/nginx.conf unicorn.conf | |
upstream app_server { | |
server unix:/tmp/unicorn_padrino.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
charset utf-8; | |
server_name db.innshine.com; |
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
# -*- encoding: utf-8 -*- | |
require File.join(__FILE__, '../../../../Desktop/sms_list') | |
user = User.all[5] | |
mobiles = sms_list.uniq | |
members = user.members.in('receivers.receiver_mobile' => mobiles ) | |
buyers = members.only(:buyer_nick).distinct(:buyer_nick) |
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
//TWIN WHEELER MODIFIED FOR ARDUINO SIMPLIFIED SERIAL PROTOCOL TO SABERTOOTH V2 | |
//With nunchuck potentiometers controlling it | |
//or could use two regular 10K potentiometers, one for steering and one for fine tuning of balance point | |
//J. Dingley For Arduino 328 Duemalinove or similar with a 3.3V accessory power output | |
//i.e. the current standard Arduino board. | |
//XXXXXXXXXXXXXXXXX UPDATES Feb 2012 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |
// If you open serial view window at 9600 baud, you can see values for angle etc (once tiltstart has engaged) | |
//REMEMBER: Put one end down on floor, turn on, count to 5 (while it calibrates itself) |
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
// 模拟 | |
const byte PIN_ANALOG_X = A0; | |
const byte PIN_ANALOG_Y = A1; | |
// 数字 | |
const byte PIN_ANALOG_K = 0; | |
// X中轴,区间值 [515..518] | |
const int X_THRESHOLD_LOW = 515; | |
const int X_THRESHOLD_HIGH = 518; | |
// Y中轴,区间值 [518..520] | |
const int Y_THRESHOLD_LOW = 518; |
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
# -*- encoding: utf-8 -*- | |
require 'csv' | |
require 'smsbao' | |
class SendCsv < Smsbao | |
def initialize(login, passwd) | |
@smser = Smsbao.new(login, passwd) | |
end | |
def import(csv_file, col_sep=',') # MAC下为; |
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
.DS_Store |
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
def self.get() | |
@diskinfo = `df | grep rootfs | awk '{print $2,$4,$5}'` | |
@diskinfo = @diskinfo.split(' ') | |
@diskinfo_size = (@diskinfo[0].to_f / 1024 / 1024).round(2) | |
@diskinfo_free = (@diskinfo[1].to_f / 1024 / 1024).round(2) | |
@diskinfo_perc = @diskinfo[2].sub('%','') | |
@cpu_perc = `vmstat | awk '{print $13}'`.split("\n").last | |
@mem = `cat /proc/meminfo | grep Mem | awk '{print $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
<!DOCTYPE> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
</head> | |
<body> | |
<form action="https://login.taobao.com/member/login.jhtml" method="post" accept-charset="GBK" target="_blank"> | |
<input type="text" name="TPL_username"> | |
<input type="password" name="TPL_password" > | |
<input type="hidden" name="action" value="Authenticator"> |
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
urls = ['http://adidas.tmall.com', 'http://asics.tmall.com', 'http://vans.tmall.com', 'http://skomart.tmall.com', 'http://lining.tmall.com'] | |
urls.each do |url| | |
Seller.sync(url) | |
end | |
urls = ['http://mentholatum.tmall.com', 'http://marubi.tmall.com', 'http://loreal.tmall.com', 'http://olay.tmall.com', 'http://nivea.tmall.com', 'http://xybc.tmall.com'] | |
urls.each do |url| | |
Seller.sync(url) | |
end | |
urls = ['http://jinliufu.tmall.com', 'http://jiuxian.tmall.com', 'http://jiujiajiu.tmall.com', 'http://gjwjl.tmall.com', 'http://yanghe.tmall.com', 'http://guoyujl.tmall.com', 'http://sutanjl.tmall.com'] | |
urls.each do |url| |