ProdigYu's Blog

Author Archive

Find命令简单使用说明

by ProdigYu on Feb.09, 2012, under Linux

1)3天内修改过的文件:

find -ctime -3

2)find命令使用超过6天,空文件独立查询命令。

find /data/backup -ctime +6 -exec rm -f {} \;   删除/data/backup目录下修改时间超过6天的文件。
find /data/backup -type d -empty -exec rmdir {} \; >/dev/null 2>&1  删除/data/backup目录下空的文件夹,同时输出正确和错误信息到空。

(continue reading…)

Leave a Comment :, , , more...

悲剧的Adsense

by ProdigYu on Sep.08, 2011, under Mood

Adsense申诉失败,这个陪伴我多年的帐号还是被停用了。哎,Google的条款实在是太严格了。
(continue reading…)

Leave a Comment :, , , , , more...

最近倒霉事情比较多

by ProdigYu on Sep.03, 2011, under Mood

Adsense因为很不应该的原因被K,已经进行申诉了不知道还有没有救,毕竟这个帐号是2003年注册的,还是有感情啊,说封就给我封了,Google也是想尽办法不支付。这也就罢了,之前忘记取消Yahoo的自动续费,昨天居然给我扣了34.95刀,域名都已经转走了还扣什么扣,这简直是非常的不人性化。也联系他们要求退款了,估计这几天能搞定。
(continue reading…)

Leave a Comment :, , , more...

PHP随机显示图片

by ProdigYu on Aug.26, 2011, under PHP

pic.php list.txt放在网站根目录

pic.php内容如下:
<?php
$arr=file('list.txt');
$n=count($arr)-1;
header('Location: http://prodigyu.com/pic/'.$arr[rand(0,$n)]);
?>
(continue reading…)

Leave a Comment :, , more...

硬盘再次悲剧

by ProdigYu on Aug.15, 2011, under Mood

记得两年前有一块硬盘坏了丢失了不少珍贵的资料,今天悲剧再次出现了,再次出现一块500G的希捷盘坏掉.

(continue reading…)

Leave a Comment :, , , more...

网站广告投放策略研究 (一) 轮播以及效用最大化

by ProdigYu on Aug.11, 2011, under Web

首先科普一下目前互联网广告的类型,大体都有CPC,CPM,CPA,CPS,CPV这几种。

CPC就是按点击(Click)计算,CPM就是按弹窗(Mxxx?)计算,CPA/CPS一个是按注册一个是按销售计算,CPV则是按显示次数计算。于是CPC,CPA,CPS这种根据网站访客行为来获得收益的是一类,而CPM和CPV这种只和网站流量相关的则是另一类。 (continue reading…)

Leave a Comment :, , , , more...

用netstat和awk命令来统计网络连接数

by ProdigYu on Aug.08, 2011, under Linux

netstat -n | awk ‘/^tcp/ {++state[$NF]} END {for(key in state) print key,”\t”,state[key]}’
(continue reading…)

Leave a Comment :, , , more...

CentOS安装iftop查看网络流量

by ProdigYu on Jun.15, 2011, under Linux

安装所需组件
yum list | grep libp
yum install libp*
wget ftp://ftp.lmd.ens.fr/pub/devil/devel/sources/1.2/libpcap-0.9.8.tar.gz

安装iftop

wget http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
tar zxvf iftop-0.17.tar.gz
cd iftop-0.17
./configure
make
make install

安装完后使用命令
iftop -i eth0 -n 查看eth0的流量
退出按q

卸载:make clean iftop-0.17

Leave a Comment :, , , more...

Linux下MySQL开启远程访问

by ProdigYu on Jun.15, 2011, under MySQL

在默认情况下mysql是不允许远程访问的.

默认安装完的mysql root密码是空的,首先得设置一个密码:

mysqladmin -u root password ‘新密码’ (continue reading…)

Leave a Comment :, , more...

Squid清除缓存脚本

by ProdigYu on May.13, 2011, under CDN

转自张宴的《清除指定squid缓存文件的脚本》
脚本文件名:clear_squid_cache.sh

#!/bin/sh
squidcache_path="/cache"
squidclient_path="/usr/local/squid/bin/squidclient"
grep -a -r $1 $squidcache_path/* | strings | grep "http:" | awk -F'http:' '{print "http:"$2;}' > cache_list.txt
for url in `cat cache_list.txt`; do
$squidclient_path -m PURGE -p 80 $url
done

  注意:请赋予clear_squid_cache.sh可执行权限(命令:chmod +x ./clear_squid_cache.sh)。请确保脚本所在目录可写。

  设置:
  squidcache_path= 表示squid缓存目录的路径
  squidclient_path= 表示squidclient程序所在的路径,默认为squid安装目录下的bin/squidclient

  用法:
  1、清除所有Flash缓存(扩展名.swf):
  ./clear_squid_cache.sh swf

  2、清除URL中包含prodigyu.com的所有缓存:
  ./clear_squid_cache.sh prodigyu.com

  3、清除文件名为prodigyu.jpg的所有缓存:
  ./clear_squid_cache.sh prodigyu.jpg

65 Comments :, , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...