Beruflich Dokumente
Kultur Dokumente
GNU/Linux
AMD64 & IA32, Debian & Fedora, and more
C.Q. Bui
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
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
or:
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.
# 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 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.
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:
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.
Important Issues
Others:
hal, policykit-1, pm-utils and upower to allow normal users to restart, shut
down, hibernate,. . . through LXDE’s logout dialog.
4 Important Issues
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
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.
1. Obtain a prior set of source packages, this set include, in general, the three files:
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
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.
$ ps
$ top -d 0.1 (-d 0.1 is time to refresh the system: 0.1s)
format
# dvd+rw-format -lead-out /dev/dvd
from dvd:
# growisofs -dvd-compat -Z /dev/dvd=Fedora-10-x86 64-DVD.iso -speed=2
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.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
Here eth1 is the NIC used to wake on LAN. Add the two line into the local computer’s
/etc/ethers file:
# ifconfig | grep HW
$ 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:
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
• 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
– 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.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
Fedora x86 64
• We also have to install the package: libXp-1.0.0-8.x86 64.rpm
• 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:
# 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.
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’.