Hello Ubuntu!

record my way to ubuntu

Friday, May 21, 2010

find xargs space

Change attribute of all sub directories:
find . -type d -or -name "*.sh" | xargs chmod 777

Change attribute of all files:
find . -type f | xargs chmod 666

To avoid the problem because of space in directory/file name, use the following option:
find . -type d -or -name "*.sh" -print0 | xargs -0 chmod 777
find . -type f -print0 | xargs -0 chmod 666

Monday, July 23, 2007

A4?? Letter??

https://answers.launchpad.net/ubuntu/+source/evince/+question/6846

This is because evince uses the value of the LC_PAPER locale setting, for en_US.UTF-8 this defaults to letter.
You can override this setting by using an LC_PAPER environment variable, if you want to do the change system wide you can add LC_PAPER="en_GB.UTF-8" (defaults to A4) to /etc/environment and log out and back into GNOME.
Pascal De Vuyst said on 2007-05-22:


Many thanks indeed, Pascal! I added

export LC_PAPER="en_GB.UTF_8"

to ~/.profile and it works perfectly! It is a little bit weird that evince
determines the paper SIZE from a COUNTRY setting (and not from
a size setting, like the one in /etc/papersize). In my opinion, this
should be changed in future.

Best regards

Carniolian

Thursday, May 10, 2007

How to fix “There are no public key available for the following key IDs” Error in Debian

http://blog.kovyrin.net/2006/11/28/debian-problem-apt-get-update/

Problem:
# apt-get update
......
Fetched 5562B in 13s (421B/s)
Reading package lists... Done
W: There are no public key available for the following key IDs:
A70DAF536070D3A1
W: You may want to run apt-get update to correct these problems
#


Answer1:
$ apt-key update
Answer2:
# gpg --keyserver wwwkeys.eu.pgp.net --recv-keys XXXXXXXXXXXXXXXX
...
# apt-key add /root/.gnupg/pubring.gpg
...
# apt-get update
...

Saturday, April 21, 2007

Adobe Acorbat Reader启动失败:expr: syntax error

上个月把系统升级到7.04,中间遇到了不少问题,题目都记了下来,但是一直懒得写。今天把adobe acorbat reader从7.0.8升级到7.0.9又遇到了一样的问题,就先写这个吧。
症状:Acorbat Reader无法启动,在终端输入acroread出现expr: syntax error循环。
解决办法:
sudo gedit /usr/bin/acroread
先在#!/bin/sh后加入
export GTK_IM_MODULE=xim
这个是和SCIM冲突的老问题,如果不用SCIM就不要加这句。接着查找到
echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]\)00.\([0-9]*\)\|\(.*\)/\1\2\3/g'
把它替换成
echo $mfile| sed 's/libgtk-x11-\([0-9]*\).0.so.0.\([0-9]\)*00.\([0-9]*\)\|\(.*\)/\1\2\3/g'
存盘退出就OK了。
这里死循环是因为查找文件libgtk-x11引起的,新的ubuntu里面这个文件的版本号已经变成libgtk-x11-2.0.so.0.1000.11,注意中间的1000,而死循环里面就找到000-900,加了个星号就扩大了查找范围了就找到了。

Tuesday, April 03, 2007

Install D-Link DWL-650+ on Debian 4.0 Etch (acx100)

The laptop for my wife is an Acer with C700 CPU and 192MB memory (incl. shared vga memory). I think it's quick enough (or slow enough :)) for internet, chat, text or film. But if i use Windows on this laptop, i muss install antivirus software and firewall software, then system will be very slow. I choice Debian instead of Ubuntu, because i want a small and clean system as required. Here to record is how to install the wireless lan card D-Link DWL-650+ on the Debian system.

The most popular Howto about DWL-650+ on Debian is from Aachen: http://stef.tvk.rwth-aachen.de/~nazgul/debian/DWL-650+_Howto.html
But it's not up-to-date, and should be changed a little.

Prepare for build
First of all, make sure the following line is in the /etc/apt/sources.list
deb http://ftp.debian.org/debian/ unstable main contrib
Then install the necessary applications, use
apt-get install wireless-tools module-assistant acx100-source
Pay attention: DON'T try to install the "hotplug", because "udev" is used instead of "hotplug" in the new Linux Distributions. When you use "apt-get install hotplug", the kernel-image will be removed and the whole system could be destroyed.

The kernel header source is also necessary. Use the following to get it:
apt-get install linux-headers-`uname -r`
Ask module-assistant to update the known modules.
module-assistant update
Compile drive module: acx100
Compile and install acx100 module by using:
module-assistant auto-install acx100
After build try to load the module, use
modprobe acx
When no error Message, then use following line to make acx module to be loaded automatically at boot time.
echo acx >>/etc/modules

Prepare the firmware
Only with the acx100 module and without the firmware, the card can not be drived. DON'T use the acx100-firmware_1.9.8.b_all.deb or acx100-firmware_1.9.8.b-3_all.deb from http://stef.tvk.rwth-aachen.de/~nazgul/debian/DWL-650+_Howto.html
Download the firmware from http://www.kazer.org/acx-firmware-20060207.tar.bz2
Extract the three files in folder acx100_1.10.7.K from this bz2 file and put them to /lib/firmware/. Maybe you should also make a link to /usr/lib/hotplug/firmware/ by using
ln -s /lib/firmware/tiacx* /usr/lib/hotplug/firmware/

Network Setting
The last step is network setting. Open the file /etc/network/interfaces and add the wireless lan setting. I paste my interfaces file here:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback


# The primary network interface
allow-hotplug eth0

iface eth0 inet dhcp
#iface eth0 inet static
# address 192.168.1.5
# netmaske 255.255.255.0
# network 192.168.1.0
# broadcast 192.168.1.255
# gateway 192.168.1.1


# The second network interface
allow-hotplug wlan0
auto wlan0

iface wlan0 inet dhcp

wireless_mode managed
wireless_channel 6
wireless_essid xc
wireless_key1 6a6975627567616f00756e6961
wireless_ap 00:15:0c:00:e7:c3


If you have problem when load the acx driver module, see the instruction in acx100 wiki:
http://acx100.sourceforge.net/wiki/Distribution_list/Debian

Saturday, January 20, 2007

Install PSPVC

下载PSPVChttp://pspvc.sourceforge.net/
解压缩
tar -xvf pspvc-install-0.2.1.tar



下列包必须先安装好。
-libgtk2.0dev
-libfaac-dev
-libxvidcore4-dev
-nasm
-build-essential

然后开始安装
cd /pspvc-install-0.2.1
sudo sh install


安装完后,输入命令pspvc开始运行程序。

Monday, January 01, 2007

Samba and Swat

Samba and Swat
Oddly enough, I think SWAT was never in the planes for Ubuntu.

I have no problem in setting things up manually, and scrubbing a few conf files till perfection... but I've realized it's a commom problem for most people.

Of course I've been through the usual steps, such as sudo apt-get samba samba-common smbfs smbclient swat

But for you to get swat to work, you will need to install a dependency beforehand apt-get install xinetd .

Then, sudo vi /etc/inetd.conf and uncomment the line:

## swat stream tcp nowait.400 root /usr/sbin/tcpd \ /usr/sbin/swat


Then make an entry for Swat under xinetd with sudo vi /etc/xinetd.d/swat

And it should look like this:

# description: SAMBA SWAT
service swat
{
disable = no
socket_type = stream
protocol = tcp
#should use a more limited user here
user = root
wait = no
server = /usr/sbin/swat
}


Then, sudo dpkg-reconfigure xinetd to restart with the new configuration.

Now the netstat -lt should echo something similar to this:

Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:5666 *:* LISTEN
tcp 0 0 localhost:1026 *:* LISTEN
tcp 0 0 localhost:1027 *:* LISTEN
tcp 0 0 *:swat *:* LISTEN
tcp 0 0 localhost:mysql *:* LISTEN
tcp 0 0 *:netbios-ssn *:* LISTEN
tcp 0 0 *:10000 *:* LISTEN
tcp 0 0 *:1040 *:* LISTEN
tcp 0 0 *:munin *:* LISTEN
tcp 0 0 localhost:ipp *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp 0 0 *:microsoft-ds *:* LISTEN
tcp6 0 0 *:2080 *:* LISTEN
tcp6 0 0 *:www *:* LISTEN
tcp6 0 0 *:ssh *:* LISTEN


Which indicates the swat service is running and listening to the correct 901 tcp port.

Remember to open the TCP port for the firewall if you are using any.

My iptables -L -v looks like that:

Chain INPUT (policy ACCEPT 1607 packets, 168K bytes)
pkts bytes target prot opt in out source destination
18688 3148K ACCEPT all -- any any anywhere anywhere state RELATED,ESTABLISHED
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:ssh
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:www
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt:microsoft-ds
18 3450 ACCEPT udp -- eth0 any anywhere anywhere udp dpts:netbios-ns:netbios-ssn
11 528 ACCEPT tcp -- eth0 any localnet/24 anywhere tcp dpt:swat
0 0 ACCEPT tcp -- eth0 any anywhere anywhere tcp dpt: x11
291 39656 ACCEPT udp -- eth0 any localnet/24 anywhere
0 0 ACCEPT icmp -- eth0 any localnet/24 anywhere
94 6728 ACCEPT all -- lo any anywhere anywhere
0 0 DROP all -- any any anywhere anywhere

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination

Chain OUTPUT (policy ACCEPT 2317K packets, 2125M bytes)
pkts bytes target prot opt in out source destination



You might be able to access http://<yourserver>:901/

What's UUID?

注释:UUID

每个硬盘驱动器都有一个独特的标志,叫做 UUID。要解决设备名称的变动问题,devlabel 允许你使用用户定义的设备名称来关联这些 UUID。一个符号链接会被创建来连接用户定义的设备名称和实际的设备名称。如果实际的设备名称改变了,这个符号链接会被更新,并根据驱动器的 UUID 来指向同一驱动器。因此,IDE 和 SCSI 贮存设备都可以使用它们的用户定义的名称被引用。

Devlabel 还允许你自动挂载热插入的设备,如可移硬盘和数码照相机的内存卡之类的 USB 设备。如果被配置成自动挂载,设备被插入后,它就会使用用户定义的设备名称被挂载。

那如何才能知道UUID呢?
ls -l /dev/disk/by-uuid


Linux联盟收集整理

Followers