ProdigYu's Blog

Author Archive

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...

dmesg命令详解

by ProdigYu on Apr.27, 2011, under Linux

Linux命令:dmesg  功能说明:显示开机信息。

语 法:dmesg [-cn][-s <缓冲区大小>]

补充说明:kernel会将开机信息存储在ring buffer中。您若是开机时来不及查看信息,可利用dmesg来查看。开机信息亦保存在/var/log目录中,名称为dmesg的文件里。

参 数:

-c 显示信息後,清除ring buffer中的内容。

-s<缓冲区大小> 预设置为8196,刚好等于ring buffer的大小。

-n 设置记录信息的层级。

99 Comments :, more...

传统的新年

by ProdigYu on Feb.03, 2011, under Mood

很久没更新些有用的东西了,过年了,还是先来更新下吧.接下来应该会在这里记录些不错的东西.

Leave a Comment : more...

VMwareServer限速设置

by ProdigYu on Dec.06, 2010, under Virtualization

对应虚拟机文件目录下的的VMX文件,加入以下代码:
ethernetX.rxbw.limit = “512″
ethernetX.txbw.limit = “1024″
X代表虚拟网卡号,一般单网卡的填0即可.512是下载限速,1024是上传限速.单位是Kbps.

经测试,VMwareServer 2.0成功限速.

41 Comments :, , , more...

Linux下Screen命令详解

by ProdigYu on Dec.02, 2010, under Linux

功能说明:

使用telnet或SSH远程登录linux时,如果连接非正常中断,重新连接时,系统将开一个新的session,无法恢复原来的session.screen命令可以解决这个问题。Screen工具是一个终端多路转接器,在本质上,这意味着你能够使用一个单一的终端窗口运行多终端的应用。 (continue reading…)

89 Comments :, , , more...

安装MySQL,服务无法启动

by ProdigYu on Nov.27, 2010, under MySQL

今天碰到个怪事,全新的Win2003系统直接安装MySQL5.1,在安装完成运行配置向导最后一步的时候出现服务无法启动,也就导致配置无法成功完成. (continue reading…)

67 Comments :, , more...

Linux下压缩与解压.zip和.rar及.7z文件

by ProdigYu on Nov.24, 2010, under Linux

1)对于.zip

linux下提供了zip和unzip程序,zip是压缩程序,unzip是解压程序。它们的参数选项很多,可用命令zip -help和unzip -help查看,这里只做简单介绍,举例说明一下其用法: (continue reading…)

83 Comments :, , , , more...

使用Python爬虫抓站的一些技巧总结:进阶篇

by ProdigYu on Nov.24, 2010, under Python

一、gzip/deflate支持

现在的网页普遍支持gzip压缩,这往往可以解决大量传输时间,以VeryCD的主页为例,未压缩版本247K,压缩了以后45K,为原来的1/5。这就意味着抓取速度会快5倍。 (continue reading…)

73 Comments :, more...

CentOS 下源码安装 Xen

by ProdigYu on Nov.22, 2010, under Linux, Virtualization

在 CentOS 源码编译安装 Xen 的过程和在 Debian 上编译安装 Xen 的过程差不多,只是第一步安装编译所需要的工具和软件包有所不同,后续步骤有点小差别,不过方法都是一样的,这也说明各个 Linux 发行版之间的区别真的不大,没有必要为选择 Linux 发行版而发愁。 (continue reading…)

Leave a Comment :, , , 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...