Archive for 11月, 2008

通过 grub4dos 从硬盘启动 Fedora 10 安装程序

Posted on 2008-11-29 in TechnologyComments

fedora 10
与 Ubuntu 相比,通过 grub4dos 引导来硬盘安装 Fedora 10 显然要繁琐那么一点点。花了大半天的时间来尝试硬盘安装 Fedora 10 ,事实证明,有刻录机不用反而要硬盘安装,纯粹是自己给自己找麻烦。

几点安装心得:

  • 若安装完成之后仍旧要 grub4dos 来引导系统,则 grub4dos 最好是最新版的,不然有可能不支持 Fedora 10 的引导。
  • 安装镜像 iso 文件以及从安装镜像文件解压的 images 目录得放在 FAT32 分区。Fedora 的安装程序不支持自动寻找 iso 文件,得手动指定所在分区。这样的安装体验不是很好,尤其对于我这样有 N 个硬盘的人来说。
  • 安装引导程序的时候,在界面上有看到设置 BIOS 硬盘启动的选项,莫非 Fedora 可以直接读写 BIOS ?

Continue reading...

Yahoo 域名转出至 GoDaddy 记录

Posted on 2008-11-26 in Blog RelatedComments

幸好提前去 Yahoo 看了下域名的续费情况,不然还不知道 Yahoo 的域名年费狂涨到 $34.95,实在是太不厚道了!

于是决定将域名转出至 GoDaddy,不过却没想到过程却这么麻烦:

  1. 注册了国内的贝宝,发现不能添加信用卡才意识到注册错了地方,于是删除该帐号。
  2. 去注册了 PayPal 国际重新注册了帐号,花了两天时间验证了信用卡。
  3. 注册了 GoDaddy 帐号,填写相关信息,开始按步骤转入域名。不料折腾一晚上,checkout order 时始终提示“Transaction refused due to risk model”,抓狂。
  4. 咨询了 cosbeta,未果。本还想兑些美元直接付款,不过 cosbeta 说不一定有作用,PayPal 帐号可能太新了。
  5. 在 taobao 看见有人代购 e-Gift Card,可精确到美分。买了足够的金额,终于 checkout 成功。
  6. 上 Yahoo 解锁域名后,登录 GoDaddy 后点击 Pending Domain Transfers 继续开始转入域名进程,填写 Transaction ID, Security Code, Authorization Code 相关信息,点击了几个按钮后,等待域名转入邮件通知。
  7. 足足等了 5 天,终于收到 GoDaddy 发来的域名转入成功的确认邮件。在 Yahoo 取消了域名服务。重新设置了域名解析。GoDaddy 解析速度很快。

相关参考链接:
How do I transfer my yahoo domain to a new registrar
域名转移到 Godaddy 图文教程
Godaddy 域名使用说明

Welcome back, Jack!

Posted on 2008-11-24 in Collection, PictureComments

24_redemption 24_season7_jack

More links:
http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=401201475
http://www.fox.com/24/dossier/
http://24fans.net/

让 Wordpress 自动删除 Post Revisions

Posted on 2008-11-18 in Blog Related, FavoritesComments

貌似在 wp-config.php 中加入 define(’WP_POST_REVISIONS’, false); 来禁用 Wordpress 的日志修订功能,post revision 还是会产生。gohsy 同学写了个插件 Revision Manager 来清理 post revision,不过个人觉得手动清理还是不够方便,决定利用 Wordpress 的计划任务功能(WP_Cron)偷偷懒。

不想为了这小小的功能而多添加一个插件,所以在主题目录下的 functions.php 文件添加了以下代码:

function delete_post_revisions() {
  global $wpdb;
 
  // Also need to delete the post meta and term relationships
  $wpdb->query("DELETE FROM {$wpdb->postmeta} WHERE post_id IN (SELECT ID FROM {$wpdb->posts} WHERE post_type = 'revision')");
  $wpdb->query("DELETE FROM {$wpdb->term_relationships} WHERE object_id IN (SELECT ID FROM {$wpdb->posts} WHERE post_type = 'revision')");
 
  // Delete the post revisions
  $wpdb->query("DELETE FROM {$wpdb->posts} WHERE post_type = 'revision'");
}
 
// Register the event
add_action('delete_post_revisions_event', 'delete_post_revisions');
if (!wp_next_scheduled('delete_post_revisions_event')) {
  wp_schedule_event(time(), 'daily', 'delete_post_revisions_event');
}

Continue reading...

让 Google Sitemaps Generator 可以忽略指定的日志分类

Posted on 2008-11-15 in Blog RelatedComments

在之前使用 HemingwayEx 主题的时候我把一些只有半句或几句话的日志移动到了 asides 分类,而现在我不想让 Google Sitemaps Generator 插件生成 sitemap 的时候包括这些日志,也许只有我才会有这样奇怪的需求 :shock:

可 Google XML Sitemaps 只能忽略指定的日志或页面,而不能忽略整个分类,所以只能自己动手了。

1. 打开插件目录下的 sitemap-core.php 文件,找到:

$where.=" AND post_password='' ORDER BY post_modified DESC";
 
$sql .= $where;

修改成:

$where.=" AND post_password='' ORDER BY post_modified DESC";
$where = apply_filters('sitemap_exclude_categories', $where);
$sql .= $where;

Continue reading...

丫丫咯呸,DNS 被篡改了

Posted on 2008-11-14 in AsidesComments

fuck popup.adv.net

Wordpress 分页文章静态化的更优解决方案

Posted on 2008-11-12 in Blog RelatedComments

之前用比较暴力的方式实现了分页文章的静态化,不过这样一来升级 Wordpress 就不太方便了。厌烦了每次升级都要修改源文件,于是利用 Wordpress 本身提供的接口实现了更好的解决方案。

/%year%/%monthnum%/%postname%.html这样的永久链接结构为例:

1. 打开主题目录下的functions.php文件,添加以下代码:

// 添加分页处理规则
function add_custom_post_rewrite_rules($rules) {
  $custom_rules = array(
    '([0-9]{4})/([0-9]{1,2})/([^/]+)-([0-9]+).html$' => 'index.php?year=$matches[1]&monthnum=$matches[2]&name=$matches[3]&page=$matches[4]',
  );
  $rules = array_merge($custom_rules, $rules);
 
  return $rules;
}
add_filter('post_rewrite_rules', 'add_custom_post_rewrite_rules');
 
// 修改分页链接
function my_wp_link_pages($args = '') {
  $args .= ($args ? '&' : '') . 'echo=0';
  $links = wp_link_pages($args);
  $links = preg_replace_callback('|([0-9]{4}/[0-9]{1,2}/)([^/]+)(.html)(/)([0-9]+)|', 'custom_page_link', $links);
 
  echo $links;
}
 
function custom_page_link($matches) {
  return $matches[1].$matches[2].'-'.$matches[5].$matches[3];
}

Continue reading...

安装了 Ubuntu 8.10 导致网卡在 XP 下工作不正常

Posted on 2008-11-04 in TechnologyComments

机器环境:南桥 Intel 82801GB ICH7 网卡 Atheros L2 Fast Ethernet 10/100 Base-T Controller

在中午休息的间隙,花了二十分钟的时间安装 Ubuntu 8.10,重新回到 XP 下后提示网络电缆没有插好。一开始还以为之前为了避免 Ubuntu 安装程序从网络源下载文件而拔网线的时候把网线插头弄坏了,还去找来网线测试器检查网线,经检查一切正常。猜想网卡是不是坏了,不过又一想没理由啊好端端的网卡怎会突然就坏了。

将网卡驱动卸载,重启后 XP 提示发现新硬件,但重新安装了网卡驱动后,一切照旧,依然提示网络电缆没有插好。在我几乎要判断网卡已经坏了的时候,老大凑了过来说拔掉机箱电源后再接上试试。依言照做,还真解决了问题,网卡恢复了正常,囧rz。

细细想来,除了安装 Ubuntu 没对系统做了什么改动,要出问题也只有在这里了。果然,在我试着进入 Ubuntu 系统后再回到 XP 下,系统又提示网络电缆没有插好,但在 Ubuntu 下网卡确工作正常。这个结果实在有些出乎我的意料。好在“断电恢复法”依然有效,不过我担心这样多折腾几次之后网卡是不是真的会挂了 :evil:

即使知道要见面

Posted on 2008-11-03 in Favorites, MusicComments

不需要听懂在唱什么,旖旎的旋律便足以让人沉醉,音乐不分国度。

Continue reading...