Skip to main content

Posts

Showing posts from 2012

Configuration of Nginix Virtual Host

Right, they don't call it virtual box here. They call it server block. Anyway, below file runs two websites as virtual host:

Website name:  n123test.com and multi32.com

#
# A virtual host using mix of IP-, name-, and port-based configuration
#

server {
    listen       80;
#    listen       *:80;
    server_name  n123test.com;

    location / {
        root  /var/www/ntest/public_html;
        index  index.html index.htm;
    }
}



server {
    listen       80;
#    listen       *:80;
    server_name  multi32.com;

    location / {
        root  /var/www/multi32/;
        index  index.html index.htm;
     }
 }

Example File of Fsniper Config File

watch {

    # watch the ~/drop directory for new files
    ~/one {
        # matches any mimetype beginning with image/
        image/* {
            # %% is replaced with the filename of the new file
            handler = echo found an image: %%
        }

        # matches any file ending with .extensio

        *.txt {
            # the filename is added to the end of the handler line if %% is not present
handler = /bin/sh %% ; cp ~/one/*.txt ~/two
            # the second handler will be run if the first exits with a return code of 1
            handler = echo glob handler 2: %%
        }

        # run handlers on files that match this regex
        /.*regex.*/ {
            handler = echo regex handler
        }

        # generic handler to catch files that nothing else did
        * {
            handler = mv %% ~/downloads/
        }
    }

}





##############################################################################

What does it do?

The text in blue actually does the trick.

Installing & Configuring Fsniper ( Advanced Topics)

Did some one said that what is fsniper? Great, it is a software that can detect any change in your directory. Installing fsniper is easy, configuration is not. So I am providing you what to do step by step.

1. Installation:

Download fsniper.

Now you have to compile it.

Make sure gcc and make is installed ( yum install gcc and yum install make)

Now ./configure
make
make install

2. Configuration:

in /etc/init.d
put fsniper file

for fsniper file see http://pc2solution.blogspot.in/2012/11/fsniper-file-to-be-put-in-etcinitd.html

3.

in ~/.config/fsniper/
put config ( config is actually rename file of example.conf)

4.


Kill fsniper process if running,

then run #fsniper --daemon

service fsniper restart.

If you service is started, and you see OK then you are done.

Fsniper file to be put in /etc/init.d

export HOME=/root

case "$1" in
start)
echo -n "Starting Fsniper: "
/usr/local/bin/fsniper --daemon
echo -e "... [ \e[00;32mOK\e[00m ]"
;;
stop)
echo -n "Shutdown Fsniper: "
kill -9 `ps aux | grep "fsniper --daemon" | grep -v grep | awk {'print $2'}`
echo -e "... [ \e[00;32mOK\e[00m ]"
;;
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart"
exit 1
esac

exit 0





#################  for full configuration see http://pc2solution.blogspot.in/2012/11/installing-configuring-fsniper-advanced.html

Unix based OS

Name four Unix based OS. And if you have started thinking about Red Hat, fedora, ubuntu than... you are wrong.
Strangly. contarary to popular belief, Linux is not unix based. Any OS based on linux may be Unix like, but not Unix based.

I bet, with no money on hold, that many few could name 4 Unix based OS. Here they are:

Solaris (sun, now oracle)
Mac OS (apple)
AIX (IBM)
UX (HP)

And you have won the battle.

How To install softwares in linux easily?

So you have taken the challenge and installed linux. But, dude, how will you install required softwares? Apache web server. mysql, php & its modules. It will start a headache.

This tutorial helps you to install nearly all software, easily. ( See the word easily appeared easily.)

This tutorial assumes  that internet is working.

Step 1: Check Internet

ping www.google.com    ( Everyone use google.com for internet checking for some strange reason)

Step 2: Enable EPEL repository

run this command:

for redhat/centos 5

# rpm -Uvh http://download.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm

for redhat/centos 6

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-7.noarch.rpm

(these commands are taken from this link:  http://fedoraproject.org/wiki/EPEL/FAQ#Using_EPEL)

So now what? Everything is already done.

Install Apache: # yum install httpd

Install mysql:  # yum install mysql

Install PHP:   # yum install php

(If you want all packages of php includ…

Why all IP at my office starts with 192.168.x.x?

This is often surprising. Why always that familiar devil 192.168.blah.blah. Search it in any book or even on web and you will not get any good answers. Here the answer in simple non technical words.

A office or small network always has small number of PC. Thus they use a CLASS C IP. For every class, a set of private IP is defined. For class C, it starts with 192.168.x.x. You will never find any Public Ip, that is to say, IP of a website that starts with 192.168.

What? Your office IP starts with 10.x.x.x. It means your office use Class A IP. It also means that your Office network is very large.

How to check IP of your PC. Dude! Use ipconfig (Windows) on command prompt. Ifconfig (linux) on terminal.

To check Public IP of a website ping it. e.g. ping www.whoisnotafool,com.

History of Google

So when was gmail born? Okay I know you knew all of it, just conforming. And Google search engine? Okay don't close this page. Was Google founded in early 90's. No, it was taken a shape in 1998. Many of us will remember 1998 clearly in memories, which looks very new.

However, here I present some very authentic history of Google from the giants websites itself.

http://www.google.com/intl/en/about/company/history.html

History Of Windows

Ever wonder when windows was first launched? Ever felt dragged into an argument when some one claimed that first version of windows was launched during second world war? You certainly knew that he is wrong, yet you cannot correct him, because you yourself are unfamiliar with windows history!

Lastly ever thought that any given information about windows is correct or not? Here I present an elaborate and most reliable source of Windows History. 100% reliable, it is obviously from Microsoft's Official Website.


History of Windows:

http://windows.microsoft.com/en-US/windows/history

and here is a brief history of interfaces used in various versions of Windows.

http://blogs.msdn.com/b/b8/archive/2012/05/18/creating-the-windows-8-user-experience.aspx


How to Create a Short, Easy to remember, and very strong Password.