Systems Thoughts

Try to think everything systematically

Archive for the ‘Tips’ Category

现在每次关机都会有这个东西,很annoying

/var/run/gdm.pid doesn't exist, perhaps GDM isn't running

查了查,原来是我X11启动方法不对,我是照着Arch Linux Beginner Wiki搞得,其实上边有很多东西Out of date。按照上边的方法,gdm给放在etc/rc.conf的daemon里面了:

DAEMONS=(syslog-ng dbus !network cpufreq laptop-mode netfs crond alsa acpid !net-profiles hal fam networkmanager gdm dhcdbd vboxnet @sshd)

把它移走,现在我的rc.conf是:

#
# /etc/rc.conf - Main Configuration for Arch Linux
#

# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime"
# USEDIRECTISA: use direct I/O requests instead of /dev/rtc for hwclock
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="en_US.utf8"
HARDWARECLOCK="localtime"
USEDIRECTISA="no"
TIMEZONE="Europe/Stockholm"
KEYMAP="us"
CONSOLEFONT=
CONSOLEMAP=
USECOLOR="yes"

# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
#MODULES=(e1000e iwl4965 snd-mixer-oss snd-pcm-oss snd-hwdep snd-page-alloc snd-pcm snd-timer snd snd-hda-intel soundcore)
MODULES=(acpi_cpufreq cpufreq_ondemand cpufreq_stats cpufreq_powersave cpufreq_conservative vboxdrv ac battery button dock processor thermal video wmi firmware_class hci_usb cdrom agpgart intel-agp nvram hid usbhid i2c-i801 i2c-core evdev ff-memless joydev pcspkr psmouse serio_raw led-class compat_ioctl32 uvcvideo v4l1-compat videodev thinkpad_acpi mmc_core ricoh_mmc sdhci pci_hotplug shpchp rtc-cmos rtc-core rtc-lib nvidia output snd-mixer-oss snd-pcm-oss snd-hwdep snd snd-page-alloc snd-pcm snd-timer snd-hda-intel soundcore pata_acpi ata_generic scsi_mod ahci ata_piix e1000e bluetooth mac80211 rfkill iwl4965 iwlcore cfg80211 pcmcia_core rsrc_nonstatic yenta_socket usbhid usbcore ehci-hcd uhci-hcd ieee1394 ohci1394 sd_mod sr_mod)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="t61"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
#
# DHCP: Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#
eth0="dhcp"
#wlan_wlan0="wlan0 essid Buffalo"
#wlan0="dhcp"
#wlan_wlan0="wlan0 essid Buffalo key s:12345"
INTERFACES=(lo !eth0 !wlan0)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 192.168.5.1"
ROUTES=(!gateway)

# Enable these network profiles at boot-up. These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(home)

# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng dbus !network cpufreq laptop-mode netfs crond alsa acpid !net-profiles hal fam networkmanager dhcdbd vboxnet @sshd)

然后改变etc/inittab里的启动进程,现在我的inittab是:

# /etc/inittab
#
# Runlevels:
# 0 Halt
# 1(S) Single-user
# 2 Not used
# 3 Multi-user
# 4 Not used
# 5 X11
# 6 Reboot

## Only one of the following two lines can be uncommented!
# Boot to console
#id:3:initdefault:
# Boot to X11
id:5:initdefault:

rc::sysinit:/etc/rc.sysinit
rs:S1:wait:/etc/rc.single
rm:2345:wait:/etc/rc.multi
rh:06:wait:/etc/rc.shutdown
su:S:wait:/sbin/sulogin -p

# -8 options fixes umlauts problem on login
c1:12345:respawn:/sbin/agetty -8 38400 vc/1 linux
c2:2345:respawn:/sbin/agetty -8 38400 vc/2 linux
c3:2345:respawn:/sbin/agetty -8 38400 vc/3 linux
c4:2345:respawn:/sbin/agetty -8 38400 vc/4 linux
c5:2345:respawn:/sbin/agetty -8 38400 vc/5 linux
c6:2345:respawn:/sbin/agetty -8 38400 vc/6 linux

ca::ctrlaltdel:/sbin/shutdown -t3 -r now

# Example lines for starting a login manager
#x:5:respawn:/usr/bin/xdm -nodaemon
x:5:respawn:/usr/sbin/gdm -nodaemon
#x:5:respawn:/opt/kde/bin/kdm -nodaemon
#x:5:respawn:/usr/bin/slim >& /dev/null

# End of file

非常neat。用了arch确实因为解决问题对linux了解更深了,看似很麻烦,但是由于网上社区很活跃,其实很多东西只要google一下就能解决。估计用gentoo能学到更多把,呵呵,不过我觉得arch已经很合适了。

Comments (8) Posted on Tuesday, September 23rd, 2008

在Ubuntu下同时配置欧洲键盘和中文输入法绝对是pain in the ass。单独搞这两个其实并不难,难就难在他们在一起不好工作。就为这个我放弃了用了1年多的fcitx,转而用scim-fit。

前一阵逛超市看到罗技无限键鼠套装打折卖99,于是买了一套回来,回来一直当英语键盘用。可是经常被键位搞晕,后来换成瑞典语键盘了,但是在fcitx下输入汉字有些键就不管用了,而且中文输入也时有时没有的。像是这个符号“~”我就输入不了。正好在ubuntu论坛上发现了一个新舒服法Fun Input Toy,把fcitx换下来,把scim装上。然后在设置里有个Other/European也选上,就行了。在scim把键位也设成swedish,这样无论切到哪个语,键位都是瑞典语的。

我自己的机器以前用得土法配置的fcitx不好自动去除,装了卸了几次还是不行。所有环境变量都设上还是不能用,不知道为什么fcitx这么firm。最后只好在自己的.profile最后强行把IM_MODULE弄成scim。

Comments (2) Posted on Thursday, August 28th, 2008

一直对这个鸡肋设备很不感冒,直到在Ubuntu下加上了指纹识别。安装很简单,效果很强筋。不只是开机可以用指纹,任何时候,只要系统要求输入root user密码,你都可以刷指纹。Are you getting me?在Terminal下用sudo可以刷,在Gnome下执行高级任务可以刷,真是太爽了。

在ubuntu 8.04下软件已经在库里了

sudo apt-get install libpam-thinkfinger thinkfinger-tools

把/etc/pam.d/common-auth改一下,这样只要要密码的时候都可以刷,哈哈

# /etc/pam.d/common-auth - authentication settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
# traditional Unix authentication mechanisms.
#
auth sufficient pam_thinkfinger.so
auth required pam_unix.so try_first_pass nullok_secure

再把你的指纹存一下,要刷三次
sudo tf-tool --acquire
然后把指纹关联一下
sudo tf-tool --add-user 用户名
然后启用(我没运行就能用了)
$ sudo /usr/lib/pam-thinkfinger/pam-thinkfinger-enable

然后就爽去吧

Comments (1) Posted on Tuesday, August 26th, 2008
Filed under Life, Tips

保护资源,几个话题同时开聊.

  • 音乐欣赏
    今天给ex发歌时看了看You know I’m no good的歌词,我靠,越来越喜欢了,一天100遍也不烦.虽然已经听了3个月了.下面是视频加歌词连接:

    歌词
  • 工作面试
    失败了,下次长个心眼,再问论文写完了么就说
    I have finished all the compulsory courses as well as the thesis work, now just hanging around in school trying to waste some time.
    还是去美国,对瑞典不要心存幻想,最终目的自己创业.
  • 三星不是一般的烂
    那位朋友愿意拿Nokia N73换,我加钱.
Comments (0) Posted on Wednesday, January 16th, 2008
  1. 给Firefox用上内存做交换区(来源)在/etc/fstab加入:

    tmpfs /tmp/cache tmpfs size=128M 0 0

    然后建立/tmp/cache目录

    sudo mkdir /tmp/cache

    然后加载

    sudo mount -a

    在Firefox里地址栏输入 about:config.加入新字串[browser.cache.disk.parent_directory],它的值是你的目录位置 重启Firefox就会发现速度有变化(希望是变快:)

  2. 几个其他小改动(来源)关掉IPV6,在/etc/modprobe.d/aliases里找到

    alias net-pf-10 ipv6

    改为

    alias net-pf-10 off #alias net-pf-10 ipv6

    主机名和localhost关联,在/etc/hosts,改成如下的东西

    127.0.0.1 localhost yourhost
    127.0.1.1 yourhost

未完待续…

Comments (1) Posted on Saturday, December 29th, 2007