Posted on October 12th, 2006 by Admin.
Categories: Linux.
To Use RPM’s :->
1. Install (Full RPM filename is must)
# rpm -ivh bind-libs-9.2.4-16.i386.rpm
2. List of files installed with a particular package.
# rpm -ql bind-utils
/usr/bin/dig
/usr/bin/host
/usr/bin/nslookup
/usr/bin/nsupdate
/usr/share/man/man1/dig.1.gz
/usr/share/man/man1/host.1.gz
/usr/share/man/man1/nslookup.1.gz
/usr/share/man/man8/nsupdate.8.gz
3. List of files from a package that is not installed
# rpm -pql bind-libs-9.2.4-16.i386.rpm
4. List dependencies
# rpm -qpR libpcap-0.8.3-7.i386.rpm
/sbin/ldconfig
/sbin/ldconfig
kernel >= 2.2.0
libc.so.6
libc.so.6(GLIBC_2.0)
libc.so.6(GLIBC_2.1)
libc.so.6(GLIBC_2.1.3)
libc.so.6(GLIBC_2.3)
openssl
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
5. Check the integrity, use the “-K” option.
# rpm -K /iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm
/iso0/Fedora/RPMS/libpcap-0.8.3-7.i386.rpm: (sha1) dsa sha1 md5 gpg OK
6. List all packages installed.
#rpm -qa
7.find out which file a package belongs to.
#rpm -qf /usr/lib/libecpg.so.4.1
8. uninstall a package
# rpm -e
9. verify md5 sum so that you know it downloaded ok
# rpm -K *.rpm
Posted on October 12th, 2006 by Admin.
Categories: Linux.
It converts text files in UNIX format to DOS format and vice versa…
1. DOS to UNIX text file format converter.
# dos2unix test.txt
2. for reverse way from UNIX to DOS
# unix2dos unixfile
Enjoy
Posted on October 12th, 2006 by Admin.
Categories: Cpanel Hosting, Linux.
ps command in detail
Here are the possible codes when using state “$ ps -e -o state,cmd”
PROCESS STATE CODES
D uninterruptible sleep (usually IO)
R runnable (on run queue)
S sleeping
T traced or stopped
Z a defunct (”zombie”) process
< high-priority (not nice to other users)
N low-priority (nice to other users)
L has pages locked into memory (for real-time and custom IO)
s is a session leader
l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do)
+ is in the foreground process group
For instance:
Note that the -o is for user defined, and -e is for select all process.
$ ps -e -o pid,state,start,time,etime,cmd
…
9946 S 15:40:45 00:00:00 02:23:29 /bin/bash -i
9985 T 15:41:24 00:00:01 02:22:50 vi manual
10320 T 17:38:42 00:00:00 25:32 vi test.c
…
You may want to command below, without the -e, which will give the process only under the current terminal.
$ ps -o pid,state,start,time,etime,cmd
To Check cause of Load on Server ..
$ ps -e -o %cpu,pid,state,start,time,etime,%cpu,%mem,cmd|sort -rn|less
$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1380 480 ? S Aug04 0:00 init [3]
root 2 0.0 0.0 0 0 ? SWN Aug04 0:00 [ksoftirqd/0]
root 3 0.0 0.0 0 0 ? SW< Aug04 0:00 [events/0]
root 4 0.0 0.0 0 0 ? SW< Aug04 0:00 [khelper]
...
Or, if you want to see the environment add the -e option
$ ps aeux
…
kyle 2735 0.0 0.1 4400 1492 pts/0 S Aug04 0:00 -bash USER=kyle LOGNAME=kyle HOME=/home/kyle PATH=/usr/
kyle 2771 0.0 0.0 4328 924 pts/0 S Aug04 0:00 screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S
kyle 2772 0.0 0.6 9476 6352 ? S Aug04 0:54 SCREEN -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm S
kyle 2773 0.0 0.1 4432 1548 pts/1 S Aug04 0:10 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre
kyle 2797 0.0 0.1 4416 1496 pts/2 S Aug04 0:00 /bin/bash STY=2772.pts-0.third-fl-71 TERM=screen TERMCAP=SC|scre
…
There is also a -f “forrest” option. Also note below ” -bash” is the start of a login shell.
$ ps aeuxwwf
The ww option above gives a wide format with all variables. Use the above command if you plan to parse through a Perl script. Otherwise, it may be easier to do a quick read using the command below, without “ww”.
$ ps aeuxf
…
root 2339 0.0 0.1 3512 1444 ? S Dec01 0:00 /usr/sbin/sshd
root 25651 0.0 0.1 6764 1980 ? S Dec23 0:00 \_ /usr/sbin/sshd
kyle 25653 0.0 0.2 6840 2236 ? S Dec23 0:14 \_ /usr/sbin/sshd
kyle 25654 0.0 0.1 4364 1440 pts/4 S Dec23 0:00 \_ -bash USER=kyle LOGNAME=kyle HOME=/home/kyle
kyle 25690 0.0 0.0 4328 920 pts/4 S Dec23 0:00 \_ screen -e^Pa -D -R HOSTNAME=third-fl-71.localdomain TERM=xterm
root 2355 0.0 0.0 2068 904 ? S Dec01 0:00 xinetd -stayalive -pidfile /var/run/xinetd.pid
…
It is also possible to list the process by command line. For example, the following command will only list the vi processes.
$ ps -fC vi
UID PID PPID C STIME TTY TIME CMD
kyle 5049 5020 0 May11 pts/13 00:00:00 vi -nw Notes
kyle 12368 5104 0 May12 pts/18 00:00:00 vi -nw dnotify.c
kyle 19792 18028 0 May13 pts/20 00:00:00 vi -nw hello.c
kyle 14034 27367 0 18:52 pts/8 00:00:00 vi -nw 1.txt
You may also want to consider using top in batch mode. Here the “-n 1″ means refresh once, and the “b” is for batch. The “fmt -s” is to put it in a more readable format.
$ top -n 1 b |fmt -s >>statfile
Enjoy
Posted on October 12th, 2006 by Admin.
Categories: Cpanel Hosting, Server Security, Linux.
Greetings,
TCP Wrapper is a host-based network ACL system, used to filter network access to Internet protocol services run on Unix-like Operating Systems such as Linux or BSD. It allows host or subnetwork IP addresses names and/or query replies, to be used as tokens on which to filter for access control purposes .
First “/etc/hosts.allow” is check, and if there is an entry in this file, no more checking it done. If are no matches in “/etc/hosts.allow”, the “/etc/hosts.deny” file is checked and if a match is found, that service is blocked for that host.
Example “/etc/hosts.deny” file:
sshd: 192.168.1.1
The above file blocks access to computer 192.168.1.1 . It’s also possible to run commands when someone from this computer tries to ssh in.
This example sends mail.
sshd: 192.168.1.1: spawn (echo -e “%d %h %H %u”| /bin/mail -s ‘hosts.deny entry’ root)
Of course, you can also run commands in the “/etc/hosts.allow” if you wanted mail sent for a successful login.
Cheers
Posted on October 12th, 2006 by Alex P..
Categories: Cpanel Hosting.
The command “vi” without any file name will open a new file where you can enter the text and edit but while coming out you will be asked to enter a valid file name to save the text.
“vi” with a existing file name will open that file for editing.
After a file is opened it is in command mode, that is - input from the keyboard will be treated as vi commands and you will not see the words you are typing on the screen. To enter the text you have to put vi in insert by pressing ‘i’ or ‘a’ after which you can add the text and whatever is being typed will be seen on the screen. To switch between these mode Esc key is used .
Esc i -- insert text mode Esc -- command mode
If you don’t want to save the work “:q” will take you out. For save and quit “:wq” is used. Simple “:w” saves the current file and don’t exit and “:q!” , “:wq!” causes a forced quit from vi.
Moving around the file:
h -- cursor left
i -- cursor right
k -- cursor up
j -- cursor down
^ & B -- Beginning of line
$ -- end of line
) -- Next sentence
( -- Previous sentence
} -- Next Paragraph
{ -- Previous Paragraph
:$ -- end of file
w -- one character forward
W -- one word forward
:20 -- go to Line no 20 or whatever number you give
Displaying file info:
^g -- give name of the file, current line and total lines of a file at the bottom.
Inserting and appending text :
i -- inserts text to the left of cursor I -- inserts in the beginning of line a -- appends text to right of cursor A -- appends to the end of line
Adding new line:
o -- add a new line below the current line O -- adds a new line above the current line.
Deleting the text:
x -- deletes text above the cursor X -- deletes text character on the right of cursor 20dd -- deletes 20 dd -- deletes current line D -- delete till end of current line. d# -- delete to where the # (j,k,l,h) specifies. d/ -- delete till pattern is found (forward). d? -- delete till pattern is found (backward). d' -- delete till mark 'char'.
Replacing a character & word:
r -- replace the character above the cursor. R -- replces characters until Esc is pressed. cw -- replaces the word from cursor to the end indicated by $ sign. C -- replaces till end of line.
Substitute:
s -- subistutes current charcater. S -- substitutes entire line.
Repeating last command:
. -- repeats the last text.
Undo the last change:
u -- undo last change. U -- undo changes to the current line.
Copy and pasting lines:
yy -- copies the current line into buffer. 5yy -- copies 5 lines from the current line. p -- pastes the current buffer.
Recovering an unsaved vi file:
vi -r -- restores a unsaved / crashed file from buffer.
Searching:
:/name -- & return searches for the word name in the file n -- continues search forward. N -- searches backwards.
Substitution:
:s///g
Saving:
:w -- saves the text does not quit. :wq -- saves & quit the editor. ZZ -- save & quit the editor. :q! -- Quit without saving.
Miscellaneous:
m -- mark this location and name it char. ' -- (quote character) return to "line" named char. ` -- (back-quote character) return to "place" named char. '' or `` -- (quote quote) return from last movement.
Regard's
Alex P
Posted on October 12th, 2006 by Admin.
Categories: Web Technologies.
What is a favicon?
Favicon (pronounced fav-eye-con) is short for ‘Favorites Icon.’ A Favicon is a multi-resolution image included on nearly all professional developed sites. The Favicon allows the webmaster to further promote their site, and to create a more customized appearance within a visitor’s browser. Often, the Favicon reflects the look and feel of the web site or the organization’s logo.
Where will Favicon be seen?
The Favicon was first popularized by its appearance in the Address Bar and Favorites Folder using Internet Explorer and is now a prominent fixture of web browsers such as Mozilla and Netscape. Each web browser has a unique user interface, and as a result uses the Favicon in different ways.
How to Install Favicon?
After creating Favicon.ico , upload it to your site and edit index pge by including below lines there…
Posted on October 2nd, 2006 by Alex P..
Categories: ENSIM.
Hello,
You can use following command in order to reset a user password through shell on your Ensim server:
EditVirtDomain -c siteinfo,passwd domain.com
Replace domain.com with user’ domain name, and you will be prompted to enter new password.
Posted on October 1st, 2006 by Admin.
Categories: VPS / OpenVZ.
Virtual Private Servers are the most advanced step in server virtualization technology. They are used to partition a single physical server into many (as many as several hundreds) isolated virtual private servers. Each virtual private server looks and behaves exactly like a real networked server system, complete with its own set of init scripts, users, processes, filesystems, etc.
Posted on October 1st, 2006 by Admin.
Categories: Cpanel Hosting, PHP, Web Technologies.
1. Create a FTP account.
2. In Dreamweaver, go to the “files” tab. Use the dropdown box to “manage sites”. Either create a new site, or if you are moving a current site where the copy is on your computer and you want to move it to site, choose edit.
3. In “advanced” tab, Click on “remote info” . Under Access, choose FTP. Under FTP host type in your domain name like yourdomain.com . Under Host Directory, if you want to login directly to the public_html folder, for the host directory, put /public_html and it will instead FTP login to the public_html directory. Leaving it blank for this field is what is causing FTP to login to your home directory rather than public_html.
Posted on October 1st, 2006 by Admin.
Categories: Domains.
Following is information regarding some of the domain status :
ACTIVE: The registry sets this status. The domain can be modified by the registrar. The domain can be renewed. The domain will be included in the zone if the domain has been delegated to at least one name server.
REGISTRY-LOCK: The registry sets this status. The domain can not be modified or deleted by the registrar. The registry must remove the REGISTRY-LOCK status for the registrar to modify the domain. The domain can be renewed. The domain will be included in the zone if the domain has been delegated to at least one name server.
REGISTRAR-LOCK: The sponsoring registrar sets this status. The domain can not be modified or deleted. The registrar must remove REGISTRAR-LOCK status to modify the domain. The domain can be renewed. The domain will be included in the zone.
REGISTRY-HOLD: The registry sets this status. The domain can not be modified or deleted by the registrar. The registry must remove the REGISTRY-HOLD status for the registrar to modify the domain. The domain can be renewed. The domain will not be included in the zone.
REGISTRAR-HOLD: The sponsoring registrar sets this status. The domain can not be modified or deleted. The registrar must remove REGISTRAR-HOLD status to modify the domain. The domain can be renewed. The domain will not be included in the zone.
REDEMPTIONPERIOD: The registry sets this status when a registrar requests that the domain name be deleted from the registry and the domain has been registered for more than 5 calendar days (if the delete request is received within 5 days of initial domain registration it will instead be deleted immediately). The domain will not be included in the zone. The domain can not be modified or purged; it can only be restored. Any other registrar requests to modify or otherwise update the domain will be rejected. The domain will be held in this status for a maximum of 30 calendar days.
PENDINGRESTORE: The registry sets this status after a registrar requests restoration of a domain that is in REDEMPTIONPERIOD status. The domain will be included in the zone. Registrar requests to modify or otherwise update the domain will be rejected. The domain will be held in this status while the registry waits for the registrar to provide required restoration documentation. If the registrar fails to provide documentation to the registry within 7 calendar days to confirm the restoration request, the domain will revert to REDEMPTIONPERIOD status. The domain status will be set to ACTIVE only if the registrar provides documentation to the registry within 7 calendar days to confirm the restoration request.
PENDINGDELETE: The registry sets this status after a domain has been set in REDEMPTIONPERIOD status and the domain has not been restored by the registrar. The domain will not be included in the zone. Once in this status all registrar requests to modify or otherwise update the domain will be rejected. The domain will be purged from the registry database after being in this status for 5 calendar days.