Guys,This error message usually comes when you try to access remote linux desktop using vncviewer. Please check the firewall in the linux server. It's causing this error messages. First stop the firewall and test it once again. Please allow the ports 5801,5901 and 6001 in the iptables or firewall. Then restart the firewall and try to connect to the server. It'll work.Try...
Thursday, 30 December 2010
How to install frysk on linux rhel5?
Posted on 00:38 by Unknown
Install frysk :frysk : It's debugging and monitoring tool of the system.===========yum install -y \ antlr jdom junit gcc-java gcc-c++ \ libglade-java-devel libvte-java-devel \ automake xmlto transfig eclipse-ecj dogtail \ sharutils git audit-libs-devel binutils-devel \ yelp libtool make===========Try...
Flow diagram of systemtap debugging scripting tool?
Posted on 00:19 by Unknown

===========================What is systemtap?Ans : Scripting tool to debug and monitor the whole system processes or any events. How to install it on linux machine ?Ans : yum install kernel-develyum install kernel-debuginfoyum install systemtapTool to do the job :Ans : stapSyntax to use it : -------------probe {handler} Where event is kernel.function, process.statement, timer.ms, begin, end etcand handler can be filtering/control statement and...
Tuesday, 28 December 2010
How to remotely access the linux desktop from any linux or windows machine?
Posted on 22:11 by Unknown
Guys,I referred the following steps :=======================1. On server-linux(Which will be accessed) : yum install vnc*2. On client-linux(who will access the remote desktop of the server ) : yum install vncviewer Note : You can install the tigerVNC instead of yum. Just download the package and install it on both client and server. Here is the URL :----------http://sourceforge.net/projects/tigervnc/files/----------3. On server : Enter command : vncpasswdnow setup a password to connect it via vnc4. vi /etc/sysconfig/vncserversDo the following (You...
How to install luci and ricci for managing the clustering infrastructure?
Posted on 00:04 by Unknown
Luci and ricci are two softwares to manage the clustering infrastructure of the high availability services. Luci connects to the agent ie ricci which must have installed on each clustered nodes to deliver the messages. You can install the luci on any machine(may be clustered node or without clustered node). Here are the steps that I followed :==========[root@kmaiti src]# wget ftp://ftp.pbone.net/mirror/ftp.centos.org/5.5/updates/x86_64/RPMS/luci-0.12.2-12.el5.centos.4.x86_64.rpm[root@kmaiti src]# rpm -ivh luci-0.12.2-12.el5.centos.4.x86_64.rpm...
Saturday, 25 December 2010
How to configure a High Availability Cluster (Heartbeat) On Linux?
Posted on 03:43 by Unknown
Guys,You can refer the following steps : Number of nodes : Two (node1 and node2)Clustering software : Heart BeatService to be high available : httpIP : 192.168.1.1 to be configured on node1 192.168.1.2 to be configured on node2 192.168.1.3 for Heart Beat clustering enabled services(http etc)==================1. setup the above two IP on the server and make it sure that uname -n returns node1 or node22. yum install heartbeat make sure that you installed : heartbeatheartbeat-pilsheartbeat-stonith3. configure heartbeat on two node cluster....
Wednesday, 22 December 2010
How to configure autofs with NFS4?
Posted on 02:43 by Unknown
First install NFS server on the machine.On NFS client machine do the following : 1. yum install autofs2. vi /etc/auto.masterand put like : [root@kmaiti alltestfiles]# cat /etc/auto.master |grep home/home /etc/auto.home --timeout=60[root@kmaiti alltestfiles]#3. Put following in /etc/auto.home :* -fstype=nfs,rw,nosuid,soft,fsid=0 IPof_nfs_server:/home/&4. /etc/init.d/autofs startThat's it.PS: You need to restart the system to view the mounted partitions. df -THTry...
Tuesday, 21 December 2010
How to install and configure NFSv4 server and client on linux machine?
Posted on 04:03 by Unknown
Guys,I referred the following steps :NFS server configure for NFSv4 :How NFS Works?NFS consists of at least two main parts: a server and one or more clients. The client remotely accesses the data that is stored on the server machine. In order for this to function properly a few processes have to be configured and running.The server has to be running the following daemons:Daemon Description : nfsd The NFS daemon which services requests from the NFS clients.mountd The NFS mount daemon which carries out the requests that nfsd(8) passes on to it.rpcbind...
Monday, 20 December 2010
Which desktop is used by my linux machine?
Posted on 21:31 by Unknown
Guys,Check the directory : /usr/share/xsessions. It has been defined there. You can also execute the following command to get the result.-----[root@kmaiti xsessions]# find /usr/share/xsessions -name "*.desktop" -exec basename "{}" .desktop ";"gnome[root@kmaiti xsessions]# pwd/usr/share/xsessions[root@kmaiti xsessions]#-----Try...
Thursday, 18 November 2010
Configuration files of Directadmin?
Posted on 00:31 by Unknown
Guys,You can refer the following URL.====http://help.directadmin.com/item.php?id=284====Check it out...
Saturday, 13 November 2010
How to convert from ext3 to ext2 file system?
Posted on 08:30 by Unknown
Guys,===========1. # umount /dev/hda1Now change the file system type to ext2 by typing the following command2. # tune2fs -O ^has_journal /dev/hda1Verify that there are no error:3.# e2fsck -y /dev/hda1Mount the file system to original mount point (for example /home or /mnt):4. # mount -t ext2 /dev/hda1 /homeGo to mount point and remove .journal file5. # rm -f .journal===========Try...
How to convert ext2 to ext3 file system?
Posted on 07:55 by Unknown
Guys,The ext2 or second extended filesystem is a file system for the Linux kernel, and the ext3 is a journaled file system. The ext3’s main advantage over ext2 is journaling which improves reliability and eliminates the need to check the file system after an unclean shutdown. Journaling process file system log convert file system during disk, if any problem arise it will be reconstructed it will be done by tune2fs tune to ext3 file system,While the power failure occur, Journalism File system restore pre-crash data store on the disk. It will also...
Wednesday, 10 November 2010
How to enable swap space on xen VPS?
Posted on 07:47 by Unknown
Guys,I did the following steps :==========root@onweb:/# dd if=/dev/zero of=/swap bs=1024 count=10485761048576+0 records in1048576+0 records out1073741824 bytes (1.1 GB) copied, 8.60256 s, 125 MB/sroot@onweb:/# mkswap /swapmkswap: /swap: warning: don't erase bootbits sectors on whole disk. Use -f to force.Setting up swapspace version 1, size = 1048572 KiBno label, UUID=00d2e2b5-0453-48b7-809b-4e405fadd9e8root@onweb:/# chmod 0600 /swaproot@onweb:/# vi /etc/fstab //give entry like : /swap swap swap defaults,noatime...
Tuesday, 9 November 2010
ftp: connect: Connection refused
Posted on 09:24 by Unknown
Guys,If you get this type of error message, please check the server's firewall first. I have faced this error message during connecting to the FTP server. In my case passive ports ranges were not enabled in the FTP and iptables firewall.====PassivePortRange 30000 50000====Add the above line in the ftp configuration file and enable them in the iptables like :===== iptables -A INPUT -p tcp --destination-port 30000:50000 -j ACCEPT iptables -A OUTPUT -p tcp --source-port 30000:50000 -j ACCEPT=====Then restart iptables and ftp server like :====service...
Monday, 8 November 2010
How to stop core file generation in the server from php?
Posted on 09:55 by Unknown
Guys,A core file records memory image of running process.when a php process is killed, apache creates core files under your account.These core files takes too much of space on server.There is no harm on deleting these files.You can get rid off these core files by modifying the httpd start up file.=======vi /usr/sbin/httpd and ulimit -c 0 after the first "ulimit" counting from the last.=======PS: /usr/sbin/httpd is nothing but a bash script.Try...
eth0 errors +WARNINGs: packets is + outside range
Posted on 02:30 by Unknown
Guys,I got this error messages from munin monitoring service and following was the error messages :=========eth0 errors WARNINGs: packets is 1.52 (outside range [:1]).=========So, my basic concept is either eth0 is being overloaded or isn't compatible with kernel or OS. So, I checked the settings of the eth0 and RX(receive) and TX(transmit) packet errors and I found that there is error at RX. I have pasted the results here.========root@server [/proc/net]#ethtool eth0 eth0 Link encap:Ethernet HWaddr 00:22:19:7A:7D:96 inet addr:178.250.55.14...
Sunday, 7 November 2010
How to access the webalizer from the outside of the cpanel?
Posted on 05:46 by Unknown
Guys,I don't want to post this type of article since you'll get it from the Google. But still I did. I followed following steps :Example :=====root@cp [~]# /scripts/whoowns domain.comdomainroot@cp [~]# cd ~domainroot@cp [/home/domain]# cd public_html/root@cp [/home/domain/public_html]# pwd/home/domian/public_htmlroot@cp [/home/domain/public_html]# ln -s /home/domian/tmp/webalizer statsroot@cp [/home/domain/public_html]# chown domain. statsroot@cp [/home/domain/public_html]# chmod 755 ~domain/tmp -R=====Now access http://domain.com/statsPS: Domain...
kernel panic - not syncing: Attempted to kill init!
Posted on 02:46 by Unknown
Guys,Error messages during after upgrading the kernel :----------mount: could not find filesystem 'dev/root'setuproot: moving /dev failed: No such file or directorysetuproot: eroor mounting /proc: No such file or directorysetuproot: eroor mounting /sys: No such file or directoryswitchroot: mount failed: No such file or directoryKernel panic - not syncing: Attempted to kill init!----------You need to check two important files and these are /etc/fstab and /boot/grub/grub.conf. The first file tells the system to mount the devices to the corresponding...
Saturday, 6 November 2010
How to capture the network packet?
Posted on 10:53 by Unknown
Guys,Try these...Capture the network packet :[root@vienna ~]# tcpdump -i eth0 -w traffic.eth0tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytesRead the packet :[root@vienna ~]# tcpdump -r traffic.eth0............................................................
Thursday, 4 November 2010
How to change admin password in the table of the mysql database?
Posted on 10:48 by Unknown
Guys,You can use following command to do the same :=====update agb_book_auth set password=MD5("newwpass") where username="admin";=====Where table agb_book_auth contains admin and password attributes.OR :=====update wp_users set user_pass = 'b15a2021cb835426552c5d8599d5c7ab' where user_login = 'admin';=====Then execute : flush privileges;Try...
Plesk configuration files path + linux?
Posted on 08:08 by Unknown
Guys,Here are the paths : Plesk Config & Binary fileLinux : ===========================================================# Plesk treePRODUCT_ROOT_D - /usr/local/psa==================================================# Directory of SysV-like Plesk initscriptsPRODUCT_RC_D - /etc/init.d /etc/psa/psa.conf // common config file /etc/psa/.psa.shadow // admin password file /var/log // common log file /etc/local/psa/admin/logs...
Links for linux commands?
Posted on 05:32 by Unknown
You can refer following links :==========http://www.hscripts.com/tutorials/linux-commands/who.htmlhttp://www.pixelbeat.org/cmdline.html=========NFS and NIS configuration :http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch30_:_Configuring_NISIf you get any link you can share here :)Munin(server monitoring) configuration link :http://wiki.kartbuilding.net/index.php/Munin_Statist...
How to use grep,find,sor,pg,ip,wget commands in linux
Posted on 05:26 by Unknown
Guys,grep -irl saqun.com * [i=case sensitive,allow both case. r=recursive, l=list out] // search domain in /hsphere/local/config/httpd/sites/1.check php version: php -v2.check which php: php -i // php -i |grep php.ini3./usr/local/cpanel/logs // logs of cpanel4./var/cpanel/userdata // gives the user data.5.ctrl+] // to come out from established connectionThen q enter.7.Search customer by name or by email id:-8.vps # vzctl enter (id of domain) // to go to root of particular domain.9.For...
How to delete file using inode number?
Posted on 03:16 by Unknown
Ans :You can find the file and remove it by rm -f command like :$ find . -inum 782263 -exec rm -f {} \;To view the inode number :ls -ilTry...
Wednesday, 3 November 2010
Install firewalls on linux?
Posted on 17:03 by Unknown
Security Softwares 1. APF 2. BFD 3. CSF 4. RkHunter 5. ChkRootkit 6. DDOS-Deflate 7. Secure-Nobody -===========================APFcd /usr/local/src/;wget http://www.rfxnetworks.com/downloads/apf-current.tar.gz;tar -xvzf apf-current.tar.gz;rm -rf apf-current.tar.gz;cd apf-0*;./install.shBFDcd /usr/local/src/;wget http://www.rfxnetworks.com/downloads/bfd-current.tar.gz;tar -xvzf bfd-current.tar.gz;rm -rf bfd-current.tar.gz;cd bfd-0*;./install.shCSFhttp://configserver.com/cp/csf.htmlcd /usr/local/src/;wget http://www.configserver.com/free/csf.tgz;tar...
How to secure linux server?
Posted on 17:00 by Unknown
Guys,You can refer the following URL :======http://www.mysql-apache-php.com/basic-linux-security.htm======check...
How to setup loop device?
Posted on 15:55 by Unknown
Guys,In Unix-like operating systems, a loop device, vnd (vnode disk), or lofi (loopback file interface) is a pseudo-device that makes a file accessible as a block device.losetup /dev/loop0 example.imgmount /dev/loop0 /home/you/dirThe second command mounts the device on the directory /home/you/dir. The overall effect of executing these two commands is that the content of the file is used as a file system rooted at the mount point.The mount utility is usually capable of handling the entire procedure:mount -o loop example.img /home/you/dirTry...
How to create tmp partition on linux server?
Posted on 15:50 by Unknown
PS : Making more available for you : ====If you do not have any /tmp partition you will need to follow the directions below to create and mount a partition.Create a 190Mb partitionshell: cd /dev/; dd if=/dev/zero of=tmpMnt bs=1024 count=200000Format the partitionshell: mke2fs /dev/tmpMntMake a backup of the old datashell: cp -Rp /tmp /tmp_backupMount the temp filesystemshell: mount -o loop,noexec,nosuid,rw /dev/tmpMnt /tmpSet the permissionsshell: chmod 1777 /tmpCopy the old files backshell: cp -Rp /tmp_backup/* /tmp/Once you do that go ahead and...
[a fatal error or timeout occurred while processing this directive] + cpanel
Posted on 15:32 by Unknown
Guys,Just check the cpanel log file and you'll get the clue from there. I got following messages :execute : tail -f /usr/local/cpanel/logs/error_log=====[2010-11-03 15:16:46 -0700] warn [branding::include] Encountered error in branding::include: Branding::include(index.html) failed: can't write into /home/j279259/.cpanel/nvdata.cache: Disk quota exceeded at /usr/local/cpanel/Cpanel/NVData.pm line 60 =====I have reduced the disk usage to fix the issue.Try...
How to use strace command in linux?
Posted on 14:29 by Unknown
Guys, strace is a useful diagnostic, instructional, and debugging tool. System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with programs for which the source is not readily available since they do not need to be recompiled in order to trace them.Here is the exact usage of the strace command :=========Arguments and returned value :Each line in the trace contains the system call name, followed by its arguments in parentheses and its return value. An example from stracing the command ''cat /dev/null''...
How to view binary file in linux?
Posted on 14:25 by Unknown
Guys,Ans :====hexdump /bin/ps //in hexadecimal formatod /bin/ps //in octal formatstrings /bin/ps //in human readable ====check...
What's the exact path of system call functions in linux?
Posted on 14:03 by Unknown
Ans :Where are the system call fuctions stored : /usr/src/linux/kernel/sys_call.Smany of the system calls can be found in /usr/src/linux/kernel/sys.cSome system calls, like fork, have their own source file (e.g., kernel/fork.c).Check it out...
How to add shared libraries on linux?
Posted on 12:54 by Unknown
Guys,Example : ------1. As root, edit file /etc/ld.so.conf. Add a line like /usr/local/pgsql/lib2. Then run command /sbin/ldconfig3.#In a bash shell, type export LD_LIBRARY_PATH=/usr/local/pgsql/lib4#In a csh shell, type setenv LD_LIBRARY_PATH /usr/local/pgsql/lib------That's it. try...
mysql query chache clear
Posted on 11:42 by Unknown
Guys,You can use the following command to clear the cache :======RESET QUERY CACHE;======Ref :http://dev.mysql.com/tech-resources/articles/mysql-query-cache.htmltry...
Monday, 1 November 2010
Linux + firewall + iptables configuring ?
Posted on 05:57 by Unknown
Firewall configuring :) Here is the excellent URL.http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptablescheck...
How to install xinetd on linux ?
Posted on 05:28 by Unknown
Guys,You can install it by yum like : yum install xinted*Configuring :xinetd Configuration files locationFollowing are important configuration files for xinetd:/etc/xinetd.conf - The global xinetd configuration file./etc/xinetd.d/ directory - The directory containing all service-specific files such as ftpTask: Understanding default configuration fileYou can view default configuration file with less or cat command:# less /etc/xinetd.confOR# cat /etc/xinetd.confOutput:# Simple configuration file for xinetd## Some defaults, and include /etc/xinetd.d/defaults{...
how to integrate TCP wrapper with xinetd + linux ?
Posted on 05:13 by Unknown
Guys,During installation of xinetd just use the option --with-libwrap=/path/to/libfile That't ...
How do I examine TCP wrapper config file?
Posted on 05:07 by Unknown
Guys.Use tcpdchk command toexamines your tcp wrapper configuration and reports all potential and real problems it can find.tcpdchktcpdchk -vtry...
How do I predict how the TCP wrapper would handle a specific request for service?
Posted on 05:05 by Unknown
Guys,Use tcpdmatch command. predict how tcpd would handle a sshd request from the local system:tcpdmatch sshd localhostThe same request, pretending that hostname lookup failed:tcpdmatch sshd 192.168.1.5To predict what tcpd would do when the client name does not match the client address:tcpdmatch sshd paranoidReplace sshd with in.telnetd, or ftpd and so on. You can use all daemon names specified in inetd.conf or xinetd.conf file.try...
Default Log Files of TCPwrapper ?
Posted on 05:04 by Unknown
TCP Wrappers will do all its logging via syslog according to your /etc/syslog.conf file. The following table lists the standard locations where messages from TCP Wrappers will appear:AIX - /var/adm/messagesHP-UX - /usr/spool/mqueue/syslogLinux - /var/log/messagesFreeBSD / OpenBSD / NetBSD - /var/log/messagesMac OS X - /var/log/system.logSolaris - /var/log/sys...
Configuring TCP Wrapper Config Files?
Posted on 05:00 by Unknown
Guys,Note : I made this article more available for you. /etc/hosts.allow and /etc/hosts.denyFile protections: the wrapper, all files used by the wrapper, and all directories in the path leading to those files, should be accessible but not writable for unprivileged users (mode 755 or mode 555). Do not install the wrapper set-uid.As the root user, perform the following edits on the /etc/inetd.conf configuration file:finger stream tcp nowait nobody /usr/sbin/in.fingerd in.fingerdbecomes:finger stream tcp nowait nobody /usr/sbin/tcpd in.fingerd[Note]NoteThe...
How to install tcpwrapper on linux server?
Posted on 04:58 by Unknown
Guys,Ans : yum install tcpdOr From sources : #Download (HTTP): http://files.ichilton.co.uk/nfs/tcp_wrappers_7.6.tar.gz#Download (FTP): ftp://ftp.porcupine.org/pub/security/tcp_wrappers_7.6.tar.gzDownload MD5 sum: e6fa25f71226d090f34de3f6b122fb5a#Additional DownloadsRequired Patch (Fixes some build issues and adds building a shared library): http://www.linuxfromscratch.org/patches/blfs/svn/tcp_wrappers-7.6-shared_lib_plus_plus-1.patchInstallation of TCP WrapperInstall TCP Wrapper with the following commands:patch -Np1 -i ../tcp_wrappers-7.6-shared_lib_plus_plus-1.patch...
Secure Linux Using TCP Wrappers or Protect the daemons using TCP wrappers on Linux??
Posted on 04:28 by Unknown
Guys,TCP Wrappers can be used to GRANT or DENY access to various services on your machine to the outside network or other machines on the same network. It does this by using simple Access List Rules which are included in the two files /etc/hosts.allow and /etc/hosts.deny .Let us consider this scenario: A remote machine remote_mc trying to connect to your local machine local_mc using ssh.When the request from the remote_mc is received by the tcp wrapped service (SSH in this case), it takes the following basic steps:1. It checks the /etc/hosts.allow...
Saturday, 30 October 2010
Fatal error: Out of memory (allocated +) (tried to allocate + bytes) ?
Posted on 13:35 by Unknown
Guys,Please increase the memory size in php.ini file. If it does not work just put following directives in the httpd.conf file and restart apache :====RLimitMEM 447392422RLimitCPU 240====You may have increased the RLimitMEM size since above has in bytes.OR : You can set -1 at ini_set('memory_limit', '-1'); This has in the configuration file of the script.Try...
Thursday, 28 October 2010
DATABASE ERROR: CONNECTION FAILED! + roundcube
Posted on 18:21 by Unknown
Guys,If you get this error just rectify the login details in the /usr/local/cpanel/base/roundcube/config/db.inc.php file since it's clear the DB connection error. Example :------root@2red [/usr/local/cpanel/base/roundcube]# cat config/db.inc.php | grep roundcube$rcmail_config['db_dsnw'] = 'mysql://roundcube:DB_PASSWORDlocalhost/roundcube';// postgres example: 'pgsql://roundcube:pass@localhost/roundcubemail';root@2red [/usr/local/cpanel/base/roundcube]#------PS: Name of the roundcube database : roundcube DB username : roundcube DB password...
How to install roundcube in the cpanel server?
Posted on 17:46 by Unknown
Guys,I referred the following steps :-----------cd /usr/local/cpanel/baserm -rf roundcube*mysql -p -e 'drop database roundcube';chattr -i /usr/local/cpanel/base/frontend/x/webmaillogin.htmlchattr -i /usr/local/cpanel/base/webmaillogin.cgi/scripts/upcpcd /usr/local/cpanel/basewget http://sourceforge.net/projects/roundcubemail/files/roundcubemail/0.4.2/roundcubemail-0.4.2.tar.gz/downloadtar -zxvf roundcube.tar.gzrm -rf roundcube.tar.gzmv -f roundcubemail-0.1-rc1 roundcubecd roundcubechmod -R 777 tempchmod -R 777 logs-----------mysql -e "CREATE DATABASE...
Sunday, 24 October 2010
How to migrate Plesk data manually with Plesk Migration Manager?
Posted on 22:34 by Unknown
Manually migration?[How to] How to migrate Plesk data manually with Plesk Migration Manager? Article ID: 1152 Last Review: Nov,24 2009 Author: Bezborodova Anastasiya Last updated by: Bezborodova Anastasiya APPLIES TO: Plesk 8.x for Linux/Unix Plesk 9.x for Linux/Unix ResolutionTo do this follow the steps below:1. Upload migration agent and modules to the source server. For example for Parallels Plesk Panel, there are two folders: /usr/local/psa/PMM/agents/shared and /usr/local/psa/PMM/agents/PleskX. Use the command below to copy the Migration...
How to reduce server's load?
Posted on 22:31 by Unknown
You can refer following steps to deal with to reduce server's load :=======1 )netstat -plan | grep :80 | awk '{print $5}' | cut -d: -f 1 | sort | uniq -c | sort -n2) netstat -plan | grep :25 | awk '{print $5}' | cut -d: -f 1 | sort | uniq -c | sort -n3) pstree -paul4) cd /tmp5) rm -f dos-* sess_* .spamassassin*6) find . -user nobody -exec rm -f '{}' \;7) ps -C exim -fH ewww8) ps -C exim -fH eww |grep home9) netstat -ntu | grep ':' | awk '{print $5}' | awk '{sub("::ffff:","");print}' | cut -f1 -d ':' | sort | uniq -c | sort -n10) mysqladmin proc...
How to check server's resource usage?
Posted on 22:29 by Unknown
You can use following script :======root@magneto [/var/log]# cat resusage.sh#!/bin/bashtop -b -c -n 1 >topresultwhile read linedoawk '{if( $9 >= 20 ) print $2 ":" $9 ":" $12 }' $linedone <"topresult"root@magneto [/var/log]cron : * * * * * /bin/bash /var/log/resusage.sh 1>>/var/log/server_resusagewq.log========================flush log : root@magneto [/var/log]# cat flush_server_resusage.sh#!/bin/bashrm -f /var/log/server_resusage.logtouch /var/log/server_resusage.logecho "===================`date`===================" >>/var/log/server_resusage.logroot@magneto...
How to login into the server using bash script?
Posted on 22:22 by Unknown
Here is the script :===#!/bin/bashHOST="remote-hostname"USER="remote-user"PASS="remore-user-password"CMD=$@VAR=$(expect -c "spawn ssh -o StrictHostKeyChecking=no $USER@$HOST $CMDmatch_max 100000expect \"*?assword:*\"send -- \"$PASS\r\"send -- \"\r\"expect eof")echo "==============="echo "$VAR"===Try...
How to recursively change the permission of the files?
Posted on 22:20 by Unknown
Use the following commands : ----------find . -type d -exec chmod 755 {} \;find . -type f -exec chmod 644 {} \;----------Try...
How to get system information using bash script?
Posted on 22:17 by Unknown
Here is the script that you can use :--------#!/bin/bash# grabsysinfo.sh - A simple menu driven shell script to to get information about your # Linux server / desktop.# Author: Vivek Gite# Date: 12/Sep/2007 # Define variablesLSB=/usr/bin/lsb_release # Purpose: Display pause prompt# $1-> Message (optional)function pause(){ local message="$@" [ -z $message ] && message="Press [Enter] key to continue..." read -p "$message" readEnterKey} # Purpose - Display a menu on screenfunction show_menu(){ date echo "---------------------------"...
Meaning of special characters in bash scripting?
Posted on 22:09 by Unknown
Guys, You can refer the following information for the bash scripting :===========1. Basic : Special charecter : # --> to comment; --> command separator.;; --> terminator, used after "case". like : case "$variable" in abc) echo "\$variable = abc" ;; xyz) echo "\$variable = xyz" ;;esac----------. --> used to create hidden file and denotes current directory." -->partial quoting.' --> full quoting.\ -->escape [backslash]/ -->Filename path separator [forward slash]` -->command substitution. The `command` construct...
How to create fork bomb?
Posted on 22:04 by Unknown
Here is the script to create fork bomb on linux machine.Please note that once you execute this script, the load of the server will be automatically increased and it'll be hanged.-----------#/bin/sh$0 &$0-----------Prevention : http://www.cyberciti.biz/tips/linux-limiting-user-process.html Try...
Who is using more cpu resources on the linux server?
Posted on 22:01 by Unknown
Guys, Here is the script that you can use :----This script is used to identify overloading script (http & non-http scripts)...----#!/bin/bashechoecho "Date/Time CPU% ProcessID ScriptPath"echo =======================================================================ps auxw | grep -v root | grep -v /mysql/ | awk '{printf "%d %d\n",$2,$3}' | \( while read psid cpu; do if [ $cpu -gt 2 ]; then lsof -p $psid | grep /home | grep -v sess_ | awk '{print $9}' | \ ( while read script_path; do date...
How to send mail using bash script?
Posted on 21:47 by Unknown
You can use following script to send mail(Pls change the e-mail address and its content)--------#!/bin/bash# script to send simple email# email subjectSUBJECT="SET-EMAIL-SUBJECT"# Email To ?EMAIL="admin@somewhere.com"# Email text/messageEMAILMESSAGE="/tmp/emailmessage.txt"echo "This is an email message test"> $EMAILMESSAGEecho "This is email text" >>$EMAILMESSAGE# send an email using /bin/mail/bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE-------try...
Addition, multiplication etc in bash script?
Posted on 21:38 by Unknown
======== #!/bin/bashx=5 # initialize x to 5y=3 # initialize y to 3add=$(($x + $y)) # add the values of x and y and assign it to variable addsub=$(($x - $y)) # subtract the values of x and y and assign it to variable submul=$(($x * $y)) # multiply the values of x and y and assign it to variable muldiv=$(($x / $y)) # divide the values of x and y and assign it to variable divmod=$(($x % $y)) # get the remainder of x / y and assign it to variable mod========try...
How to fetch line by line from the file using bash script?
Posted on 21:36 by Unknown
Guys,I used following scripts :----#!/bin/bashwhile read linedoecho-e "$ line \ n"done file.txt ----where file name is "file.txt".Try...
Convert mp4 file to flv ?
Posted on 21:34 by Unknown
use following linux command :--------/usr/local/bin/mencoder "video.mp4" -o "video.flv" -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -srate 22050 -ofps 24 -vf harddup--------Input file name :video.mp4Output file name : video.flvtry...
How to convert mpg file to flv file using ffmpeg or mencoder?
Posted on 21:31 by Unknown
Here are the steps those I once used :=====I converted the video using ffmpeg command line as below.----------ffmpeg -i lions.mpg lions-ffmpeg.flv----------PS: input file name : lions.mpgThe video was converted fine.Then I converted the video using mencoder using the command mentioned below.-------------mencoder lions.mpg -o lions-mencoder.flv -of lavf -oac mp3lame -lameopts abr:br=56 -ovc lavc -lavcopts vcodec=flv:vbitrate=800:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -vf scale=450:400 -srate 22050--------------Then I generated a thumbnail using ffmpeg...
How to Install PAE kernel?
Posted on 21:27 by Unknown
To install PAE kernel, use yum command:1.--------yum install kernel-PAE---------Just reboot the server and make sure you boot with PAE kernel i.e. 2.6.18-8.1.15.el5PAE:2.---------reboot---------First, update to the latest current kernel, then install the correct -devel package --3.---------yum update kernelyum install kernel-devel---------Finally, reboot and ensure that you are now running kernel-2.6.18-164.11.1.el5 by "uname -a" command.===========kernel-PAE-debuginfo rpm build for : RedHat EL 5. For other distributions click here.Name : kernel-PAE-debuginfo...
Friday, 1 October 2010
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable
Posted on 00:49 by Unknown
Guys, The steps didn't work on our server but it worked for some other guys.=======From one xterm run "su oracle-user" then run "export DISPLAY=localhost:0.0"From another xterm run: "xhost +" and then from the first xterm run the installer.$ xhost + # this allows any host to connect to the local X11 session=======Try...
How to install oracle database 10g on linux server?
Posted on 00:20 by Unknown
Guys, I referred following steps to do the same :Oracle 10G Installations on linux 64 or 32 arch) :-==========1. Minimum Requirement 40 GB Hard disk and 512 RAM.2. Check following latest packages has been installed on 32 bit linux machine :-Note : Please note that try search in google like "download name + rpm". As an example : download Imlib _ + rpm. Then download latest rpm and use "rpm -Uvh package name " to install them. Always try download from pbone.com .....................Binutils-2.15.92.0.2-10.EL4Compat-db-4.1.25-9Control-center-2.8.0-12Gcc-3.4.3-9.EL4Gcc-c++-3.4.3-9.EL4Glibc-2.3.4-2Glibc-common-2.3.4-2Gnome-libs-1.4.1.2.90-44.1Libstdc++-3.4.3-9.EL4Libstdc++-devel-3.4.3-9.EL4Make-3.80-5Pdksh-5.2.14-30Sysstat-5.0.5-1Xscreensaver-4.18-5.rhel4.2libaio-0.3.9.......................3....
Subscribe to:
Posts (Atom)