Saturday, May 21, 2011

How To Delete Cached Package Files In Ubuntu

Every time Ubuntu updates or you install some software, the package manager downloads all of the packages to the system, and then caches them there in case they need to be installed again. Unfortunately, this can often mean a real lot of wasted space.

To check this out can do it as follows

du -sh /var/cache/apt/archives

-s option is to summarize

-h is human readable

In my case The cached space was 19MB

To clean the cache use following command

sudo apt-get clean

Tip:You can also disable the caching of the packages by using synaptic package manager

1.System-->Administration-->Synaptic Package Manager

2.settings-->preferences-->files select the radio box (Delete download files after installation) apply-->ok

Tuesday, April 26, 2011

ab - Apache HTTP server benchmarking tool

ab is a tool for benchmarking your Apache Hypertext Transfer Protocol (HTTP) server. It is designed to give you an impression of how your current Apache installation performs. This especially shows you how many requests per second your Apache installation is capable of serving


ab -n 100

The above command will send 100 requests to the server

The output of the command is as follows

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd,
Licensed to The Apache Software Foundation,

Benchmarking (be patient).....done

Server Software: Apache/2.2.14
Server Hostname:
Server Port: 80

Document Path: /
Document Length: 306 bytes

Concurrency Level: 1
Time taken for tests: 62.218 seconds
Complete requests: 100
Failed requests: 0
Write errors: 0
Non-2xx responses: 100
Total transferred: 52800 bytes
HTML transferred: 30600 bytes
Requests per second: 1.61 [#/sec] (mean)
Time per request: 622.181 [ms] (mean)
Time per request: 622.181 [ms] (mean, across all concurrent requests)
Transfer rate: 0.83 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 1 31 299.8 1 2999
Processing: 425 591 505.5 449 4348
Waiting: 425 523 338.8 447 3449
Total: 426 622 580.3 450 4349

Percentage of the requests served within a certain time (ms)
50% 450
66% 455
75% 459
80% 465
90% 1063
95% 1307
98% 3445
99% 4349
100% 4349 (longest request)

I use this tool to benchmark apache performance !!

Sunday, March 6, 2011

What is xinetd in Linux...?

inetd is a daemon on Linux (BSD/Unix) systems that manages Internet services. inetd listens on all ports used by internet services such as FTP, POP3, and telnet. When a TCP packet or UDP packet comes in with a particular port number, inetd launches the appropriate server program to handle the connection. This uses memory more efficiently, as the other daemons do not run constantly.

Under old version of RedHat Linux you can restart inetd (login as root user):
killall -HUP inetd

Note above command should work with almost any Linux distrobution.

New version of RedHat Linux (Fedora) comes with xinetd daemon, which can be restarted as follows:
service xinetd restart

Thursday, December 30, 2010

Disable Directory Listing in Apache

The avoid someone to list your files on your Apache directory, you should do the following step.

sudo vim /etc/apache2/sites-available/default

Add a minus "-" in the front of "Indexes" and it will looking like this :

    Options -Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

Go Greeen!!!! Thanks for visiting my blog!!

Monday, August 2, 2010

How to enable/disable modules in Apache Linux

Apache is the most commonly used Web Server on GNU/Linux systems. Web Servers are used to serve Web Pages requested by client computers. Clients typically request and view Web Pages using Web Browser applications such as Firefox, Opera, or Mozilla.The most common protocol used to transfer Web pages is the Hyper Text Transfer Protocol (HTTP). Protocols such as Hyper Text Transfer Protocol over Secure Sockets Layer (HTTPS), and File Transfer Protocol (FTP), a protocol for uploading and downloading files, are also supported.

Apache Web Servers are often used in combination with the MySQL database engine, the HyperText Preprocessor (PHP) scripting language, and other popular scripting languages such as Python and Perl. This configuration is termed LAMP (Linux, Apache, MySQL and Perl/Python/PHP) and forms a powerful and robust platform for the development and deployment of Web-based applications.

Apache is a modular server. This implies that only the most basic functionality is included in the core server. Extended features are available through modules which can be loaded into Apache. By default, a base set of modules is included in the server at compile-time.

The module are available in the /etc/apache2/mods-available directory. You can use the a2enmod command to enable a module. You can use the a2dismod command to disable a module. Once you enable the module, the module will be available in the the /etc/apache2/mods-enabled directory.

To enable ssl module, use following command:

sudo a2enmod ssl

When you’re finished enabling the modules that you want, you’ll need to perform a “force-reload” of Apache using following command:

sudo /etc/init.d/apache2 restart

Thankyou for visiting my blog....

Friday, July 30, 2010

How to compress / uncompress file using bzip2

bzip2 is a free and open source losseless data compression and program developed by julian seward.bzip2 compress most files most effectively, it compress data in blocks of size between 100 and 900kb and uses burrows wheeler transform burrows wheeler transform to convert frequently occuring recurring character sequences into strings into identical then applies move-to front transform and Huffmans coding, whereas bzip the ancestor of bzip2 uses arithmetic coding.bzip2 is asymmetric as decompression is very fast

Compressing file using bzip2

To compress a file using bzip2, execute the following command:

bzip2 filename.txt (where filename.txt is the file you wish to compress)

The result of this operation is a file called filename.txt.bz2. By default, bzip2 will delete the filename.txt file.

Uncompressing a bzip2 File Using bunzip2

To uncompress a bzip2 file, execute the following command:

bunzip2 filename.txt.bz2

The result of this operation is a file called filename.txt. By default, bunzip2 will delete the filename.txt.bz2 file.

Saturday, July 10, 2010