ITeye博客

i am not a spammer

spamer · 共 25 篇文章

MySQL工具系列之myisamchk进行表的维护和崩溃恢复

MySQL工具系列之myisamchk进行表的维护和崩溃恢复 作者:阿炯 2010-09-01 12:53 - 最后更新 2010-09-02 10:42 1.为了检查/修复MyISAM表(.MYI和.MYD),你应该使用myisamchk实用程序。为了检查/修复ISA M表(.ISM和.ISD),你应该使用isamchk实用程序。 在下文中,我们将讨论myisamchk,但是也适用于老的isamchk。 你可以使用myisamchk实用程序来获得有关你的数据库表的信息、检查和修复他们或优化他们。 下列小节描述如何调用myisamchk(包括它的选项的描述),如何建立一个表维护的时间表,并且…

2013-10-30 11:24 · mysql · 评论(0)

Linux自启动脚本控制命令update-rc.d

1. 通过sysv-rc-conf 来管理 未安装,下面命令安装: sudo apt-get install sysv-rc-conf 使用如下: sudo sysv-rc-conf 2. Linux自启动脚本控制命令update-rc.d 以前我是直接去/etc/rcX.d目录下通过SXXservicename或KXXservicename来停止自启动服务,不过现在发现了到了两个好用的命令,不用一个一个rcx.d去的操作 1. update-rc.d //移除apache2的开机自启动 update-rc.d –f apache2 remove //添加apache2的开机自启动 upda…

2013-10-23 14:24 · Linux自启动脚本 · 评论(0)

查看ubuntu发布版本

查看ubuntu发布版本 hu@hu-ThinkPad-T500:~$ cat /etc/issue Ubuntu 13.04 \n \l hu@hu-ThinkPad-T500:~$ getconf LONG_BIT 32

2013-10-13 12:14 · ubuntu · 评论(0)

PHP的Session阻塞问题探讨

最近在开发一个项目,其中有1个PHP页面需要执行较长时间,而且我发现,在执行这个页面的时候,其他的页面都不能访问了,需要等这个页面执行完成以后,其他页面才能打开。 猜想了一下,有以下几种可能 Web Server(Apache 2.2/Nginx)是不是只能同时处理1个客户端连接? 是不是打开MySQL数据库的时候被阻塞了? 是不是session_start导致了阻塞? 于是,我写了几个页面测试了一下,发现是session导致了阻塞,而其他两种情况不会造成阻塞。 查了下PHP的Bug列表,发现有人提出了这个问题: Description: ------------ Calling sessi…

2013-07-12 14:27 · PHP的Session阻塞问题探讨 · 评论(0)

gitolite 配置 在windows 下使用

gitolite 配置 在windows 下使用: 〇. 安装 gitolite : 参考: https://github.com/sitaramc/gitolite/ 如网址不存在 则 google gitolite 一. 安装 MSysGit : http://code.google.com/p/msysgit/downloads/list 选择 Git-1.7.4-preview20110204.exe 或更高版本 安装的时候 选中: Git Bash Here Git GUI Here 测试安装: git --version git config --list 配置 MSysGit:…

2012-08-01 16:59 · gitolite 配置 在windows 下使用 · 评论(0)

解决sendmail报错 dsn=4.0.0, stat=Deferred

os :redhat AS 4.3 sendmail系统安装 tail /var/log/maillog an 25 16:37:30 test sendmail[773]: l0OMBCRo028217: to=<****@126.com>, ctladdr=< root@test.com > (0/0), delay=10:26:18, xdelay=00:00:00, mailer=esmtp, pri=754747, relay=mx.126.split.netease.com., dsn=4.0.0, stat=Deferred Jan 25 16:37:30 test sendm…

2012-06-13 17:13 · sendmail 报错 · 评论(0)

关于一个小猜数字游戏 猜对的几率是多大

每一两天都要和同事打赌喝可乐,今天我们自己想了一个打赌方法,因为比较新鲜,打完之后喝着可乐想这个方式猜者猜中的几率,觉得还不是很好算,所以贴出来共享,有兴趣的也可以赌一赌,呵呵 方式为: 甲方从1—5这五个数中选出一个数写在纸上,然后乙方来猜,乙方有两次机会,每次猜一个数,乙方第一次如果没有猜对,甲方要告诉乙方自己写的数比乙方猜的数大还是小,乙方再猜,如果再没有猜对就算乙方输。 原帖地址: http://www.iteye.com/topic/63032 第一次猜1 或 5 的猜中概率是40%: 假如第一次猜1: 如果中了,就中了(概率1/5), 没中的话,再剩下的4/5 里面再猜,此时猜中…

2012-03-30 11:25 · 评论(0)

ie6 之 max-width 实现

ie6 不支持max-width , 但可以通过 expression 来实现,代码如下: <span style=" border:1px solid red; display:inline-block; max-width:100px; _width:expression(eval(this.offsetWidth>100?100:this.offsetWidth)); overflow:hidden; /*重要*/ "> <a>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</a> </span>

2012-01-09 11:22 · css · 评论(0)

5百万 uid 白名单 之 PHP Bitmap 处理

近日,有同事说有个 5百万 的白名单处理, 到网上查找 相似案例, 说是有个bitmap的解法, 再次 google ,baidu 无相关 PHP 的解法, 于是自己写了一个: <?php /* 5百万 uid 白名单 之 PHP Bitmap 处理 * author: hushuilong * email: hushuilong at gmail dot com * */ class Bitmap { private $handler = NULL; private $max = 0; public function __construct($file) { clearstatcache(…

2011-12-26 14:04 · PHP Bitmap 大数据量处理 · 评论(0)

自己写的 关于 C语言 “线性排序”问题

#include <stdio.h> #include <stdlib.h> int main() { int a[] = {4,5,4,1,4,90,5,50,70,1,20,50,65536,0,-3,-1,-4,-2,-6552,999}; int max = 0, min = 0, i = 0,n = 0, *b = NULL, *c = NULL; for (i=0, n=sizeof(a)/sizeof(int); i<n; i++) if(a[i] >= max) max = a[i]+1; for (i=0, n=sizeof(a)/sizeof(int); i<n; i++…

2011-12-14 16:58 · C语言 “线性排序” · 评论(0)

用鼠标拖拉来选中checkbox

(function($){ /*-----------------------------------------------------------------/ 功能:用鼠标拖拉来选中checkbox 参数:无 返回:原调用对象 示例:$('#testtable').squareSelection(); author: hushuilong email: hushuilong@gmail.com /-----------------------------------------------------------------*/ $.fn.squareSelection=functio…

2011-11-16 15:46 · javascript · 评论(0)

自己写的,利用as3 实现 copy 功能

自己写的,利用as3 实现 copy 功能 js 脚本: var HushuilongClipboard = { index: 0, current_flash_id: '', clipboardText: {}, completeCallback: {}, init: function(flash_place_id, button_img, button_width, button_height){ var flash_id = 'HushuilongClipboard_' + (this.index++); this.current_flash_id = flash_id; var fl…

2011-10-25 23:14 · 自己写的,利用as3 实现 copy 功能 · 评论(0)

PHP 关于strtotime("- x month") bug的解决

strtotime('-x month'); 在涉及到月份修改的时候,可能不会得到预料的结果。 此为php的一个bug: https://bugs.php.net/bug.php?id=27793 如:当前时间为: 2011-08-31 17:21:22 <?php date_default_timezone_set('Asia/Shanghai'); $t = time(); print_r(array( date('Y年m月',$t), date('Y年m月',strtotime('- 1 month',$t)), date('Y年m月',strtotime('- 2 month',$t…

2011-08-31 17:22 · PHP 关于strtotime("- x month") bug的解决 · 评论(0)

PHP模拟多线程请求

PHP模拟多线程请求 <?php multi_threads_request($nodes){ $mh = curl_multi_init(); $curl_array = array(); foreach($nodes as $i => $url) { $curl_array[$i] = curl_init($url); curl_setopt($curl_array[$i], CURLOPT_RETURNTRANSFER, true); curl_multi_add_handle($mh, $curl_array[$i]); } $running = NULL; do { usleep(…

2011-08-10 20:07 · PHP模拟多线程请求 · 评论(0)

批量删除 .svn 目录

删除 .svn 目录 find ./ -type d -name .svn | xargs rm -rf 或 find ./ -type d -name .svn -exec rm -rf {} \;

2011-06-23 23:36 · 评论(0)