Pages

Tuesday, May 26, 2015

IP port forwarding from source machine to destination on port 88. Please give the below rules


iptables -t nat -A PREROUTING -p tcp --dport 88 -j DNAT --to-destination 172.26.14.174:88
iptables -t nat -A POSTROUTING -p tcp -d 172.26.14.174 --dport 88 -j SNAT --to-source 172.26.14.215
iptables -t nat -A PREROUTING -p udp --dport 88 -j DNAT --to-destination 172.26.14.174:88
iptables -t nat -A POSTROUTING -p udp -d 172.26.14.174 --dport 88 -j SNAT --to-source 172.26.14.215
iptables -t nat -L -n
service iptables save
service iptables restart



Monday, November 10, 2014

Install VNC viewer on Centos 5.X machines

yum groupinstall "GNOME Desktop Environment"

yum install vnc*

Add this line at the end of /etc/sysconfig/vncservers

VNCSERVERS="5:root" VNCSERVERARGS[2]="-geometry 800x600 "


Login as user and set vnc password :

vncpasswd command :


---------------------------------------------------------


create file xstartup under .vnc of home directory and give 777 permission

Add the below lines in xstartup file

#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
#vncconfig -iconic &
#xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
        eval `dbus-launch --sh-syntax –exit-with-session`
        echo "D-BUS per-session daemon address is: \
        $DBUS_SESSION_BUS_ADDRESS"
fi
exec gnome-session

Monday, June 30, 2014

how to delete a speacial character from last line

Please use the below command to delete special character from the last line of grep output

rev | cut -c 2- | rev

Thursday, June 5, 2014

Adding SWAP space

First method : on hard disk

create a new filesystem

# mkswap /dev/sdc1
swapon /dev/sdc1
# vim /etc/fstab
/dev/sdc1               swap                    swap    defaults        0 0
# swapon -s
Filename                        Type            Size    Used    Priority
/dev/sda2                       partition       4192956 0       -1
/dev/sdc1                       partition       1048568 0       -2

# free -k
             total       used       free     shared    buffers     cached
Mem:       3082356    3022364      59992          0      52056    2646472
-/+ buffers/cache:     323836    2758520
Swap:      5241524          0    5241524
The SWAP sizer formula : if RAM is < 8 GB , SWAP should be equal to 8GB
If RAM is > 8 GB, the SWAP is half of the RAM size

How to check which process is using more memory in linux server

1. ps -eo pmem,pcpu,vsize,pid,cmd | sort -k 1 -nr | head -5

2. use top command

then SHIFT + f button in the keyboard

Press the Letter corresponding to %MEM

Then press ENTER

3. ps aux | awk '{print $2, $4, $11}' | sort -k2rn | head -n 10

4. ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS


Monday, May 5, 2014

How to update heap size in tomcat 7

Step 1: Open up the catalina.sh file with any text editor.

Step 2: Search for "JAVA_OPTS=" in the file and in particular locate the following lines of code:


if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
else 
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER"
fi


Step 3: At the end of the JAVA_OPTS definitions add "-Xms256m -Xmx512m".


if [ -z "$LOGGING_MANAGER" ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Xms256m -Xmx512m"
else 
JAVA_OPTS="$JAVA_OPTS $LOGGING_MANAGER -Xms256m -Xmx512m"
fi


Step 4: Save the file and restart Tomcat.

Friday, April 25, 2014

Skype APK : custom notification sound

Hi,

I noticed that the latest skype on android devices lacks some features. As set custom notification sound for incoming IM's. You can use the given link to download the modified skype apk in which we can set custom notification tones.

http://www7.zippyshare.com/d/57399210/155042/Skype_4.7.0.43514_v22.apk



Bash script to save user history

Hi

Please find the below script which can save each users history to a common place for security purpose. So that later admin can review the commands performed by each user on the machine. (like who has stopped some service, who reboot the machine etc)

#!/bin/bash
echo "date > date.txt" >> .bash_profile
touch .logout.sh
read -r -d '' FILECONTENT <<'ENDFILECONTENT'
#!/bin/bash
user=`whoami`
var=`cat date.txt`
echo "The user $user logged to this machine at $var"
echo "The user $user executed the below commands"
history
echo "The session completed at `date`"
history -c
history -w
ENDFILECONTENT
echo "$FILECONTENT" > .logout.sh
chmod 700 .logout.sh
echo "source .logout.sh >> /tmp/historylog" >> .bash_logout


save this content as some file.sh like history.sh
give 700 permission
chmod 700 history.sh
./history.sh

Note : it will clear the session's history each time.


Wednesday, January 8, 2014

PHP recompile to get JPEG support

How to enable JPEG support in PHP

1. Run the below command to test whether JPEG support is there or not

#php -r 'print_r(gd_info());'

Output :

Array
(
    [GD Version] => bundled (2.1.0 compatible)
    [FreeType Support] =>
    [T1Lib Support] =>
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] =>
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] =>
    [XBM Support] => 1
    [JIS-mapped Japanese Font Support] =>
)

2. rpm -qa | grep -e libjpeg

if you get output like below

libjpeg-turbo-1.2.1-3.el6_5

then go forward, otherwise install the library

3. check where the library is

find / -name libjpeg*

it may be inside /usr/lib64. Make symbollic link to /usr/lib

ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64/libjpeg.so.62.0.0 /usr/lib/libjpeg.so.62.0.0
ln -s /usr/lib64/libjpeg.so.62 /usr/lib/libjpeg.so.62

4. then recompile PHP

goto the php downloaded folder and do "make clean"

then

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-zlib --enable-mbstring  --with-gd  --with-pdo-mysql --with-jpeg --with-jpeg-dir=/usr/lib

make

make install

5. Verify JPEG support as below


#php -r 'print_r(gd_info());'

Array
(
    [GD Version] => bundled (2.1.0 compatible)
    [FreeType Support] =>
    [T1Lib Support] =>
    [GIF Read Support] => 1
    [GIF Create Support] => 1
    [JPEG Support] => 1
    [PNG Support] => 1
    [WBMP Support] => 1
    [XPM Support] =>
    [XBM Support] => 1
    [JIS-mapped Japanese Font Support] =>
)



Wednesday, September 18, 2013

Manage Eucalyptus private cloud with eucalobo

You can manage your Eucalyptus cloud instances with eucalobo tool easily. Download from here

https://s3.amazonaws.com/eucalobo/EucaLobo-win-4.2.1.zip

Saturday, May 7, 2011

How to clone Virtualbox disk images (VDI)

Please follow the steps below



  1. Open VirtualBox
  2. Click on the Virtual Machine you want to clone
  3. Now click File>Virtual Media Manager 
  4. When the Virtual Machine Manager appears, click on the .vdi file that you want to clone and then click Release – this will release the .vdi from the VM. THIS IS IMPORTANT. If you miss this step you will encounter UUID conflicts. 
  5. Fire up command prompt (Start>Run>cmd [enter])
  6. Enter the following command:
< File path of VBoxManage> clonehd “” “

For me this command was:






kernel panic not syncing virtualbox !!!!!!!!!!!!

When i was tried to start up a new virtual Linux machine with downloaded VDI from virtualbox's site,
I got the same error "kernel panic not syncing virtualbox "


Solution is very Simple.....

Go to the Oracle VM VirtualBox Manager, right-click your CentOs Machine and click on "Settings".
Go to Storage -> Right-click the vdi in SATA Controller and click on "Remove attachment.
Go to the IDE Controller and click on Add Hard Disk
Retrieve your vdi file from your hard drive and boot your CentOS machine








Thursday, December 23, 2010

What Happened to SKYPE on 22nd December 2010 ?


Skype service has been spotty at best most of the day. If you’ve come to rely on Skype for work your day has seriously been disrupted. Skype’s explanation of the outage was interesting given the company’s network is unique.
Here’s the explanation:
Skype isn’t a network like a conventional phone or IM network – instead, it relies on millions of individual connections between computers and phones to keep things up and running. Some of these computers are what we call ‘supernodes’ – they act a bit like phone directories for Skype. If you want to talk to someone, and your Skype app can’t find them immediately (for example, because they’re connecting from a different location or from a different device) your computer or phone will first try to find a supernode to figure out how to reach them.
Under normal circumstances, there are a large number of supernodes available. Unfortunately, today, many of them were taken offline by a problem affecting some versions of Skype. As Skype relies on being able to maintain contact with supernodes, it may appear offline for some of you

Saturday, November 6, 2010

Edit grub in ubuntu 10.10





Ubuntu 10.10 using grub2


we cant find the /boot/grub/menu.lst file as in previous versions,
so what we need to do is 


INSTALL SOME SPLASH IMAGES, WHICH ARE IN "tga" FORMAT, not in "xpm.gz"
sudo apt-get install grub2-splashimages
ls /usr/share/images/grub/
EDIT THE FOLLOWING FILE
sudo gedit /etc/grub.d/05_debian_theme
find the specified line in the file 
WALLPAPER=”/usr/share/images/desktop-base/moreblue-orbit-grub.png”
and replace the image name to the image u need to change.
WALLPAPER=”/usr/share/images/grub/Windbuchencom.tga”
COLOR_NORMAL=”black/black” 
COLOR_HIGHLIGHT=”magenta/black”
Finally , Upgrade the grub, 
sudo update-grub

Sunday, August 1, 2010

Diffrences b/w Opensource and free software (FSF)

follow the below link,you can get a clear cut idea about , what is OSS & FSF
what are the merits and demerits etc..

http://www.gnu.org/philosophy/open-source-misses-the-point.html


some differences

  1. The philosophy of open source considers issues in terms of how to make software “better" 
  2. The term “open source” quickly became associated with ideas and arguments based only on practical values, such as making or having powerful, reliable software. Most of the supporters of open source have come to it since then, and they make the same association.
  3. Nearly all open source software is free software. The two terms describe almost the same category of software, but they stand for views based on fundamentally different values
  4. Open source is a development methodology; free software is a social movement
  5. We in the free software movement don't think of the open source camp as an enemy; the enemy is proprietary (nonfree) software. But we want people to know we stand for freedom, so we do not accept being mislabeled as open source supporters.
  6. The obvious meaning for the expression “open source software”—and the one most people seem to think it means—is “You can look at the source code.” That criterion is much weaker than the free software definition, much weaker also than the official definition of open source. It includes many programs that are neither free nor open source.
  7. Another misunderstanding of “open source” is the idea that it means “not using the GNU GPL.” This tends to accompany another misunderstanding that “free software” means “GPL-covered software.” These are both mistaken, since the GNU GPL qualifies as an open source license and most of the open source licenses qualify as free software licenses.
  8. The idea of open source is that allowing users to change and redistribute the software will make it more powerful and reliable. But this is not guaranteed. Developers of proprietary software are not necessarily incompetent. Sometimes they produce a program that is powerful and reliable, even though it does not respect the users' freedom. Free software activists and open source enthusiasts will react very differently to that.

A pure open source enthusiast, one that is not at all influenced by the ideals of free software, will say, “I am surprised you were able to make the program work so well without using our development model, but you did. How can I get a copy?” This attitude will reward schemes that take away our freedom, leading to its loss.


The free software activist will say, “Your program is very attractive, but I value my freedom more. So I reject your program. Instead I will support a project to develop a free replacement.” If we value our freedom, we can act to maintain and defend it


Thursday, July 29, 2010

how to touch a file with current DATE as filename

hai try to use these commands to touch a file , with current date as filename

touch $(date)

but this may giv you a bad result, it may creates more files

so use this command

touch $(date +"%C%y%b%d")

C indicates Century 20 , ' y '  means year ,  'b' means month , 'd' is date

 

Linux File Structure

In the Linux file structure files are grouped according to purpose. Ex: commands, data files, documentation. Parts of a Unix directory tree are listed below. All directories are grouped under the root entry "/". That part of the directory tree is left out of the below diagram. See the FSSTND standard (Filesystem standard).
  • root - The home directory for the root user
  • home - Contains the user's home directories along with directories for services
    • ftp
    • HTTP
    • samba
    • george
  • bin - Commands needed during bootup that might be needed by normal users
  • sbin - Like bin but commands are not intended for normal users. Commands run by LINUX.
  • proc - This filesystem is not on a disk. It is a virtual filesystem that exists in the kernels imagination which is memory.
    • 1 - A directory with info about process number 1. Each process has a directory below proc.
  • usr - Contains all commands, libraries, man pages, games and static files for normal operation.
    • bin - Almost all user commands. some commands are in /bin or /usr/local/bin.
    • sbin - System admin commands not needed on the root filesystem. e.g., most server programs.
    • include - Header files for the C programming language. Should be below /user/lib for consistency.
    • lib - Unchanging data files for programs and subsystems
    • local - The place for locally installed software and other files.
    • man - Manual pages
    • info - Info documents
    • doc - Documentation
    • tmp
    • X11R6 - The X windows system files. There is a directory similar to usr below this directory.
    • X386 - Like X11R6 but for X11 release 5
  • boot - Files used by the bootstrap loader, LILO. Kernel images are often kept here.
  • lib - Shared libraries needed by the programs on the root filesystem
    • modules - Loadable kernel modules, especially those needed to boot the system after disasters.
  • dev - Device files
  • etc - Configuration files specific to the machine.
    • skel - When a home directory is created it is initialized with files from this directory
    • sysconfig - Files that configure the linux system for devices.
  • var - Contains files that change for mail, news, printers log files, man pages, temp files
    • file
    • lib - Files that change while the system is running normally
    • local - Variable data for programs installed in /usr/local.
    • lock - Lock files. Used by a program to indicate it is using a particular device or file
    • log - Log files from programs such as login and syslog which logs all logins and logouts.
    • run - Files that contain information about the system that is valid until the system is next booted
    • spool - Directories for mail, printer spools, news and other spooled work.
    • tmp - Temporary files that are large or need to exist for longer than they should in /tmp.
    • catman - A cache for man pages that are formatted on demand
  • mnt - Mount points for temporary mounts by the system administrator.
  • tmp - Temporary files. Programs running after bootup should use /var/tmp.

Wednesday, July 28, 2010

Linux System Management



Runtime level management

exit
Terminates the shell.
halt
Stop the system.
init
Process control initialization.
initscript
Script that executes inittab commands.
logout
Log the user off the system.
poweroff
Brings the system down.
reboot
Reboot the system.
runlevel
List the current and previous runlevel.
setsid
Run a program in a new session.
shutdown
If your system has many users, use the command "shutdown -h +time message", where time is the time in minutes until the system is halted, and message is a short explanation of why the system is shutting down.
# shutdown -h +10 'We will install a new disk. System should be back on-line in three hours.'
telinit
By requesting run level 1 a system can be taken to single user mode.

System Configuration tools

ctrlaltdel
Set the function of the ctrl alt del combination.
isapnp
Configure ISA plug and play devices.
kbdconf
A Redhat Linux tool which configures the /etc/sysconfig/keyboard file which specifies the location of the keyboard map file. This is a GUI based tool.
kbdrate
Set the keyboard repeat rate and delay time.
kernelcfg
A Redhat GUI kernel configuration tool, Start X, then run it from a console session.
linuxconf
Redhat's GUI linux system configuration tool.
lspci
List all pci devices.
mesg
Control write access to your terminal.
mouseconfig
A Redhat Linux tool used to configure the /etc/sysconfig.mouse file. This is a GUI tool.
ndc
Script file used to restart, stop, start the DNS server.
Printtool
Redhat's GUI printer configuration tool.
quota
Display disk usage and limits.
quotacheck
Scan a filesystem for disk usages.
quotaoff
Turn file system quotas off.
quotaon
Turn file system quotas on.
samba
Script file used to stop, start, restart samba services when not run using inetd.
setpci
Configure pci devices.
setserial
Set/get serial port information.
setterm
Set terminal attributes.
setup
Set up devices and file systems.
stty
Used to configure and print the console devices.
swapon
Enable devices and files for paging and swapping.
swapoff
Disable devices and files for paging and swapping.
timeconfig
A Redhat Linux tool used to configure the /etc/sysconfig/clock file. This is a GUI tool used to set timezone and whether or not the clock is set to GMT time.
tset
Used to initialize terminals.

System Information

arch
Print machine architecture.
df
Shows disk free space.
du
Shows disk usage.
free
Display used and free memory on the system.
ipcrm
Provide information on ipc facilities.
ipcs
Same as ipcrm.
lsdev
Display information about installed hardware via files in the /proc directory.
lsof
List open files.
lspci
List PCI devices .
pnpdump
Lists ISA plug and play devices resource information.
procinfo
Display system status gathered from proc.
pstree
Display a tree of processes.
runlevel
Find the current and previous system runlevel.
strace
Trace ssytem calls and signals for a binary program.
stty
Change and print terminal line settings.
tload
Prints a graphic representation of the system load average.
tty
Print the filename of the terminal connected to standard input.
uname
Print system information, Prints Linux.
vmstat
Report virtual memory statistics.
xcpustate
Displays CPU states (idle, nice, system, kernel) statistics. Runs in X?

System Logging

klogd
Kernel log daemon which intercepts and logs Linux kernel messages.
logger
Make entries in the system log.
syslogd
Linux system logging utilities.
sysklogd
Linux system logging utilities.

System time

cal
Calendar.
clock
Used to change or get current time. The command "clock -–w" sets the hardware clock.
date
Print or set the system date and time.
hwclock
Set or read the hardware CMOS clock.
timed
Time server daemon to synchronize the host's time with other machines, normally invoked at boot time from the rc(8) file.
timedc
Timed control program.
tzset
Used to change the users private time zone by setting the TZ environment variable.
uptime
Reports how long the system has been running.
zdump
Prints the current time in each zonename named on the command line.
zic
Reads text from files named on the command line and creates time conversion files.

X Management and programs

SuperProbe
Probe video hardware.
Xconfigurator
The Redhat tool used during system setup to configure X.
xconsole
Displays messages usually sent to /dev/console.
xf86config
Older version of XF86Setup.
XF86Setup
A newer X configuration program with a GUI interface which modifies the "/etc/X11/XF86Config" configuration file.
xvidtune
This program will test video modes on the fly without modification to your X configuration. Read the usr/X11R6/lib/X11/doc/VideoModes.doc file before running this program.

Tuesday, July 27, 2010

Basics of Cloud computing

Introduction:-   

Definition of cloud computing is that, an internet based computing model whereby shared resources,software's,information's etc are provided to computers or any other devices on demand


Another definition :- A cloud is a pool of virtualized computer resources, A cloud can
  •  Host a variety of different workloads, including batch-style back-end jobs and interactive,  user-facing applications
  • Allow workloads to be deployed and scaled-out quickly through the rapid provisioning of  virtual machines or physical machines
  • Support redundant, self-recovering, highly scalable programming models that allow  workloads to recover from many unavoidable hardware/software failures
  • Monitor resource use in real time to enable rebalancing of allocations when needed




Starts :- It can be the ability to rent a server or a thousand servers and run a geophysical modeling application on the most powerful systems available anywhere. It can be the ability to rent a virtual server,load software on it, turn it on and off at will, or clone it ten times to meet a sudden workload demand. It can be storing and securing immense amounts of data that is accessible only by authorized applications and users. It can be supported by a cloud provider that sets up a platform that includes the OS, Apache, a MySQL™ database,Perl, Python, and PHP with the ability to scale automatically in response to changing workloads. Cloud computing can be the ability to use applications on the Internet that store and protect data while providing a service (on-demand services) — anything including email,sales force automation and tax preparation. It can be using a storage cloud to hold application, business, and personal data. And it can be the ability to use a handful of Web services to integrate photos, maps, and GPS information to create a mashup in customer Web browsers.

Wednesday, December 16, 2009

I cant install virtualbox on my fedora..?


When you update your kernel you have to recompile VirtualBox’s kernel module to make it work again.
Let’s see how to recompile VirtualBox’s kernel module…

Requisites

First of all, you have to make sure you have installed the compilation tools (gcc and other stuff). If you haven’t (or you aren’t sure) just install the build-essential package:
yum install build-essential
You will also need your current kernel headers. In order to know what kernel you’re running type this:
uname -r
In my case, my PC is running kernel 2.6.29-4-686. Now install let’s the headers
yum install linux-headers-2.6.29-4-686
If you want it more generic, you can combine commands:
yum install linux-headers-$(uname -r)

This way will work no matter what kernel version you are running

Recompiling VirtualBox’s kernel module

 

Now it’s time to recompile the module. Just type this:
/etc/init.d/vboxdrv setup