Posts with the name or tag of Linux;

by emran

Use wget with Squid Proxy Server

1:01 pm in Linux by emran

you can pass the proxy username and password as follows:
wget –proxy-user=YOUR-USERNAME-HERE –proxy-password=YOUR-PASSWORD-HERE http://nixcraft.com/file.tar.gz

by admin

Squid Proxy Server Mac Address based filtering

2:44 pm in CentOS, Fedora, FreeBSD by admin

To set up ACL’s based on MAC address:

Open squid.conf:

# vi /etc/squid/squid.conf

Local acl, section and append ACL as follows:

acl macf1 arp mac-address
acl macf2 arp 00:11:22:33:44:55
http_access allow macf1
http_access allow macf2
http_access deny all

Save and close the file. Restart squid server:

# /etc/init.d/squid restart

by emran

How to disable SELinux in CentOS?

2:32 pm in CentOS, Fedora by emran

In Fedora Core and RedHat Enterprise or CentOS, edit /etc/selinux/config and change the SELINUX line to SELINUX=disabled

That’s all.

by admin

Increase Private Memory Size on OpenSIPS

6:59 am in Linux, OpenSIPS by admin

By default the size of private memory chunk used by each OpenSIPS process is 1 MB.

To increase the size of private memory you need to compile OpenSIPS from sources. Once you get the sources from SVN or the opensips.org’s download site, do the following steps:

- edit the file “config.h” and search for the next lines:

/*used only if PKG_MALLOC is defined*/
#define PKG_MEM_POOL_SIZE 1024*1024

- change the value of PKG_MEM_POOL_SIZE to desired size, for example to have 4MB of private memory:

#define PKG_MEM_POOL_SIZE 4*1024*1024

- recompile and reinstall OpenSIPS

make all; make install;

by admin

Increase Share Memory Size on OpenSIPS

6:54 am in Linux, OpenSIPS by admin

To increase the share memory size use ‘-m’ command line parameter of OpenSIPS.

opensips -m 256

# this will run OpenSIPS with 256MB of share memory

by admin

How to make money from Twitter

8:23 pm in CMS, Linux, Others, PHP by admin

If you have a twitter account with many followers or just a few, you still can make money through a Twitter advertising company called Ad.ly.

You set the price and once an advertiser is interested to put an ad in your tweet, you’ll earn money. For how much? It depends on how much price you have set.

by emran

Git Tutorial

10:19 am in CentOS, Linux by emran

You have to download your project and place to a folder.

$ tar xzf project.tar.gz
$ cd project
$ git init-db

This will initialize your project on git.now you have to add files which will monitored via git.

$ git add .

these means git will monitor all files.

$ git commit -a

This will prompt a message to commit.
Try modifying some files, then run

$git diff

to review your changes.

by emran

How to create tar.gz?

5:23 am in CentOS, Debian, Fedora, Linux, Mandrake, SuSE by emran

You can create tar.gz file with the following command.DO NOT ENTER / after the directory name.

tar -cvzf  test.tar.gz test

by emran

Raising the ulimit -n above 1024

1:18 am in Linux by emran

by default the ulimit is set to 1024 only, first u need to increase system wise with

“fs.file-max = 65536″

adding this one in sysctl.conf

and then “sysctl -p”

switch to /etc/securitty/limits.conf and add ther following lines

* hard nofile 65536
* soft nofile 16384

switch 2 user for which u need to increase the file-max for, with this the default for all users will be 16384,

u can increase with ulimit -n XXXX now

by emran

How to Install Perl CPAN Module

9:47 am in CentOS, Debian, Fedora, Linux, Mandrake, SuSE by emran

From the root prompt on your server, invoke the CPAN shell:

# perl -MCPAN -e shell

Once the Perl interpreter has loaded (and been configured), you can install modules with: install MODULENAME.

The first thing you should do is upgrade your CPAN:

cpan> install Bundle::CPAN

Once it is completed, type:

cpan> reload cpan

Now, enter the following command to retrieve all of the required modules:
cpan> install DateTime

Note

Be aware that after freshly installing make / gcc, your perl installation will not necessarily detect it. This means module installation will still fail during the 'make' stage. You may need to invoke the CPAN shell and run the setup routine again, to point to the location of make:
# perl -MCPAN -e shell CPAN

 

cpan> o conf make /usr/bin/make
cpan> o conf commit