Tag: Ubuntu

Ubuntu中pdf的乱码问题

Posted by – October 12, 2010

Ubuntu下pdf中文乱码的解决办法
办法一:

使用命令:

[bash]
sudo apt-get install xpdf-chinese-simplified xpdf-chinese-traditional
[/bash]

如果仍然中文乱码的话,需要安装poppler-data, 并且删除/etc/fonts/conf.d/49-sansserif.conf
使用命令:
[bash]
sudo apt-get install poppler-data
sudo cp /etc/fonts/conf.d/49-sansserif.conf /etc/fonts/conf.d/49-sansserif.conf.bak
sudo rm /etc/fonts/conf.d/49-sansserif.conf
[/bash]

选择PDF文件,点击右键,选择XPDF打开即可。

办法二:

安装Foxit Reader for desktop Linux

Foxit Reader is a free PDF document viewer for the Linux platform. 提供一个deb包很方便。
附件:
FoxitReader_1.0-1_i386.deb [3.25 MiB]
下载地址
http://forum.ubuntu.org.cn/download/file.php?id=64192
安装完成后,运行命令FoxitReader,打开PDF阅读器。

Ubuntu下的图形化分区管理工具–gparted

Posted by – October 10, 2010

Linux下也有类似PQ Magic一样的图形化分区管理工具,他的名字叫gparted:
[bash]
sudo apt-get install gparted
[/bash]

sudo without enter password

Posted by – October 10, 2010

1、使用root权限运行以下命令:
[bash]
visudo
[/bash]

2、把/etc/sudoers(自动打开)裡面最後一行:
[bash]
%admin ALL=(ALL)ALL
[/bash]

改為:
[bash]
%admin ALL=(ALL) NOPASSWD: NOPASSWD: ALL
[/bash]

kde desktop applet info

Posted by – October 7, 2010

1. kwriteconfig – Write KConfig entries (for use in shell scripts):
http://manpages.ubuntu.com/manpages/gutsy/man1/kwriteconfig.1.html

2.  kreadconfig – Read KConfig entries (for use in shell scripts)
http://manpages.ubuntu.com/manpages/gutsy/man1/kreadconfig.1.html

3.  kde desktop applet src file locaiton:
This file recorder .desktop file location, groups info, etc…
We can change desktop files position by mouse on KDE Desktop, below file will record it…
the program kdeinit4: plasma-desktop [kdeinit]  recorde the poistion to file below.

/home/<userName>/.kde/share/config/plasma-desktop-appletsrc: ( below is a entry of firefox.desktop in this file)
[Containments][14][Applets][33]
geometry=46,391.745912850909,78.7183612323325,87.2540871490914                  (x,y)=46,391.745912850909, icon size=(78.7183612323325, 87.2540871490914)-(x,y)
immutability=1
plugin=icon
zvalue=116

[Containments][14][Applets][33][Configuration]
Url=file:///usr/share/cocreate-default-settings/firefox.desktop

4. /usr/bin/startkde auto start when new user login Kde X window.

5. plasma-desktop

Rename Ubuntu box name

Posted by – September 14, 2010

On terminal:
[bash]
$ sudo vi /etc/hosts
$ sudo vi /etc/hostname
$ reboot
[/bash]

Refers to:
http://wiki.ubuntu.org.cn/%E6%9B%B4%E6%94%B9%E8%AE%A1%E7%AE%97%E6%9C%BA%E5%90%8D

install ubuntu 10.10 on hard disk using iso file

Posted by – September 13, 2010

To install Ubuntu on hard disk using iso file:

1. Download ubuntu iso file to a disk partition(e.g.: /dev/sda3) root(/) dir which NOT the partition will install Ubuntu.

[bash]
cd /
wget -c http://cdimage.ubuntu.com/daily-live/current/maverick-desktop-i386.iso
[/bash]

2. Only extract vmlinuz and initrd.lz from iso file the casper dir to the root(/) dir the iso file downloaded.
3. Reboot the box and enter into grub:

[bash]
reboot
[/bash]

Once rebooted, when see the grub list, enter ‘c’ to enter into grub.
4. Type below grub commands to install Ubuntu from hard disk:

[bash]
root (hd0,3)
kernel /vmlinuz   boot=casper    iso-scan/filename=/maverick-desktop-i386.iso ro quiet splash locale=zh_CN.UTF-8
initd    /initrd.lz
boot
[/bash]

4. Once enter into the new system, installing ubuntu by clicking the icon on your desktop, and follow the tips to finish installation.

Note:
1. You can renmae iso file for short.
2. You can remove the locale parameter from the kernel( if not work, use ‘linux‘ instead) command.

Enjoy!

Ubuntu mount permanently

Posted by – September 9, 2010

Ubuntu mount permanently: ( if not root, use sudo before each command below)
1. mkfs.ext3 or mkfs.ext4 your device like below:

[code lang=”bash”]mkfs.ext3 /dev/sda4
[/code]

2. Modify /etc/fstab, and append below line to the file:

[bash]/dev/sda4    /home/freespace    ext3    default,noatime    0     0
[/bash]

3. reboot your box:

[bash]reboot[/bash]

Tip:
Using more /etc/fstab to see more info about how to add entry to fstab file see below:

[bash]
root@JinLab:~/sda4# more /etc/fstab
[/bash]

# /etc/fstab: static file system information.
#
# Use ‘blkid -o value -s UUID’ to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
# / was on /dev/sda2 during installation
UUID=c1bc5ff4-157b-4e33-a30f-12e5691d77d0 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda1 during installation
UUID=69230e89-79fa-4bca-a37f-ce9461c31129 none            swap    sw              0       0

# /root/sda4 on /dev/sda4
UUID=2dbba927-0fb3-4ad0-97f0-9887364e5edc /root/sda4       ext3 defaults,noatime 0    0

Chm viewer on Ubuntun

Posted by – September 1, 2010

xchm: Compiled HTML Help (CHM) file viewer for X
To get it:
sudo apt-get install xchm

To search chm relates info:
sudo aptitude search chm

design: sign a Debian changes and dsc file pair using GPG/PGP

Posted by – August 1, 2010

On Ubuntu there are at least two methods to sign a debian changes & dsc file pair using PGP:
Enter into source codes dir, and type below each one commands:
1.sudo dpkg-buildpackage -sa -k$GPG_KEY

note: sign the pair during building package.

2. Two steps below:
1). sudo dpkg-buildpackage -sa
2). sudo debsign -k$GPG_KEY *.changes

note: sign the pair AFTER build package.

Vim on Debian

Posted by – July 7, 2010

The default vim configuration file locations on Debian/Ubuntu.
/etc/vim/vimrc

jin@jin-u10:/home/jin$ more  /etc/vim/vimrc
” All system-wide defaults are set in $VIMRUNTIME/debian.vim (usually just
” /usr/share/vim/vimcurrent/debian.vim) and sourced by the call to :runtime
” you can find below.  If you wish to change any of those settings, you should
” do it in this file (/etc/vim/vimrc), since debian.vim will be overwritten
” everytime an upgrade of the vim packages is performed.  It is recommended to
” make changes after sourcing debian.vim since it alters the value of the
” ‘compatible’ option.

” This line should not be removed as it ensures that various options are
” properly set to work with the Vim-related packages available in Debian.
runtime! debian.vim

” Uncomment the next line to make Vim more Vi-compatible
” NOTE: debian.vim sets ‘nocompatible’.  Setting ‘compatible’ changes numerous
” options, so any other options should be set AFTER setting ‘compatible’.
“set compatible

” Vim5 and later versions support syntax highlighting. Uncommenting the
” following enables syntax highlighting by default.
if has(“syntax”)
syntax on
endif

” If using a dark background within the editing area and syntax highlighting
” turn on this option as well
“set background=dark

” Uncomment the following to have Vim jump to the last position when
” reopening a file
“if has(“autocmd”)
”  au BufReadPost * if line(“‘\””) > 1 && line(“‘\””) <= line(“$”) | exe “normal! g’\”” | endif
“endif

” Uncomment the following to have Vim load indentation rules and plugins
” according to the detected filetype.
if has(“autocmd”)
filetype plugin indent on
endif

” The following are commented out as they cause vim to behave a lot
” differently from regular Vi. They are highly recommended though.
set showcmd        ” Show (partial) command in status line.
“set showmatch        ” Show matching brackets.
“set ignorecase        ” Do case insensitive matching
set smartcase        ” Do smart case matching
“set incsearch        ” Incremental search
“set autowrite        ” Automatically save before commands like :next and :make
“set hidden             ” Hide buffers when they are abandoned
set mouse=a        ” Enable mouse usage (all modes)
set hls            ” Highlight search

” Source a global configuration file if available
if filereadable(“/etc/vim/vimrc.local”)
source /etc/vim/vimrc.local
endif