Sie sind auf Seite 1von 24

The Principal Operations

GNU/Linux
AMD64 & IA32, Debian & Fedora, and more

C.Q. Bui

Wednesday, 24th june, 2009


ii
Contents

1 Topmost Strategies 1
1.1 Backup and Restore . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 The Entire Image of a Linux OS . . . . . . . . . . . . . . . . 1
1.1.2 Compress and Extract Data . . . . . . . . . . . . . . . . . . . 2
1.2 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2.1 Encrypting Data . . . . . . . . . . . . . . . . . . . . . . . . 2

2 Important Issues 3
2.1 X11 and LXDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.1 LXDE’s minimal packages: . . . . . . . . . . . . . . . . . . 3
2.1.2 X11 or Xorg’s minimal packages . . . . . . . . . . . . . . . 3
2.1.3 Starting LXDE . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2 Recover and Rescue . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.2.1 Rescue Linux after installing an MS Windows OS . . . . . . 4
2.2.2 Recover deledted data . . . . . . . . . . . . . . . . . . . . . 5
2.3 Manipulation with source code . . . . . . . . . . . . . . . . . . . . . 5
2.3.1 Install directly from the source code . . . . . . . . . . . . . . 5
2.3.2 Rebuild the corresponding binary package . . . . . . . . . . . 5
2.4 Delete, create, or change the type of file system of partitions . . . . . 6
2.5 Mount a NTFS partition and others . . . . . . . . . . . . . . . . . . . 6
2.6 Kernel informations . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.7 Show the rest of memories . . . . . . . . . . . . . . . . . . . . . . . 7
2.8 Change the password of an account . . . . . . . . . . . . . . . . . . . 7
2.9 Show the soundcard information and control voulume . . . . . . . . . 7
2.10 Some commands for files and directories . . . . . . . . . . . . . . . . 8
2.11 Install unicode fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.12 Install XVNKB in KDE 3.0 . . . . . . . . . . . . . . . . . . . . . . . 8
2.13 Compile xvnkb from source in fedora10.x86 64 . . . . . . . . . . . . 8
2.14 Add a line into the bottom of a file . . . . . . . . . . . . . . . . . . . 8
2.15 ‘yum’ and ‘wget’ Pass throughout a proxy . . . . . . . . . . . . . . . 8
2.16 The specification of the secure compy command . . . . . . . . . . . . 9
2.17 Copy data on network by konqueror . . . . . . . . . . . . . . . . . . 9
2.18 Format and burn (bootable) DVD disk . . . . . . . . . . . . . . . . . 9
2.19 Create file.iso . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
iv CONTENTS

2.20 Configure network connection in text mode . . . . . . . . . . . . . . 10


2.21 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.21.1 Check and list all installed packages relating to a certain package 10
2.21.2 Repeat a command for a long time . . . . . . . . . . . . . . . 11
2.21.3 Install remote desktop application: . . . . . . . . . . . . . . . 11
2.21.4 Setup proxy configuration for fedora 11 and 12 . . . . . . . . 11
2.21.5 Reset the icon of ibus: . . . . . . . . . . . . . . . . . . . . . 11
2.21.6 Set in an alias: . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.22 Splitting Large Files in Linux . . . . . . . . . . . . . . . . . . . . . . 11
2.23 Wake on LAN and relative commands . . . . . . . . . . . . . . . . . 12
2.23.1 Wake on LAN . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.23.2 Power off via ssh . . . . . . . . . . . . . . . . . . . . . . . . 12
2.23.3 alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.24 Change the owner, group, and access right of files/ directory . . . . . 13
2.25 Resetting The KDE’s Resolution in Debian 6 . . . . . . . . . . . . . 13
2.26 reset date and time . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.27 Make GNU/Linux Log in Automatically . . . . . . . . . . . . . . . . 14
2.28 LXDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

3 Applications 15
3.1 MATLAB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.2 Installing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.2 LATEX 2ε . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.1 Requirements: . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.2.2 Tipa (TEX international phonetic alphabet) . . . . . . . . . . 17
3.3 Oxford Advanced Learner’s Dictionary 8 . . . . . . . . . . . . . . . 17
3.3.1 Debian 6 IA32 . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.3.2 Debian 6 AMD64 . . . . . . . . . . . . . . . . . . . . . . . . 17
3.4 MPlayer on Hybrid Squeeze . . . . . . . . . . . . . . . . . . . . . . 18
3.4.1 Prerequisites . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.4.2 Compilation and parameters . . . . . . . . . . . . . . . . . . 18
3.5 make persistent debian live usb . . . . . . . . . . . . . . . . . . . . . 18
Chapter 1

Topmost Strategies

1.1 Backup and Restore

1.1.1 The Entire Image of a Linux OS


Backup: # tar cvpjf backup file name.tar.bz2 - -exclude=/proc - -exclude=/lost+found
- -exclude=/mnt - -exclude=/sys - -exclude=/backup file name.tar.bz2 /

or:

# tar cvpzf backup file name.tgz - -exclude=/proc - -exclude=/lost+found - -exclude=/mnt


- -exclude=/sys - -exclude=/backup file name.tgz /

Folders /proc and /sys involves virtual file systems that provide windows into variables
of the running kernel; folder /dev is a tmpfs whose contents are created and deleted
dynamically; so we do not to backup or restore them.

Restore: # tar xvpfj backup file name.tar.bz2 -C /


or:

# tar xvpfz backup file name.tgz -C /

after that, recreate the folders excluded before:

# mkdir /proc
# mkdir /lost+found
# mkdir /mnt
# mkdir /sys
...
2 Topmost Strategies

*Note: if you have to format the partition or restore to a different disk, update the
two files /etc/fstab and /boot/grub/grub.cfg after restoring your system:

• Use a live-usb to reboot the computer involving the reformatted partitions.

• Use the command blkid to show the UUIDs of the reformatted partitions.

• Change the old UUIDs in the two files to match the new UUIDs you have
obtained above.

1.1.2 Compress and Extract Data


Compress:

$ tar -cf filename.tar /directory/to/compress/


$ tar cfjpv filename.tar.bz2 /directory/to/compress/

Extract:
$ tar -xvf filename.tar
$ tar xfjpv filename.tar.bz2 -C /directory/to/extract/

1.2 Security
1.2.1 Encrypting Data
To created an encrypted version of a file, named after ‘filename.tar.bz2’ for example,
use the GNU Privacy Guard (GPG) package:

$ gpg -c filename.tar.bz2

after that, there exist two files: the new encrypted file, ‘filename.tar.bz2.gpg’, and
the original file, ‘filename.tar.bz2’; you have to delete the original file yourself, use the
‘shred’ program for secure deletion:

$ shred -zu /path/to/filename.tar.bz2


$ find /path/to/directory -type f -exec shred -uz ’{}’ \;

The latter is to shred a directory; this means finding recursively in the directory for
files (-type f) and execute for each of the files found the command ‘shred -uz’; where
the macro {} will be replaced by the file’s name.

Decrypting Encrypted files: use the command


$ gpg filename.tar.bz2.gpg
Chapter 2

Important Issues

2.1 X11 and LXDE


2.1.1 LXDE’s minimal packages:
lxde-core the minimal package to use LXDE

lxde-icon-theme the minimal package to use icons of LXDE

lxterminal the text console of LXDE

2.1.2 X11 or Xorg’s minimal packages


xinit the scripts used to initialize X11 or Xorg

xserver-xorg, xserver-xorg-core and xserver-xorg-video-vesa the minimal


packages to use X11
Note that to install these packeges, you will be showed to must initially install
its dependencies: xserver-xorg-input-all and xserver-xorg-video-all; the intallation of
these packages is very complicated and unnecessary; in fact, we only must intall
packages xserver-xorg-input-evdev instead of xserver-xorg-video-all and xserver-xorg-input-apm
instead of xserver-xorg-input-all.

Others:

screensaver to use screen saver and lock screen.

hal, policykit-1, pm-utils and upower to allow normal users to restart, shut
down, hibernate,. . . through LXDE’s logout dialog.
4 Important Issues

To enter the X11 environment from text console

startx; kill -9 $$;

2.1.3 Starting LXDE


Display manegement: If not use a display manegement, you would like to add:
export DESKTOP SESSION=LXDE
to your /̃.bashrc file in order xdg-open function properly.

Console: to start the desktop from the console-text mode, exit several options:

• Use startx, you will need to define LXDE in your /̃.xinitrc file by the following
line
exec ck-launch-session startlxde
this will launch LXDE with polycykit session supports (allow shutdown, restart,
. . . ):
xinit /usr/bin/ck-launch-session startlxde
this will start LXDE from console-kit session

• Otherwise, use
exec startlxde

• To start LXDE without the /̃.xinitrc:


xinit /usr/bin/startlxde
if the file /̃.xinitrc has already existed, this will not work.

You can run the startx automatically at boot time, but this is not our scenario here.
For other tasks, your have to ensure that the dbus is running as a daemon.

2.2 Recover and Rescue


2.2.1 Rescue Linux after installing an MS Windows OS
Chose Linux rescue mode and wait for. . .
#chroot /mnt/sysimage
#grub
#root (hd0,0)
#setup (hd0)
#quit
(more see: #grub-install /dev/sda)
Manipulation with source code 5

2.2.2 Recover deledted data


If you suddenly unintentional delete your data, for example by using rm -rfI. You
can use command extundelete to recover the lost data, in order to use it, you have to
install the package extundelete. Umount the partition containing the data and issue the
command:
# extundelete /dev/yourdevice - -restore-directory /path/to/your/directory.

2.3 Manipulation with source code


2.3.1 Install directly from the source code
# tar -jxvf filename.bz2
# tar -zxvf filename.gz
(After that, open README and INSTALL files to show the guide, but in common:)
# ./configure (–enable-gui)
# make
# make install

2.3.2 Rebuild the corresponding binary package


Of course, all packages come in text form from scratch and then are packed into
tarballs (filename.tar, filename.tar.gz, etc.) or binary packages (filename.deb). The
binary packages is very convenient to install because it is adapted to particular systems,
moreover, in the other hand, these packages is very limited to different platforms that
it is not intended to be adapted to. In these cases you can rebuild the binary package
adapted to your particular system from its source code. You have to install the package
dpkg-dev which involves tools for development binary packages.

1. Obtain a prior set of source packages, this set include, in general, the three files:

• filename.dsc is the file containing information needed to build a binary file.


• filename.debian.gz (or former, filename.diff.gz) is the tarball containing all
patches applied to the new binary file.
• fileneme.orig.tar.gz is the original source code.

You can obtain this set from online repositories or extract its tarball of source
code, move into the directory and issue the command:
# dpkg-source -b package-version

2. In the directory containing the set, issue the command


# dpkg-source -x filename.dsc
This will extract the tarballs and create a new directory named after filename-version
ready for building binary the binary package.
6 Important Issues

3. Move into the new directory filename-version and issue the command:
# dpkg-buildpackage -b.
Now, you will see the binary file name after filename-version yourarchitecture.deb
ready for installing in the upper directory.

For more detailed information, see


http://www.infodrom.org/Debian/doc/maint/Maintenance-pkgbuild.html

2.4 Delete, create, or change the type of file


system of partitions
# rpm -ivh e2fsprogs-1.41.3-2.fc10.x86 64.rpm
# mkfs.ext3 /dev/sda5
# fdisk -l /dev/sdx (x stand for the hard disk driver: a, b,. . . )
# fdisk /dev/sdan (n stand for the partition: 1, 2,. . . )
(Next, type m, enter for executive guides)

2.5 Mount a NTFS partition and others


1. install ntfs-3g package

2. List the table of NTFS partitions:


# /sbin/fdisk -lu /dev/sda — grep NTFS
Show the partitions command:
$ sudo df -Th

3. Mount the partitions:


# sudo mount /dev/sda3 /media/C:windows -t ntfs-3g -r -o umask=0222
# sudo mount /dev/sda3 /media/D:Data -t ntfs-3g -r -o umask=0222
# sudo mount /dev/sda3 /media/E:Setups -t ntfs-3g -r -o umask=0222
(That is mount on read-only mode, to mount on read-write mode:) # umount
/media/C Windows
# mount /dev/sda3 /media/C:Windows -t ntfs-3g -rw -o umask=0000

4. In order to linux automatically mounted ntfs partitions when it had restarted:


open /etc/fstab and add these command lines:
/dev/sda3 /media/C:Windows ntfs-3g ro,defaults,umask=0222 0 0
/dev/sda5 /media/D:Data ntfs-3g ro,defaults,umask=0222 0 0
/dev/sda6 /media/E:Setups ntfs-3g ro,defaults,umask=0222 0 0
(Anh if you want to mount in read-write mode: /dev/sda3 /media/C:Windows
ntfs-3g rw,defaults,umask=0000 0 0
(To mount FAT16, FAT32 (VFAT) file system we are simply only replace ntfs-3g
by vfat)
Kernel informations 7

2.6 Kernel informations


# uname -an
Kernel Compiling:
Extract the kernel’s directory:
# cp linux-2.6.22.9 /usr/src && cd /usr/src
# tar -jxvf linux-2.6.22.9 && cd linux-2.6.22.9
Patch if need:
# patch -p1 –dry-run ¡ /file patch
# patch -p1 ¡ /file patch
Compile:
# make menuconfig (hoc make config hoc make xconfig)
# make dep
# make clean
# make bzImage (approximatly 1 hour)
# make modules (approximatly 2 hour)
# make modules install
# make install

2.7 Show the rest of memories


$ cat /proc/swaps
$ free
$ cat /proc/meminfo

Show the applications being running:

$ ps
$ top -d 0.1 (-d 0.1 is time to refresh the system: 0.1s)

2.8 Change the password of an account


# passwd Chi

2.9 Show the soundcard information and control


voulume
# alsamixer
8 Important Issues

2.10 Some commands for files and directories


dir := ls
rm : delete files
rm -rf : delete directory and all thing in it
mv : move or rename a file
mkdir : create a directory
rmdir : delete an empty directory
cp -rf : copy file or directory cd : move to other directory

2.11 Install unicode fonts


copy the directory consisting of the fonts into /usr/share/fonts and type # fc-cache

2.12 Install XVNKB in KDE 3.0


An error issue: ”Could not start kdeinit....” l do file /etc/ld.so.preload
Repair: after execute ./configure change the 5th line of Makefile.cfg:
LIBDL=-ldl by
LIBDL=-ldl -lX11
and type make and make install

2.13 Compile xvnkb from source in fedora10.x86 64


yum install gcc
yum install xorg-x11-server-devel.x86 64
yum install libXft-devel.x86 64
./configure && make && make install

2.14 Add a line into the bottom of a file


$ echo ’df -Th’ >> /path to the file

2.15 ‘yum’ and ‘wget’ Pass throughout a proxy


export http proxy=”http://nhanntt:085306@172.16.0.180:8080”
or add the lines below to the files /etc/yum.conf and /etc/wgetrc:
proxy=http://192.168.10.1:8080
proxy username=chinb
proxy password=buiquychi
The specification of the secure compy command 9

2.16 The specification of the secure compy command


scp user1@host1:/path/to/filename user2@host2:/path/to/filename
scp root@dell:/var/named/chroot/etc/named.conf Documents/
*Note: Another problem inherent to scp is that it needs to be able to find a scp binary
at the remote end. Usually such commands had been correctly installed in the remote
systems $PATH, but if they had not then transfers will fail:
# scp hachi:/tmp/foo /tmp
bash: scp: command not found

2.17 Copy data on network by konqueror


open konqueror application and in address space type:
fish://user1@host1 and type enter
then you can copy as used in your own computer.

2.18 Format and burn (bootable) DVD disk


# rpm -ivh genisoimage-1.1.8-1.fc10.x86 64.rpm
# rpm -ivh dvd+rw-tools-7.1-1.fc10.x86 64.rpm

format
# dvd+rw-format -lead-out /dev/dvd

from dvd:
# growisofs -dvd-compat -Z /dev/dvd=Fedora-10-x86 64-DVD.iso -speed=2

from files or directory:


# growisofs -Z /dev/dvdrw -R -J files/or/directory/to/burn

write more stuff to an initialized DVDRW:


# growisofs -M /dev/dvdrw -R -J new/files/or/directory/to/burn

*For files whose sizes are larger than 4 GB:


We have to use the univesal disk format file system and joliet-long mode for the names
of the stuff, in debian squezze, for example:

#growisofs -Z /dev/dvdrw -joliet-long -allow-limited-size -udf -R -J physicsbooks.iso.gpg


10 Important Issues

2.19 Create file.iso


We have to instal the package mkisofs

from dvd: # dd if=/dev/dvd of=/path/to/directory/filename.iso

from files and directory: # mkisofs -r -o iso file.iso directory/to/burn

genisoimage: because the debian 6 (squeeze) no longer supports the package mkisofs,
furthermore, the iso format has some restrictions, we can use an HFS-hybrid iso format
in advance of the conventional iso format, so we have to install the package genisoimage
and then use this command:
#genisoimage -l -o output file name.iso -R -J -hfs /path/to/directory/to/burn

2.20 Configure network connection in text mode


# vim /etc/systemconfig/network-scripts/ifcfg-eth0
“DEVICE=eth0
HWADDR=00:19:D1:7D:25:4D
ONBOOT=yes
BOOTPROTO=static (or BOOTPROTO=dhcp)
IPADDR=10.8.73.116
NETWORK=10.8.73.0
NETMASK=255.255.255.0
BROADCAST=10.8.73.255”
# chkconfig network on
# /etc/init.d/network restart

2.21 Miscellaneous
To type vienamese letters, we should use SCIM or IBUS instead of xvnkb or x-unikey.
Because the formers are completely compatible with linux OS. We must install the
follow packages:
scim, scim-m17n, scim-tables, scim-tables-vietnamese for scim or:
ibus, ibus-m17n, m17n-db, m17n-contrib, m17n-db-vietnamese, m17n-contrib-vietnamese
for ibus.
Also, we only have to install “ibus-unikey“ package instead of all above for ibus

2.21.1 Check and list all installed packages relating to a


certain package
# rpm -qa |grep kde
Splitting Large Files in Linux 11

2.21.2 Repeat a command for a long time


$ while x=0; do your command; sleep interval;done
$ while true; do your command; sleep interval;done
$ while x=0; do mplayer Track43.mp3; sleep 3;done

2.21.3 Install remote desktop application:


Install and turn on xrdp on a server and rdesktop on a remote machine:
#rpm -ivh xrdp-0.5.0-0.5.20090811cvs.fc10.x86 64.rpm
#chkconfig - -level 5 xrdp on
#service xrdp start
and on remote machine:
#rpm -ivh rdesktop-1.6.0-2.fc10.x86 64.rpm
access to the server from the remote machine by type:
$rdesktop -r sound:remote 10.8.73.84&

2.21.4 Setup proxy configuration for fedora 11 and 12


fedora 12 does not support format as “http proxy=http://username:password@ip proxy:port”,
it set proxy in /etc/yum.conf file as:
proxy=http://ip proxy:port
proxy username=username
proxy password=password

2.21.5 Reset the icon of ibus:


/etc/X11/xinit/xinput.d/ibus.conf

2.21.6 Set in an alias:


alias ’alias=command+command+parameters+. . . ’
E.g.: $ alias ’chi emacs=emacs -nw’
If you want alias to be set every boot times:
$ echo “alias ’chi emacs=emac-nw’” >> ./bashrc.

2.22 Splitting Large Files in Linux


$ split - -bytes=SIZE file name parts name
SIZE may be (or may be an integer optionally followed by) one of following: KB
(1000), K (1024), MB (1000*1000), M (1024*1024), and so on for G, T, E, Z, Y.

Putting all back together:


$ cat parts name* > file name
12 Important Issues

2.23 Wake on LAN and relative commands


2.23.1 Wake on LAN
To wake on LAN, you have to enable boot from network on BIOS setting. Run and
add the command into the remote’s /etc/rc.local file:

# ethtool -s eth0 wol g


# echo ’ethtool -s eth1 wol g’ >> /etc/rc.local

Here eth1 is the NIC used to wake on LAN. Add the two line into the local computer’s
/etc/ethers file:

# echo ’00:1C:C0:9C:F5:A5 pmaster’ >> /etc/ethers


# echo ’00:1C:C0:C5:7C:55 pnode4’ >> /etc/ethers

we can determine the NIC address by the command:

# ifconfig | grep HW

Use the bellow command to wake on LAN the remote computer:

$ su -c ’ether-wake -i eth1 pnode4’

2.23.2 Power off via ssh


To power off a remote computer via ssh we have to perform SSH login without password.
We’ll use ssh-keygen and ssh-copy-id to do this:

$ su -c ’ssh-keygen’
$ su -c ’ssh-copy-id -i /root/.ssh/id rsa.pub root@remotecomputer’

now we can poweroff the remote computer via ssh using the command:

$ su -c ’ssh root@pnode4 ’poweroff”

2.23.3 alias
put the lines below into the file .bashrc
alias chimacs=’emacs -nw’
#=============================
alias cmdwol=”ssh root@pnode3 ’ether-wake -i eth1 pnode3; ether-wake -i eth1 pnode4; ether-wake -i eth1 pmaster’ “
alias cmdpoweroff=”ssh root@pnode3 ’ssh pnode4 poweroff; ssh pmaster poweroff; poweroff’ “
alias cmd wol pnode4=”ssh root@pnode3 ether-wake -i eth1 pnode4 “
alias cmd wol pmaster=”ssh root@pnode3 ether-wake -i eth1 pmaster “
alias cmd sshpoweroff pnode4=”ssh root@pnode3 ’ssh pnode4 poweroff’ “
alias cmd sshpoweroff pmaster=”ssh root@pnode3 ’ssh pmaster poweroff’ “
#=====================================
Change the owner, group, and access right of files/ directory 13

alias oald8=’wine /home/users/chibqc/.wine/drive c/Program Files/Oxford/OALD8/oald8.exe’


alias longman=’wine /home/users/chibqc/.wine/drive c/Program Files/Longman/Longman Advanced American Dictionary/laad.exe’

2.24 Change the owner, group, and access right


of files/ directory
# chown -R new owner files or directory
# chgrp -R new owner files or directory
# chmod 755 files or directory

2.25 Resetting The KDE’s Resolution in Debian


6
• Hit the group “Ctrl + Alt + F2” and log in the root user.

• Hit the command “/etc/init.d/kdm stop” to stop the X graphical mode.

• Hit the command “Xorg -configure”. This will automatically generate the new
configuration file of the X graphical mode, that is named “xorg.conf.new” and
located in the present directory.

• Coppy the new file to the directory of the X server, rename it “xorg.conf”
(eliminate the tail “new”):
# mv xorg.conf.new /etc/X11/xorg.conf

• Open the file “/etc/X11/xorg.conf” and edit the following content:

– In the section “Screen”, before all the subsections, add the line: “DefaultDepth
x”. Here x can be 1, 4, 8, 15, 16, 24, that appear in the file xorg.conf and
stand for how quanlity the resolution are.
– In the appropriate subsection, in the section Screen, whose Depth has the
value x as you’ve chosen, add the line: “Virtual 1024 768” or any resolution
your system can be.

• Relog in your normal user and hit “startx” to enter the new X graphical mode.

2.26 reset date and time


# date -s “03/15/2011 15:15:00”
14 Important Issues

2.27 Make GNU/Linux Log in Automatically


To make (or disable) GNU/Linux log in automatically, we have to edit the file /etc/kde4/kdm/kdmrc
(or the file /etc/gdm/custom.conf for GNOME) at the lines 562th, 566th, and 572th (the
values of the “AutoLoginEnable”, “AutoLoginAgain”, and “AutoLoginUser” parameters)

2.28 LXDE
ii libgl1-mesa-glx 7.7.1-4 A free im
ii lxappearance 0.4.0-1 a new fea
ii lxde 0.5.0-4 Meta-pack
ii lxde-common 0.5.0-4 the Light
ii lxde-core 0.5.0-4 Meta-pack
ii lxde-icon-theme 0.0.1+svn20091206-2 LXDE Stan
ii lxinput 0.1.1-3 a program
ii lxmenu-data 0.1.1-1 freedeskt
ii lxpanel 0.5.6-1 a lightwe
ii lxrandr 0.1.1-2 simple mo
ii lxsession 0.4.4-3 a lightwe
ii lxsession-edit 0.1.1-2 configure
ii lxshortcut 0.1.1-1 easy way
ii lxterminal 0.1.8-2 desktop i
Chapter 3

Applications

Because Debian 6 (Squeeze) allows us to use 32-bit libs with a 64-bit (amd64) kernel.
I call this OS as Hybrid Squeeze.

3.1 MATLAB
3.1.1 Prerequisites
Hybrid Squeeze
• Because Squeeze don’t allow to access X-graphics system if you become the
superuser from a normal user using the su command; in order to install MATLAB,
you have to use the command

$ ssh -X root@debian (To become root with the available X-system.)

• We also have to install the package: libxp6 1.0.0.xsf1-2 i386.deb

Fedora x86 64
• We also have to install the package: libXp-1.0.0-8.x86 64.rpm

• After installation, you have to implement this command:


# sed -i ’s/XINERAMA/FAKEEXTN/g’ /matlabrootfolder/sys/java/jre/glnxa64/jre/lib/amd64/xawt/libmawt.so

• If after installation, you run matlab and see the error: “/matlabrootfolder/bin/glnxa64/MATLAB:
error while loading shared libraries: libut.so: cannot enable executable stack as shared object requires: Permission
denied”, so you must turn selinux off before running matlab.

3.1.2 Installing
# mkdir /matlabrootfolder
# cp /CDMatlab/crack/lic standalone.dat /matlabrootfolder/etc/license.dat (for individual PCs)
# cp /CDMatlab/crack/lic server.dat /matlabrootfolder/etc/lincense.dat (for clusters)
16 Applications

# /CDMatlab/./install
# ln -s /matlabrootfolder/bin/matlab /usr/bin/matlabcommandname (create a symbolic link.)

For clusters after installation, you have to make sure the contents of the two below
files consisting of the below lines:
# emacs /matlabrootfolder/etc/license.dat (must have the two lines:)
DAEMON MLM /matlabrootfolder/etc/lm matlab port=1711
SERVER server ipaddr ANY 27000 (for servers)
SERVER server ipaddr client ethaddr 27000 (for clients)
# emacs /matlabrootfolder/licenses/network.lic (must have the line:)
SERVER server ipaddr ANY 27000 (for servers)
SERVER server ipaddr client ethaddr 27000 (for clients)
# /matlabrootfolder/etc/./lmstart (to start the MATLAB license manager, on server only.)

3.2 LATEX 2ε

3.2.1 Requirements:

ii texlive-base 2009-11 TeX Live: Essential programs and files


ii texlive-bibtex-extra 2009-10 TeX Live: Extra BibTeX styles
ii texlive-binaries 2009-8 Binaries for TeX Live
ii texlive-common 2009-11 TeX Live: Base component
ii texlive-doc-base 2009-2 TeX Live: TeX Live documentation
ii texlive-extra-utils 2009-10 TeX Live: TeX auxiliary programs
ii texlive-font-utils 2009-10 TeX Live: TeX and Outline font utilities
ii texlive-fonts-extra 2009-10 TeX Live: Extra fonts
ii texlive-fonts-recommended 2009-11 TeX Live: Recommended fonts
ii texlive-lang-other 2009-3 TeX Live: Other hyphenation files
ii texlive-lang-vietnamese 2009-3 TeX Live: Vietnamese
ii texlive-latex-base 2009-11 TeX Live: Basic LaTeX packages
ii texlive-latex-extra 2009-10 TeX Live: LaTeX supplementary packages
ii texlive-latex-recommended 2009-11 TeX Live: LaTeX recommended packages
ii texlive-pictures 2009-11 TeX Live: Graphics packages and programs
ii texlive-publishers 2009-10 TeX Live: Support for publishers,
theses, standards, conferences, etc.
ii lmodern 2.004.1-3 scalable PostScript and OpenType
fonts based on Computer Modern
iU pgf 2.00-1 TeX Portable Graphic Format
Oxford Advanced Learner’s Dictionary 8 17

3.2.2 Tipa (TEX international phonetic alphabet)


# mkdir /usr/share/texmf/tex/latex/tipa
# cp -rf tipa source/sty/* /usr/share/texmf/tex/latex/tipa/
# mkdir /usr/share/texmf/fonts/source/fkr
# mkdir /usr/share/texmf/fonts/source/fkr/tipa
# cp -rf tipa source/mf/* /usr/share/texmf/fonts/source/fkr/tipa/
# mktexlsr
# mkdir /usr/share/texmf/fonts/tfm/fkr
# mkdir /usr/share/texmf/fonts/tfm/fkr/tipa
# cp -rf tipa source/tmf/* /usr/share/texmf/fonts/tfm/fkr/tipa/
To convert into pdf from dvi format:
# cp tipa source/dvips/tipa.map /usr/share/texmf/dvips/config/
# echo ”p +tipa.map” >> /usr/share/texmf/dvips/config/config.ps
# mkdir /usr/share/texmf/fonts/type1/fkr
# mkdir /usr/share/texmf/fonts/type1/fkr/tipa
# cp -rf tipa source/type1/* /usr/share/texmf/fonts/type1/fkr/tipa/
# mktexlsr
Note that, the default papersize of latex is letter, when converting into pdf, using
the below parameter to turn it into a4 paper:
$ dvipdf -sPAPERSIZE=a4 file.dvi

3.3 Oxford Advanced Learner’s Dictionary 8


*Note: after installing, if oald8 has no sound, run the command to load the sound
module:
# modprobe snd-pcm-oss

3.3.1 Debian 6 IA32


to enable sound in oald8 on debian 6.0.0 (squeeze) i386 system you have to install the
package festival (this package is in DVD1 with version 2.0.95 ˜ beta-5.1 i386.deb

*Conflict with libnss3-1d and Java (openjdk6) programming language:


because oald8 conflicts with the library libnss3-1d which is a dependence of openjdk6,
we have to delete the library file /usr/lib/libnss3.so.1d after installation java if we want
to use oald8 and java together on squeeze ia32.

3.3.2 Debian 6 AMD64


Install the package festival 2.0.95 beta-5.1 amd64.deb for OALD8 to work with sound.
Install the prerequisite packages firstly (all the dependences is in the debian-6.0.0-amd64.DVD.iso
image):
18 Applications

ia32-libs-gtk 20110117 amd64.deb


libgtk2.0-0 2.20.1-2 amd64.deb
Hit the command to run the setup process:
# mount /home/data/OALD8.iso /mnt/ -o loop -t iso9660
# linux32 /mnt/linux/setup.sh
# ln -s /path/to/oald8/root/folder /usr/bin/oald8

3.4 MPlayer on Hybrid Squeeze


3.4.1 Prerequisites
pakages and libs of OS
libc6-dev-i386 (libc6-dev 2.11.2-10 i386.deb)
gcc-defaults (gcc-4.4.5-1 i386.deb)
liblircclient0 0.8.3-5 i386.deb
libopenal1 1.12.854-2 i386.deb

Additional Binary (Win32) Codecs


# tar jxvf essential-20071007.tar.bz2
# mkdir /usr/local/lib/codecs (if this directory is not exist)
# mv essential-20071007/* /usr/local/lib/codecs/

3.4.2 Compilation and parameters


# ./configure - -enable-largefiles
# make
# make install
The parameter - - enable-largefiles is to allow access to large files over 2GB. You
can use the command ./configure with the following parameters:
- - enable-gui (required to install the GUI)
- - enable-menu (for menus in the OSD: On Screen Display)
- - prefix=/usr - - confdir=/etc/mplayer (to better match other MPlayer installations)
- -libdir=/usr/lib64 (for 64-bit OS)

3.5 make persistent debian live usb


In order to use the persistent property, an other separate-writable partition with
the specific label “live-rw” must be located on the USB, and the system must be
started with the boot paramether “persistent”.
Firstly, we have to partition the USB, divide it into two partitions with an active
one.
make persistent debian live usb 19

# fdisk /dev/sdb
> p % to print all partitions on the usb
> d % to delete a partition, choose 1, 2, . . . to delete.
> p % to print any partitions remaining, if partitions exist, repeate the previous step.

> n % to create a new partition


> p % to choose this is a primary partition
> 1 % to choose this is the first partition
> % hit “enter” to use the default fisrt cylinder
> % type “+1200M” to set the partition’s size

> n % to create a other new partition


> p % for primary partition
> 2 % to choose this is the second partion
> % hit “enter” to use the default cylinder.
> % hit “enter” again to use the default last cylinder.

> a % to choose an active partition


> 1 % to select the first partition as the active one.
> w % to write the new partition table.
Format the partitions with the second partition labeled “live-rw” for persistent property.
# mkfs.ext4 /dev/sdb1
# mkfs.ext4 -L live-rw /dev/sdb2
Coppy the live image into the first partition, and install grub into the partition.
# dd if=/path/to/liveimage of=/path/to/temporaryimage
# mount /path/to/temporaryimage /media/mnt -o loop
# mount /dev/sdb1 /media/usb
# cp -rf /media/mnt/* /media/usb/
# grub-install –no-floppy –root-directory=/media/usb/ /dev/sdb –force
# emacs /media/usb/boot/grub/grub.cfg

Create the file grub.cfg with the content including the boot parameter “persistent” as
below
menuentry ’diban-libve’
{ linux /live/vmlinuz boot=live persistent union=aufs config
initrd /live/initrd.img
boot
}
# umount /dev/sdb1 %to umount all the devices, reset your BIOS to boot from USB.

*Brief: By ‘full persistence’ it is meant that instead of using a tempfs for storing
modifications to the read only media (with the copy-on-write, COW, system) a writable
partition is used. In order to use this feature a partition with a clean writable supported
filesystem on it labled “live-rw” must be attached on the system at boot time and the
system must be started with the boot parameter ‘persistent’. This partition could be an
20 Applications

ext3 partition on the hard disk or on a usb key created with, e.g.:
# mkfs.ext3 -L live-rw /dev/sdb1
if you already have a partition on your device, you could just change the label with one
of the following:
# tune2fs -L live-rw /dev/sdb1 % for ext2, 3, 4 filesystems
But since live system users cannot always use a hard drive partition, and considering
that most USB keys have poor write speeds, ‘full’ persistence could be also used with
just image file even on a NTFS partition of a foreign OS, with something like:
# dd if=/dev/null of=/media/usb/live-rw bs=2500M seek=1
# mkfs.ext3 -F /media/usb/live-rw
then coppy the live-rw file to a writable partition and reboot with the boot parameter
‘persistent’.