What is the maximum RAM can Lenovo T410 upgrade to?

According Lenovo official website, T410 “supports up to 8GB maximum memory”.

From the forum of Lenovo, someone said

I have exactly the same computer. Here is what I have tried:

– 2x 8GB = didn’t work
– 1x 4GB + 1x 8GB = didn’t work
– 1x 2GB + 1x 8GB = didn’t work
– 1x 8GB = didn’t work
– 2x 4GB = WORKS….

So maximum is 8GB (2x 4GB)

However, they are both incorrect. I just tried 12GB (4GB under the keyboard + 8GB on the underside of the computer). It boots Fedora 22 workstation without any problems. Although it hangs on Windows 7 booting stage, I think it may boot Windows 7 or 8 from new installation. Whatsoever the fact reflects Fedora is more robust than Windows.

I will try if T410 supports 16GB if I can find a way how to install RAM under the keyboard.

UPDATE: I have tried 16GB (8GB under the keyboard + 8GB on the underside of the computer). Fedora boots all right (Windows still hangs). So the final answer to the maximum RAM can Lenovo T410 upgrade to is 16GB! Here is the screenshot as a proof of my experiment.Lenovo T410 with 16GB RAM running Fedora

Back to MySQL

不知从什么时候开始,Fedora 和 CentOS 里的 MySQL 都给换成了 MariaDB。我一直搞不懂好端端的 MySQL 为什么还要分出一个 MariaDB,更搞不懂 MariaDB 的优越性在哪里,反正 MySQL 对我来说够用了,倒是 MariaDB 安装和启动时使用了不同于 MySQL 的名称,让我很不习惯。比如

yum install mysql-server

换成了

yum install mariadb
service mysqld start

换成了

service mariadb start

幸好,除此之外,一切照旧,用到 MySQL 的 PHP 程序都能继续在 MariaDB 使用,所以我就一直用着 MariaDB。直到今天使用 Magento2,要求 MySQL 5.6 以上版本,而 CentOS 下把 MariaDB 用 yum update 到最新版本,仍是 5.5.40。

于是我被逼着去下载 MySQL 5.6。不用不知道,一用发现 CentOS 下安装 MySQL 超级方便,只要安装好 RPM 包——http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm,就可以恢复使用

yum install mysql-server

执行安装。

早知如此,我真不该碰 MariaDB——这个并没有给我带来实际利益的程序也花了我一天去熟悉。

Hands on GeoIP for Nginx on Fedora and CentOS

最近研究了一下如何根据用户的 IP 获得他的地理位置(我只关心 country 级,不关心 city 级),区别性地在 Ngnix 层面做一些限制性访问。这里用到 GeoIP 软件包和 MaxMind 的数据库。

在 Fedora 20 下,Nginx (目前 1.4.7) 依赖于 GeoIP。等于说,装好 Nginx,ngx_http_geoip_module 自然就启用了,只要在两个配置文件略作修改。

Fedora nginx -V output
Fedora nginx -V output

1. 在/etc/nginx/nginx.conf 里添加


http {

...

geoip_country /usr/share/GeoIP/GeoIP.dat;

...

}

2. 在 /etc/nginx/fastcgi_params 里添加


fastcgi_param GEOIP_COUNTRY_CODE $geoip_country_code;
 fastcgi_param GEOIP_COUNTRY_NAME $geoip_country_name;

还有其他参数可用,请自行查手册。重启 Nginx 就可以使用 GeoIP 的信息了。

在 CentOS 6.5 下,事情要复杂一些。网上说 CentOS 下的 Nginx 同样依赖于 GeoIP,可在我这里事实并非如此。同样是最新的 1.4.7 版,Nginx for CentOS 是不带 ngx_http_geoip_module 编译的。即使我用 yum install GeoIP 安装了 GeoIP 软件包,但 Nginx 不从源码编译就不能启用 geoip 模块。

CentOS nginx -V output
CentOS nginx -V output

着重提一下,我说的 CentOS 6.5 是 VPS 版,Nginx 和 GeoIP 无依赖是不是这个版本特有的?不得而知。我不想为之专门装一次 CentOS 来探究。我也不想从源码编译 Nginx,因为我太喜欢 yum,就为一个 ngx_http_geoip_module 搞砸了其他功能就不值得了。

退而求其次,CentOS 下不妨用 php 调用 GeoIP,只是感觉同样功能用 php 实现会消耗更多资源。另外,Nginx 能进行全面的限制,而 php 无法利用 GeoIP 信息限制对静态文件的访问。但是,Nginx 的全面限制也只能阻止低级用户,不可能阻止稍有点 IT 知识、一心要绕开地理位置限制来访问的用户,所以 php 对动态文件的限制其实也起到了相同的效果。

CentOS 下,安装 GeoIP for php,首先要装有 GeoIP,前面已经说了,要单独装:


yum install GeoIP

然后,安装  php-pecl-geoip:


yum install php-pecl-geoip

哈哈,都是我喜欢的yum。然后重启一下 php-fpm,即可在 php 下获得 geoip 信息。函数有很多,geoip_country_code_by_name()、geoip_country_name_by_name() 等等,请自行查手册。

顺便提一下,CentOS 6.5 VPS 版安装 GeoIP 后,带来的 country 数据库(GeoIP.dat, 6 Sep, 2011)有 1,183,408 字节,而 Fedora 20 的 GeoIP country(GeoLiteCountry.dat, 18 Jun, 2013) 数据库只有 581,110 字节,从 MaxMind 网站上下载最新的 GeoLite Country 数据库(GeoIP.dat, 每月第一个周二更新)也只有668,134 字节。考虑到 MaxMind 的数据库是分免费和收费的,那么,CentOS GeoIP.dat 这么大,是不是更接近于收费版?我不知道收费版是啥样的,因此无从考证。

Job for mariadb.service failed bug fixed

Last month I set up a development server using Fedora 20. On that server I wanted to change MySQL socket file from /var/lib/mysql/mysql.sock to /dev/shm/mysql.sock. Basically I wanted to move MySQL socket file to shared memory for performance gain.

I made the change in /etc/my.cnf, but when I tried to start mysqld, I got the error message:

Job for mariadb.service failed. See ‘systemctl status mariadb.service’ and ‘journalctl -xn’ for details.

That was my first time heard about mariadb. I did some background research on mariadb and the relationship between mysqld and mariadb. But that did not help to solve the problem. So I had to revert to the default MySQL socket file /var/lib/mysql/mysql.sock.

Today I had some free minutes and recalled this unresolved issue. To my surprise, I just changed

socket=/var/lib/mysql/mysql.sock

to

socket=/dev/shm/mysql.sock

in /etc/my.cnf. And this time mysqld can start without any errors.

What changes have I made to the system? Nothing but a yum update.

So I assume there was a bug in mariadb (or mysqld) which is fixed by the recent release.

Mariadb updated
Mariadb updated

Play Blu-ray ISO images on Fedora 20

买了新电视 SAMSUNG UE46F6100,总想试一下它的 3D 效果。我没有 Blu-ray player,也没有 Blu-ray disk,于是下载了一个 Blu-ray ISO 镜像格式的文件。怎么放呢?

我一开始想在 Sony NSZ-GS7 机顶盒上播放,可是没有可用的 App。Windows 下倒有很多解决方案,可惜它不是我的首选。

我想的是怎么在 Fedora 20 下播放 Blu-ray disk?如果可行,就可以用 Fedora 20 配一台 HTPC 去客厅播放 Blu-ray disk。

做之前,我以为这有点难,不太会有现成的 yum package。事实上,很简单。

首先得有 libbluray,用 yum install 一下就可以。但我的机子也装有 libbluray,不知是 Fedora 20 默认安装的库,还是我装别的软件时带进来的。

然后加载 rpmfusion repo,装一下 vlc 就可以用 VLC 来播放 Blu-ray disk。


yum install vlc

HTPC 又多一个新功能。但是 SAMSUNG UE46F6100 电视的 3D 效果实在一般,要令我赏心悦目的 3D 技术还没有到来啊。

Aptana Studio 3.4.2 crashes on JDK in Fedora 20

最近重拾 Aptana Studio,下载了最新版 3.4.2,可一编辑代码就无故崩溃。Fedora 20 提示 JDK crashed。

我一开始没注意到我用的是 OpenJDK,Aptana 说不支持 OpenJDK,赶紧去下 Oracle/Sun JDK,还换了两次版本,1.7.0_51、1.6.0_45 都试过,都不成。

搜了一下此类问题,给我感觉 2010 年以来在各版本的 Aptana Studio 和 JDK 时有发生,坏也不知道什么原因,好也不知道什么原因。大概我之前人品好,没碰到此类问题。

换用 Netbeans,当前环境没有问题,但实在不熟悉 Netbeans,仍纠结着想用 Aptana Studio。想了个办法,切换回 Oracle/Sun JDK 1.7.0_51,安装 Eclipse 4.3.1,再装 Aptana Studio plugin for Eclipse,嘿,不再无故崩溃了。

Eclipse with Aptana Studio plugin
Eclipse with Aptana Studio plugin

Change Grub timeout seconds

Grub menu
Grub menu

Changing Grub timeout seconds is not as many people said, by edit /etc/default/grub. At least with Fedora 20, I can proove it is not the right place to make the change. The corresponding file is /boot/grub2/grub.cfg. In the file look for

set timeout=5

5 seconds is the default timeout. Change it to any seconds you want it to be.

set timeout=0

0 seconds means no waiting at all.

set timeout=-1

-1 means wait infinite seconds until you make a choice.

(My updated knowledge on 06 Feb 2014) /boot/grub2/grub.cfg 是针对 BIOS systems 的,UEFI systems 要修改 /boot/efi/EFI/fedora/grub.cfg。修改 grub.cfg 文件后直接生效,但是不建议直接修改 grub.cfg 文件。grub.cfg 的文件头上就有一段这样的提示:

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

因为系统在某些情况下会覆写 grub.cfg 文件。这样又回到之前很多人说的 /etc/default/grub 文件,在这里修改参数是对的,只是修改后不直接生效,还要运行一遍

grub2-mkconfig -o /boot/grub2/grub.cfg

grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

覆写 grub.cfg 才生效。

Yum clean all cleaned warnings

Warning: group core does not exist.
Warning: group core does not exist.

今天在 Fedora 20 上更新应用,碰到一大堆 warnings:
Warning: group core does not exist.
Warning: group gnome-desktop does not exist.
Warning: group multimedia does not exist.
Warning: group firefox does not exist.
Warning: group guest-desktop-agents does not exist.
Warning: group base-x does not exist.
Warning: group anaconda-tools does not exist.
Warning: group fonts does not exist.
Warning: group hardware-support does not exist.
Warning: group dial-up does not exist.
Warning: group printing does not exist.
Warning: group libreoffice does not exist.
Warning: group input-methods does not exist.
Warning: group standard does not exist.

但用了一个

yum clean all

再作

yum update

就好了。真是太简单了。可能这几天碰到的事情比较烦,遇到简单的反而不适应了。

顺便说一下 Fedora 20 桌面版,没有明显的 bugs,挺稳定的。用了这么多年的 Fedora,感觉终于进入了 Fedora XP 时代。记得以前用 Windows,从 95,98,到 ME,没有一个省心的,总是莫名其妙的问题,经常重装系统。到了 XP,终于稳定了,装一次可以用很久很久(这让 Vista, Windows 7, 和最新的 Windows 8 没有掀起新的高潮)。当然,Fedora 20 出来没几天,我说它稳定,可能为时过早,只是一种直觉,希望 Fedora 20 日后的表现不要辜负我。

Failed to install Fedora 20 beta 5

我常用的一台 Fedora 18 无法做 yum update 好久了。所以想到重装。Fedora 20 beta 5 已经出来了,也正好趁此尝尝鲜。

我按我的常规做好了 liveusb,可是非常奇怪,启动不了,在启动刚开始就卡住了。提示信息为

Secure boot not enabled
error: failure reading sector 0xfc from “hd1”
error: failure reading sector 0xe0 from “hd1”

我一开始以为 liveusb 没做好,可拿到另一台机子却能毫无故障地启动了。我就排除了 liveusb 自身的原因。

有人说这是 BIOS 里 Secure boot disabled 的缘故,可我的 BIOS 根本没这个选项。

有人说这是 EFI (UEFI) boot 造成的,我选择了不从 EFI 设备启动,但仍从同一个 liveusb 启动,结果错误提示 Machine check error,然后就自启了。

搞了半天,放弃安装 Fedora 20,转而研究 Fedora 18 为什么无法做 yum update。结果发现,是 [Errno -1] Metadata file does not match checksum Trying other mirror 之类的错误造成的。我试着

yum clean metadata

再作 yum date 就很顺利了。

Enable desktop sharing in Fedora 18

I remember in Fedora 16, desktop sharing is pre-installed with the system. Now I am on Fedora 18, and I want to use it as a VNC server. I don’t want to install tigervnc-server. I just want to use the same one comes with Fedora 16.

On Fedora project site, it still says

To activate desktop sharing, select System > Preferences > Internet and Network > Remote Desktop from the user menu.

However, in Fedora 18, the path has changed, so I thought the name of desktop sharing might have changed as well, but I assumed it should be pre-installed in Fedora 18. It took me hours trying to find remote desktop before I found somewhere it says remote desktop comes in Vino. I could not remember what Vino was, but afterwards was quite simple:

yum install vino

Then I found Desktop Sharing in Internet (no longer in Preferences).

P.S. After I wrote this post, I realised I learned Vino 4 years ago! But I totally forgot it.