Search Engine

Wednesday, January 26, 2011

Wget for Fun

Wget is nice little piece of software that everyone should know. With it you can check site, download from FTP an entire collection of files or a photo gallery. Just open your terminal and these steps

GNU Wget is a free software package for retrieving files using HTTP, HTTPS and FTP, the most widely-used Internet protocols. It is a non-interactive commandline tool, so it may easily be called from scripts, cron jobs, terminals without X-Windows support, etc.

GNU Wget has many features to make retrieving large files or mirroring entire Web or FTP sites easy, here are some interesting options.



All these commands must be used from linux terminal.


Basic use download a package knowing its http (or ftp) URL:


wget http://kernel.org/pub/linux/kernel/v2.6/patch-2.6.23.bz2


Using Wget for Recursive Downloads


wget -r http://my.site.todownload.com/


The -r command tells wget to recursively download everything from the listed url.


Using Wget for Recursive Downloads but limit the number of levels to 2


wget -r -l2 http://my.site.todownload.com/


Now the -r does the same as above the -l tells wget to limit to that
number of levels here 2 levels deep (otherwise the defualt is 5)


Using Wget for Recursive Downloads but limit the type of files you want to download


wget -r -A.pdf -R.htm http://my.site.todownload.com/


This one tells wget to do a recursive get and Accept all files with .pdf extension and reject all files with .htm extension


Using Wget for Recursive Downloads from a FTP with authentication


wget -r ftp://username:password@my.site/path/to/download


Here you tell wget to download from FTP with userid and password


Using Wget to check dead link on your site


wget spider -r -o log.txt http://yourdomain.com


In this example we tell Wget to act like a web spider (Wget will
behave as a Web spider, which means that it will not download the
pages, just check that they are there), and put results in the file
log.txt, so you can open it and search for a list of broken links.


Using Wget to download a photo gallery


for i in `seq -w 1 100`; do wget http://www.mysite.com/images/DSCF00$i.jpg; done


In this example we run a cycle that go from 1 to 100 and every time
download a different URL, really useful for quickly download a gallery
with no links.


Finally, I forgot to tell you that wget is also usable by Mac and Windows (requires Cygwin)


And let me know if you use wget in a fanciful way

Configuring Yum Server in linux

Yum server is used for installing the Linux packages without dependencies.

Configure yum server in RHEL 5.3


Follow the following steps to configure the yum repository in Linux (RHEL 5.3)


STEP1.



Mount the RHEL 5.3 installer disk using


#mount /dev/cdrom /mnt/cdrom


Step2.



Create a directory under the /var as


#mkdir /var/ftp


Step3.



Copy the contain of disk as


#cp -rv /media/RHEL_5.3 i386 DVD/ /var/ftp/pub


Step4.



Edit the yum.repos.d as


#vim /etc/yum.repos.d/server.repo


Add the following in the opened yum.repos.d file


[server]
name=server repository
baseurl=file:///var/ftp/pub/Server
{Note: (Server the letter S is in upper case) do not add this line}
gpgcheck=0



[VT]
name=server repository
baseurl=file:///var/ftp/pub/VT
note: V and T is in upper case.
gpgcheck=0



To install packages using yum

# yum install firefox (where firefox is the name of package.)


Thanks

Dinesh Maurya

Monday, November 9, 2009

Prabhat Maurya

Prabhat Maurya
My heart (Dinesh Maurya)

Saturday, November 7, 2009


hello World.
How are you ?

Tuesday, July 14, 2009

Secure Apache in Linux

Apache is one of the most popular web servers available. And most Apache installations are running on Linux servers. Anyone running LINUX will tell you that the operating system (be it on a server or desktop) enjoys a level of security many operating systems do not enjoy. But does that mean you can just install Apache and assume it 100% safe? No. There are always ways to improve your security on just about every level.

In this article I will show you five simple ways to make your Linux Apache installation more secure. And of course you should always know that even with five new means of making your install more secure, that doesn’t mean it is perfectly safe from attack. Even after securing your installation, you should always keep watch over your server by checking log files and using standard security tools.

With that said, let’s get our Apache security on!

1. Update, update, update! One of the biggest no nos Linux administrators make is to “set it and forget it”. This should not be your standard policy. There are always updates that close new holes and patch security flaws. This holds true for Apache as much as it does any other system or application. Keep watch, using your normal means of update, for any security update for Apache or any constituent component you have installed. By doing this you will ensure your web server is safe from any new known issues.

2. Disable modules you do not use. If you check the Apache configuration file. Most often this file is called httpd.conf and its location will depend upon what distribution you are running (For example CentOS has this file in /etc/httpd/conf/ whereas Ubuntu locates it in /etc/apache2). If you examine that file you will see quite a few modules listed. These modules will look like:

LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule authn_anon_module modules/mod_authn_anon.so

You might have to look up what some of these modules do to know if you need them or not. But there is no reason to load a module if you are not going to use it. To keep a module from loading place a comment in front of the line. You will have to restart Apache for this change to take effect.

3. Limit the request sizes allowed. Denial of Service attacks remain one of the most popular attacks on web sites because they are the easiest to pull off. One way to protect your site from DoS attacks is to use the following directives wisely: LimitRequestBody, LimitRequestFields, LimitRequestFieldSize, LimitRequestLine, and LimitXMLRequestBody within a Directory tag (the document root is probably the best place for this). By default Apache sets these directives to unlimited which means any size of request can be made. You will want to investigate these directives and configure them to suit your web sites needs. Unless it is absolutely necessary, do not set them to unlimited.

4. Use mod_security. This is the most important module you can use. This one module handles such tasks as: Simple filtering, regular expression filtering, server identity masking, and URL encoding validation. It is likely you will have to install mod_security, because the default Apache install does not include this module. Once installed you will want to make sure you at least add the “unique_id” and “security2″ directives in your Apache module section and then restart Apache. I will deal with this module in its own tutorial coming up very soon.


order deny, allow

Deny from all

Options None

AllowOverride None


5. Restrict browsing to your document root. The last thing you want is to allow browser to peek outside of the Apache document root (Such as /var/www/html or /var/www/). To do this you will want to configure your document root directory entry as shown in Figure 1. This will

Of course if you want to add options to any directory inside of the document root you will have to give that directory its own Directory entry.


There are plenty more ways to secure your Apache installation, but these will get you started. Can you think of other ways to secure an Apache installation? If so, share them with your fellow readers.





Monday, June 22, 2009

Twenty20 World Cup




Pakistan won the Twenty20 world cup
Ok its Cricket, i mean it's game
as a Indian its not good for me but as a Asian its good if its won
by India, Sri Lanka, Bangladesh, Pakistan

Saturday, June 20, 2009


Hi,
look this picture !!!