Linux Commands Ebooks
These are 3 ebooks containing over 1000+ commands. one for Fedora/RHEL/CentOS, one for OpenSUSE and one for Ubuntu. ENJOY!!
Fedora/RHEL/CentOS Ebook - download
OpenSuSe Ebook - download
Ubuntu Ebook - download
------------------------------------------------------------------------------------------
Microsoft fonts for Fedora/Redhat/Centos
Download Microsoft core fonts RPM that includes fonts in XP/Vista
Download Microsoft Fonts
------------------------------------------------------------------------------------------
Latest Downloads
Posted by Uddika Jayaweera 0 comments
Wake on LAN
Start computer from remote machine. You need to set BIOS enable function of Wake on Lan.
[1] Install wakeonlan.
[root@server ~]# wget http://gsd.di.uminho.pt/jpo/software/wakeonlan/downloads/wakeonlan-0.41-0.fdr.1.noarch.rpm
[root@server ~]# rpm -Uvh wakeonlan-0.41-0.fdr.1.noarch.rpm
warning: wakeonlan-0.41-0.fdr.1.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 91bd851b
Preparing... ############################ [100%]
1:wakeonlan ############################ [100%]
[2] You need to know MAC address of the computer first you'd like to start from remote. It's possible to know 'ifconfig' command.
MAC address is just the section 'HWaddr **:**:**:**:**:**'.
Then input the commands below from remote machine and start computer.
[root@dlp ~]# wakeonlan **:**:**:**:**:**
------------------------------------------------------------------------------------------
Posted by Uddika Jayaweera 0 comments
Configuring a master NIS Server
1. Check the necessary rpm’s
#rpm –q ypserv yp-tools ypbind
2. Set the NIS Domain name
#nano /etc/sysconfig/network
At the end of file, in a new line, Type
NISDOMAIN=server.lk
Save(CTRL+O) and exit(CTRL+X) file
3. Set the local loopback ip as the nis server ip to indicate the machine is going to become for NIS server
#nano /etc/yp.conf
At the end of file, in a new line, Type
ypserver 127.0.0.1
Save(CTRL+O) and exit(CTRL+X) file
4. Start the necessary NIS server services
• yppasswdd – (NIS Password Service)
service status - #service yppasswdd status
start service - #service yppasswdd start
add startup - #chkconfig yppasswdd on
check - #chkconfig yppasswdd --list
• ypserv – NIS server service(to manage user/ group and NIS domain name)
service status - #service ypserv status
start service - #service ypserv start
add startup - #chkconfig ypserv on
• ypxfrd – NIS map service (To manage user/ group all database)
service status - #service ypxfrd status
start service - #service ypxfrd start
add startup - #chkconfig ypxfrd on
5. Now we have to create a central user and a group maagement database. During the creation you have to give the NIS slave server names one by one (optional)
#/usr/lib/yp/ypinit –m
Give slave server names one by one (if any)
After CTRL + D, press “Y” to enter, the accept the name list.
After edit he slave server list use this file
#nano /var/yp/ypservers
6. Start the NIS client service on the server, so we can join our clients to the domain
#service ypbind start
#chkconfig ypbind on
How to join a client PC to a NIS Domain (Client Side)
7. Delete all local user and group accounts from the clients
• User Accounts
#tail /etc/passwd
#userdel –r username
• Group Account
#tail /etc/group
#groupdel groupname
• Home Folder
#cd /home
#ls –l
#rm –rf homefoldername
8. Join the client to the domain
#authconfig-tui
Select “use NIS”
Domain – server.lk //NIS Domain Name
Server – 10.0.0.100 //Master Server IP
Creating central user and group accounts on the master server
If there were any user accounts / group account on the master server during the practical they would be automatically converted.
• Add local account first
(user)
#useradd uddika
#passwd uddika
(group)
#groupadd mygroup
• Convert the above account in to NIS
#cd /var/yp
#make
Now you will be able to login from the client pc’s using the user account. We created on the master server but the client wont to be able to locate the users home folder. To fix the problem do the following.
9. Share the home folders from the master NIS server using NFS service (Network File System)
#service nfs status
#service nfs start
#chkconfig nfs on
To share home folders.
#nano /etc/exports
At the end of file, in a new line, Type
/home *(rw,sync)
Save(CTRL+O) and exit(CTRL+X) file
#service nfs reload
Check – #exportfs –arv
A folder shared using NFS must be access from the other machines by mounting, since it can be to dificult for normal users, to mount their own home folder. We are going to auto mount the home folders to the clients (client side configuration)
#nano /etc/fstab
At the end of file, in a new line, Type
10.0.0.100:/home /home nfs defaults 0 0
Save(CTRL+O) and exit(CTRL+X) file
How to change your own password as a NIS user
#yppasswd
How to change NIS user password as root from the master server
#yppasswd uddika
Root Password ---------------------
New Passwod ----------------------
Retype password -------------------------
Posted by Uddika Jayaweera 0 comments
Custom GRUB splash image
- Log or Switch in to the root account
- Get an image file to use for the new splash image (can be some wallpaper in jpg, png format)
- Check whether ImageMagick rpm is installed
- If it's not installed you have to install it first
- Then, Assuming the image is in the root's home folder & the image name is "myboot.jpg"
[root@server ~]# convert myboot.jpg -resize 640x480! -colors 14 -depth 8 myboot.xpm
[root@server ~]# ls
- Now you will be able to see a file call "myboot.xpm"
- Then you have to gzip it.
[root@server ~]# ls
- Now you will be able to see a file call "myboot.xpm.gz"
- Then you have to copy it to "/boot/grub" folder
- Then you have to edit "grub.conf" file with your favorite text editor, I'll use "nano" text editor
Edit the following line
splashimage=(hd0,0)/grub/splash.xpm.gz
to
splashimage=(hd0,0)/grub/myboot.xpm.gz
NOTE- DON'T EDIT ANYOTHER PARAMETER OF THE LINE, ONLY CHANGE THE IMAGE FILE NAME.
save & exit
- Then reboot your system
- Then you'll be able to see the new GRUB spalsh image during the startup.
Posted by Uddika Jayaweera 1 comments
Media playback in CentOS5 and RHEL5
Media (DVD, web content, video & audio) playback in CentOS5 and RHEL5
01. Download RPMFORGE repo configuration RPM.
32bit
http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
64bit
http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
Go to the downloaded location, Install it.
32bit
[root@server ~]# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm
64bit
[root@server ~]#rpm -ivh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
02. DVD playback
[root@server ~]#yum -y install libdvdcss libdvdread libdvdplay libdvdnav lsdvd libdvbpsi
03. Gstreamer and Gstreamer-plugins
[root@server ~]#yum -y install gstreamer gstreamer-plugins-good gstreamer-plugins-bad gstreamer-plugins-ugly
04. Mplayer and Mplayer-plugin
[root@server ~]#yum -y install mplayer mplayerplug-in
05. XMMS with MP3 support and Other codecs
[root@server ~]#yum -y install xmms xmms-crossfade xmms-mp3 xmms-musepack xmms-wma
06. W32codecs
Download
http://rpm4fc-cn.googlecode.com/files/w32codecs-20071007-0.1.i386.rpm
Go to the downloaded location and install
[root@server ~]#rpm -ivh w32codecs-20071007-0.1.i386.rpm
07. Adobe Flash Player
Download
http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
Go to the downloaded location and install
[root@server ~]#rpm -ivh adobe-release-i386-1.0-1.noarch.rpm
Then install the flash player
[root@server ~]#yum -y install flash-plugin
08. Sun Jre (Java Runtime Environment)
Install the dependencies
[root@server ~]# yum -y install compat-libstdc++-33 compat-libstdc++-296
Go to www.java.com and go to download section download the Linux RPM (self-extracting file)
Go to the downloaded location
[root@server ~]#chmod +x jre-6u12-linux-i586-rpm.bin
[root@server ~]#./jre-6u12-linux-i586-rpm.bin
check
[root@server ~]#java –version
If the result is some thing like this, every thing is ok.
java version "1.6.0_12"
Java(TM) SE Runtime Environment (build 1.6.0_12-b04)
Java HotSpot(TM) Client VM (build 11.2-b01, mixed mode, sharing)
othewise the result is something like this, that means sun java is not yet default.
java version "1.4.2"
gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
To make sun java default
[root@server ~]#alternatives --install /usr/bin/java java $(rpm -ql jre | grep bin/java$) 2
[root@server ~]#alternatives --display java
[root@server ~]#alternatives --config java
type number 2
installing sun java plugin for firefox
first we have to disable selinux protection for the plugin
check the status of selinux
[root@server ~]#getenforce
if the result is "disabled" no need to do the following command, othewise you do
[root@server ~]#chcon -t textrel_shlib_t "$(rpm -ql jre | grep libdeploy\\.so$)"
now we can install the plugin
[root@server ~]#cd /usr/lib/mozilla/plugins
[root@server ~]#ln –s /usr/java/jre1.6.0_12/plugin/i386/ns7/libjavaplugin_oji.so
------------------------------------------------------------------------------------------
Forgot your Windows admin password?
Overview
- This is a utility to (re)set the password of any user that has a valid (local) account on your Windows NT/2k/XP/Vista etc system.
- You do not need to know the old password to set a new one.
- It works offline, that is, you have to shutdown your computer and boot off a floppydisk or CD or another system.
- Will detect and offer to unlock locked or disabled out user accounts!
- There is also a registry editor and other registry utilities that works under linux/unix, and can be used for other things than password editing.
Why
NT stores its user information, including crypted versions of the passwords, in a file called 'sam', usually found in \windows\system32\config. This file is a part of the registry, in a binary format previously undocumented, and not easily accessible. But thanks to a German(?) named B.D, I've now made a program that understands the registry.
This site provides CD and floppy images for end users to easily edit their forgotten passwords. But it also provides full source code and binary builds of the tools to allow others to use as they like for other purposes. Registry format documentation also available.
How to get it
The following is available for download and information:
- Frequently asked questions - Please read before asking questions about the passoword reset CD/floppy.
Accessing Windows partitions from Linux
By default any Linux system will fully support FAT partitions, But when it comes to NTFS some are still NOT supporting by default.
Desktop Editions such as Ubuntu 7.10 and Fedora 8 now fully supporting NTFS (with write support), and the partitions are automatically mounted.
Server Editions such as CentOS 5 and RHEL 5 you have to do the following to access NTFS partitions.
01. Configure RPMFroge 3rd party repository, please read my tutorial about CentOS Repositories.
02. Install the following packages
[root@server ~]# yum install dkms-fuse fuse-ntfs-3g
Accessing the Windows partitions.
01. See what are the current partitions in your system, and figure out what partitions belongs to windows.
[root@server ~]# fdisk -l
Usually NTFS partitions will be displayed with a HPFS/NTFS label, Where as FAT partitions will be labeled as W95 FAT32 or W95 FAT16
In the example I'm assuming,
/dev/hda1 = NTFS
/dev/hda2 = FAT32
02. Create mount points for each windows partition that you have in the system.
[root@server ~]# mkdir /media/ntfs
[root@server ~]# mkdir /media/fat32
check
[root@server ~]# ls -l /media
Note - The mount point name can be any name that you like.
03. Manually mounting the partitions.
FAT
[root@server ~]# mount /dev/hda2 /media/fat32
[root@server ~]# cd /media/fat32
[root@server ~]# ls -l
Note - You'll be having Read/Write access to FAT partitions.
NTFS
[root@server ~]# mount -t ntfs-3g /dev/hda1 /media/ntfs
[root@server ~]# cd /media/ntfs
[root@server ~]# ls -l
Note - You'll be having Read/Write access to NTFS partitions.
Once you manually mount the partitions, when you shutdown your PC the partitions will be automatically unmounted.
04. Automatically mounting the partition on boot.
[root@server ~]# nano /etc/fstab
at the end of file, enter the following lines.
/dev/hda1 /media/ntfs ntfs-3g defaults 0 0
/dev/hda2 /media/fat vfat defaults 0 0
What we have done is, first we give the partition number then the mount point then the file system then the permissions then whether to check the partition in case of a power failure, 0 (zero) means don't check since we don't have necessary tools to check NTFS or FAT partitions and finally the checking priority.
05. So now every time you boot your PC the partitions will be automatically mounted to the mount points.
------------------------------------------------------------------------------------------