今天下午两点左右在附近的工行办理手机号更改业务,几乎等了一个多小时都没弄好。效率奇低!这样的银行存在真是浪费纳税人的金钱。
分类:Uncategorized
备案,拜拜
前一段时间弄了一下备案,麻烦透啦,而且还没通过。只好再租了香港的服务器把Wordpress部署上去,这样万恶的备案滚一边去。
How to use WiringPi2 for Python on the Raspberry Pi in Raspbian part 1
http://raspi.tv/2013/how-to-use-wiringpi2-for-python-on-the-raspberry-pi-in-raspbian
http://wiringpi.com/wp-content/uploads/2013/03/pins.pdf
http://www.element14.com/community/docs/DOC-73950/l/raspberry-pi-2-model-b-gpio-40-pin-block-pinout
https://www.sparkfun.com/datasheets/Sensors/Temperature/DHT22.pdf
http://www.cnblogs.com/sn-dnv-aps/p/4390899.html
使用淘宝NPM镜像
环境: Ubuntu 14.04
在使用js库的时候老是有些包无法下载使用(又被墙了),最近发现淘宝开发一个NPM镜像。
地址如下:http://npm.taobao.org/
安装如下:
npm config set ca “”
sudo npm install -g cnpm –registry=https://registry.npm.taobao.org
安装包 leaflet-storage
sudo cnpm install napa
sudo cnpm install leaflet-storage
/usr/bin/env: node: No such file or directory
解决如下:sudo ln /usr/bin/nodejs /usr/bin/node
Mesos安装使用
环境:CentOS 6.4, apache Mesos
Mesos采用与Linux kernerl相同的机制,只是运行在不同的抽象层次上。Mesos kernel利用资源管理和调度的API在整个数据中心或云环境中运行和提供引用(例如,Hadoop,Spark,Kafaka,Elastic Search)。即Apache Mesos在整个数据中心根据资源利用率和资源占用情况,在整个数据中心内进行任务的调度 。
安装如下:
1. 添加repository
sudo rpm -Uvh http://repos.mesosphere.com/el/6/noarch/RPMS/mesosphere-el-repo-6-2.noarch.rpm
2. 安装 mesos和marathon
yum -y install mesos marathon
3. 重启系统
sudo reboot
4. 查看服务
ps ax | grep mesos
1026 ? Ssl 5:37 java -Djava.library.path=/usr/local/lib:/usr/lib:/usr/lib64 -Djava.util.logging.SimpleFormatter.format=%2$s%5$s%6$s%n -Xmx512m -cp /usr/bin/marathon mesosphere.marathon.Main –zk zk://localhost:2181/marathon –master zk://localhost:2181/mesos
5579 ? Ssl 1:36 /usr/sbin/mesos-master –zk=zk://localhost:2181/mesos –port=5050 –log_dir=/var/log/mesos –quorum=1 –work_dir=/var/lib/mesos
5588 ? Ssl 3:26 /usr/sbin/mesos-slave –master=zk://localhost:2181/mesos –log_dir=/var/log/mesos
5611 ? S 0:00 logger -p user.info -t mesos-slave[5588]
5612 ? S 0:00 logger -p user.err -t mesos-slave[5588]
5629 ? S 0:00 logger -p user.info -t mesos-master[5579]
5630 ? S 0:02 logger -p user.err -t mesos-master[5579]
8317 pts/1 S+ 0:00 grep mesos
5. 启用mesos的WebUI:
http://localhost:5050
在图表界面启用服务
marathon的WebUI:
http://localhost:8080
在命令行中启用任务:
mesos-execute –master=”localhost:5050″ –name=”test-exec” –command=”echo ‘scale=10000; 4*a(1)’ | bc -l -q”
安装zookeeper监控软件taokeeper
安装zookeeper监控软件taokeeper
(安装文件位于 http://jm-blog.aliapp.com/?p=1450)
安装步骤:
0. 下载apache tomcat, wget http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.43/bin/apache-tomcat-6.0.43.zip, unzip apache-tomcat-6.0.43.zip,cd apache-tomcat-6.0.43, chmod +x bin/*.sh
1. 下载taokeeper.sql,初始化数据库(Mysql).
2. 下载taokeeper-monitor.war文件,解压到tomcat的webapps目前下,确保最后目录结构如下:%TOMCAT_HOME%/webapps/taokeeper-monitor.war
3. 下载 taokeeper-monitor-config.properties文件,存放到一个指定目录
内容如下:
systemInfo.envName=Zookeeper_Monitor
#DBCP
dbcp.driverClassName=com.mysql.jdbc.Driver
dbcp.dbJDBCUrl=jdbc:mysql://xxx.xxx.xxx.xxx:3306/taokeeper
dbcp.characterEncoding=GBK
dbcp.username=xx
dbcp.password=xxxxxx
dbcp.maxActive=30
dbcp.maxIdle=10
dbcp.maxWait=10000
#SystemConstant
SystemConstent.dataStoreBasePath=/home/adadmin/taokeeper-monitor/datastore/
#SSH account of zk server
SystemConstant.userNameOfSSH=
SystemConstant.passwordOfSSH=
4. 修改%TOMCAT_HOME%/bin/catlina.sh,增加一项: JAVA_OPTS=-DconfigFilePath=”/home/adadmin/taokeeper-monitor/taokeeper-monitor-config.properties”
5. 启动tomcat服务,bin/start.sh
访问Pentaho API时加入密码参数
环境: CentOS 5.4, Pentaho BI Server 5.3
切换到 biserver-ce/pentaho-solutions/system目录下,编辑security.properties
修改如下:
requestParameterAuthenticationEnabled=true
重启BI Server服务
通过浏览器或curl访问
http://xxx.xxx.xxx.xxx:8080/pentaho/api/repos/%3Apublic%3ASteel%20Wheels%3AReports%3ATop%20Customers%20%28report%29.prpt/viewer?ts=1438767939338&userid=admin&password=password
curl -o 2.pdf –user admin:password http://xxx.xxx.xxx.xxx:8080/pentaho/api/repos/%3Ahome%3Aantifraud%3A%E8%A2%AB%E6%94%BB%E5%87%BB%E5%85%B3%E9%94%AE%E8%AF%8DTop20%E6%97%A5%E6%8A%A5.prpt/generatedContent?output-type=pdf
我的位置
http://maps.google.com/maps?q=39.901238,116.564589
发自 WordPress for Android
烦烦烦
发自 WordPress for Android
数据预处理中英文wikipedia
环境:Ubuntu 14.04, Gensim,
处理脚本process_wiki.py:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import os.path
import sys
from gensim.corpora import WikiCorpus
if __name__ == '__main__':
program = os.path.basename(sys.argv[0])
logger = logging.getLogger(program)
logging.basicConfig(format='%(asctime)s: %(levelname)s: %(message)s')
logging.root.setLevel(level=logging.INFO)
logger.info("running %s" % ' '.join(sys.argv))
# check and process input arguments
if len(sys.argv) < 3:
print globals()['__doc__'] % locals()
sys.exit(1)
inp, outp = sys.argv[1:3]
space = " "
i = 0
output = open(outp, 'w')
wiki = WikiCorpus(inp, lemmatize=False, dictionary={})
for text in wiki.get_texts():
output.write(space.join(text) + "\\n")
i = i + 1
if (i % 10000 == 0):
logger.info("Saved " + str(i) + " articles")
output.close()
logger.info("Finished Saved " + str(i) + " articles")
下载中文和英文的wikipedia
wget https://dumps.wikimedia.org/enwiki/latest/enwiki-latest-pages-articles.xml.bz2
wget https://dumps.wikimedia.org/zhwiki/latest/zhwiki-latest-pages-articles.xml.bz2
方法一:
python process_wiki.py zhwiki-latest-pages-articles.xml.bz2 wiki.zh.text
方法二:
Wikipedia Extractor 是用 Python 写的一个维基百科抽取器,使用非常方便。
wget http://medialab.di.unipi.it/Project/SemaWiki/Tools/WikiExtractor.py
python WikiExtractor.py -cb1000M -o extracted zhwiki-latest-pages-articles.xml.bz2
参数 -b1000M 表示以 1000M 为单位切分文件,默认是 500K。
将wiki.zh.text中的繁体字转化位简体字:
sudo apt-get install opencc
opencc -i wiki.zh.text -o wiki.zh.text.jian -c zht2zhs.ini
处理非utf-8字符
iconv -c -t UTF-8 < wiki.zh.text.jian > wiki.zh.text.jian.utf-8