July 2014
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Categories

July 2014
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

BASH – Default variables for a bash shell

$? => Return code of previous command $0 => Name of the script itself $1-9 => Argument number 1 to 9 given to script ${10} => Argument number 10 given to script $# => Total number of arguments given to script $@ => All arguments given to script but as an individual string values “$*” […]

Linux cluster commands

Linux cluster commands

Checking status of the cluster: # clustat # clustat -m Display status of and exit # clustat -s Display status of and exit # clustat -l Use long format for services

# cman_tool status Show local record of cluster status # cman_tool nodes Show local record of cluster nodes # cman_tool nodes […]

Why we give swap partition in double the size of the RAM?

Why we give swap partition in double the size of the RAM?

It has a meaning and for that we should know memory hierarchy. We have different levels of memory which is useful for processing your data. They are as follows. Processor/CPU registers(Bits in size) L1 Cache(kbs in size) L2 Cache(MBs in size) L3 cache(100s […]

DD command

* Example use of dd command to create an ISO disk image from a CD-ROM: dd if=/dev/cdrom of=/home/sam/myCD.iso bs=2048 conv=sync

*Using dd to wipe an entire disk with random data: dd if=/dev/urandom of=/dev/hda

*Using dd to clone a hard disk to another hard disk: dd if=/dev/ad0 of=/dev/ad1 bs=1M conv=noerror

*Duplicate a disk partition as a […]

LINUX COMPLETE GUIDE WITH SHELL TIPS

SYSTEM

Hardware | Statistics | Users | Limits | Runlevels | root password | Compile kernel | Repair grub | Misc

Running kernel and system information # uname -a # Get the kernel version (and BSD version) # lsb_release -a # Full release info of any LSB distribution # cat /etc/SuSE-release # Get SuSE version […]

Windows 2012 Command

taskmgr regedit timedate.cpl intl.cpl sconfig.cmd

get-process

diskpart

Install DHCP SERVER Using PowerShell

PS C:\Users\Administrator> get-command -Module servermanager

CommandType Name ModuleName ———– —- ———- Alias Add-WindowsFeature ServerManager Alias Remove-WindowsFeature ServerManager Function Disable-ServerManagerStandardUserRemoting ServerManager Function Enable-ServerManagerStandardUserRemoting ServerManager Cmdlet Get-WindowsFeature ServerManager Cmdlet Install-WindowsFeature ServerManager Cmdlet Uninstall-WindowsFeature ServerManager

PS C:\Users\Administrator> Add-WindowsFeature -IncludeAllSubFeature -Name DHCP, RSAT-DHCP

Success Restart Needed […]

if condition to check file or directory exists

-e: Returns true value, if file exists

-f: Return true value, if file exists and regular file

-r: Return true value, if file exists and is readable

-w: Return true value, if file exists and is writable

-x: Return true value, if file exists and is executable

-d: Return true value, if exists and is […]

check process is running or not shell

!/bin/bash CHECK=$0 SERVICE=$1 DATE=`date` OUTPUT=$(ps aux | grep -v grep | grep -v $CHECK |grep $1) echo $OUTPUT if [ “${#OUTPUT}” -gt 0 ] ; then echo “$DATE: $SERVICE service running, everything is fine” else echo “$DATE: $SERVICE is not running” fi

#!/bin/bash ps axho comm| grep $1 > /dev/null result=$? echo “exit code: ${result}” […]

Fedora 20 INSTALL

[root@fedora ~]# systemctl | grep firewall firewalld.service loaded active running firewal d – dynamic firewall daemon [root@fedora ~]#

[root@fedora ~]# systemctl stop firewalld.service [root@fedora ~]# systemctl start firewalld.service [root@fedora ~]# [root@fedora ~]# systemctl disable firewalld.service rm ‘/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service’ rm ‘/etc/systemd/system/basic.target.wants/firewalld.service’ [root@fedora ~]# [root@fedora ~]# sed -i ‘s/^SELINUX=.*/SELINUX=disabled/g’ /etc/sysconfig/selinux && cat /etc/sysconfig/selinux

# This file […]

Redhat init Script for apache

#!/bin/sh # # Startup script for the Apache Web Server # # chkconfig: – 85 15 # description: Apache is a World Wide Web server. It is used to serve \ # HTML files and CGI. # processname: httpd # pidfile: /var/run/httpd.pid # config: /etc/httpd/conf/access.conf # config: /etc/httpd/conf/httpd.conf # config: /etc/httpd/conf/srm.conf ulimit -HSn 32768 # […]