MyLife
记录一些关于我的点点滴滴。
InputStream、byte[] 互转
Mar 31st
InputStream转byte[]
private byte[] getBytesFromInputStream(InputStream is) throws IOException {
ByteArrayOutputStream bytestream = new ByteArrayOutputStream();
int ch;
while ((ch = is.read()) != -1) {
bytestream.write(ch);
}
byte imgdata[] = bytestream.toByteArray();
bytestream.close();
return imgdata;
}
byte[]转InputStream
byte[] data; InputStream is = new ByteArrayInputStream(data);
http://mingkg21.javaeye.com/blog/431067
HP ProBook 4710s
Jan 30th
HP ProBook 4710s [ ProBook 4710s(VK275PA) 7900元 ]
* 英特尔®酷睿™2双核处理器
T9600(2.80GHz/1066/6M)/
P8700(2.53GHz/1066/3M)/
P7570(2.26GHz/1066/3M)/
T6670(2.20GHz/800/2M)/
T6570(2.10GHz/800/2M)
* 正版Windows® 7 家庭普通版/正版DOS/正版Linux
* 17.3英寸16:9 LED背光高清BrightView高亮屏(1600*900分辨率和1,600万色)
* 2GB/4GB内存
* 250GB/320GB/500GB硬盘
* ATI Mobility Radeon HD4330显卡,512MB独立显存
* 带盘面光雕技术和蓝光光盘只读技术的DVD刻录光驱/带盘面光雕技术的DVD刻录光驱
* 无线网卡
* 一年免费部件和人工保修、免费上门取送机(限国内距维修站40公里范围内)
修复Ubuntu 9.10
Nov 28th
昨晚破解Win7失败,导致又进不来Win7了@_@,修复一下吧。
首先光碟启动Ubuntu,非安装进入Ubuntu下的控制台。
sudo mount /dev/sda6 /mnt //如果要你的/boot是单独分区的话,需要运行以下命令 sudo mount /dev/sda6 /mnt/boot sudo grub-install --root-directory=/mnt/ /dev/sda
进入Ubuntu系统后,在运行以下命令
sudo update-grub sudo grub-install /dev/sda
如果你想修改启动顺序阿,启动默认时间阿,可以修改
/boot/grub/grub.cfg
这个和Grub1的配置文件有点不同,因为Ubuntu 9.10使用的是Grub2了。
2009年度总结
Nov 27th
今年最主要的收获还是关于Linux系统方面的知识。
统计Apache的访问UV
cat /home/app/httpd/logs/access_log|grep 04/Nov/2009 | awk '{print $1}' | sort | uniq -c | sort -rn | wc -l
系统实时并发
tail -10000 /home/app/httpd/logs/access_log | awk '{print $5}' | sort | uniq -c | sort -rn | head
系统连接状态统计
netstat -an | awk '{print $6}' | sort |uniq -c| sort -rn
[译]在Ubuntu或者Debian中安装PCRE库( Perl 5 Compatible Regular Expression Library )
Nov 8th
原文地址:
Ubuntu / Debian Install PCRE Library ( Perl 5 Compatible Regular Expression Library )
http://www.cyberciti.biz/faq/debian-ubuntu-linux-install-libpcre3-dev/
I need to compile few application and I need Perl 5 Compatible Regular Expression Library (PCRE). Under CentOS I can use a package called pcre-devel, but Debian do not have the same. How do I install pcre-devel under Debian / Ubuntu Linux?
我需要编译一些应用程序,同时也需要Perl 5 兼容正则表达式库(PCRE)。在CentOs下,我可以使用一个叫pcre-devel,但是Debian可就不一样了。我怎样在Debian/Ubuntu Linux下安装pcre-devel呢?
Perl-compatible regular expression library. PCRE has its own native API, but a set of “wrapper” functions that are based on the POSIX API are also supplied in the library libpcreposix. Note that this just provides a POSIX calling interface to PCRE: the regular expressions themselves still follow Perl syntax and semantics. The header file for the POSIX-style functions is called pcreposix.h. To install PCRE, type thy following command:
Perl兼容正则表达式库(PCRE)有自己原生API,但是这一系列封装函是基于POSIX API,而POSIX API也支持libpcreposix库。这样只要提供一个POSIX的调用接口给PCRE后,正则表达式本身仍遵循Perl的语法和语义。POSIX-style的头文件是pcreposix.h,所以,安装PCRE,需要运行以下命令。
sudo apt-get update sudo apt-get install libpcre3 libpcre3-dev
你可能还需要安装
sudo apt-get install openssl libssl-dev
开始写Nginx的Module
Nov 8th
首先访问Nginx下载
wget http://sysoev.ru/nginx/nginx-0.8.22.tar.gz
待续~~
参考资料:
**http://nutrun.com/weblog/hello-world-nginx-module/
http://blog.zhuzhaoyuan.com/2009/08/creating-a-hello-world-nginx-module/
http://hi.baidu.com/kissdev/blog/item/f47622de19efa75fccbf1a90.html
http://www.tech-q.cn/thread-85-1-1.html
http://www.evanmiller.org/nginx-modules-guide.html
蜘蛛猛于虎
Nov 4th
唉,这个蜘蛛太暴力了。
124.115.4.198
124.115.0.164
124.115.0.25
124.115.0.156
124.115.0.110
124.115.0.16
124.115.0.157
124.115.4.191
124.115.4.197
124.115.0.168
124.115.0.138
124.115.0.111
124.115.0.101
124.115.0.21
124.115.0.27
124.115.0.23
124.115.0.103
124.115.4.193
124.115.0.105
124.115.0.109
124.115.0.22
124.115.0.166
124.115.0.104
124.115.0.107
124.115.0.141
124.115.4.194
124.115.0.165
124.115.4.195
124.115.0.163
124.115.4.190
124.115.0.158
124.115.0.169
124.115.0.20
124.115.0.171
124.115.4.204
124.115.0.170
124.115.0.108
124.115.4.203
124.115.4.202
124.115.0.19
124.115.0.167
124.115.0.159
124.115.0.26
124.115.0.18
124.115.0.139
124.115.0.160
124.115.0.106
124.115.4.196
124.115.0.17
124.115.0.14
124.115.4.200
124.115.4.201
124.115.0.140
124.115.4.205
124.115.0.24
124.115.4.199
124.115.0.100
124.115.4.192
124.115.0.15
124.115.0.142
124.115.0.28
124.115.0.162
124.115.0.161
124.115.0.102
Picasa 网络相册
Oct 29th
在C:\WINDOWS\system32\drivers\etc\hosts文件后添加
203.208.39.104 picadaweb.google.com
203.208.39.104 lh1.ggpht.com
203.208.39.104 lh2.ggpht.com
203.208.39.104 lh3.ggpht.com
203.208.39.104 lh4.ggpht.com
203.208.39.104 lh5.ggpht.com
203.208.39.104 lh6.ggpht.com
203.208.39.104 lh7.ggpht.com
203.208.39.104 lh8.ggpht.com
