Browsing articles from "December, 2009"
Dec
27
2009

How to append data to the first line

sed ’1 i asd’ README

Dec
25
2009

How many users are connected on http apache server

<? if(isset($_GET['showsource'])) { highlight_file($_SERVER['SCRIPT_FILENAME']); die; } function getIP() { $ip=””; if (getenv(“HTTP_CLIENT_IP”)) $ip = getenv(“HTTP_CLIENT_IP”); else if(getenv(“HTTP_X_FORWARDED_FOR”)) $ip = getenv(“HTTP_X_FORWARDED_FOR”); else if(getenv(“REMOTE_ADDR”)) $ip = getenv(“REMOTE_ADDR”); else $ip = “”; return $ip; } function howManyIps() { $filename = “./howmanyip.log”; $seconds = 300; $yourIP = getIP(); if (file_exists($filename.”.lock”)) $readonly = true; else $readonly=false; $count = 0; //lock the file if (!$readonly) $fpLock = fopen($filename.”.lock”, “w”); //read data ips $fp = @fopen($filename, “r”); $arIPS=explode (“\n”, @fread($fp,filesize($filename)) ); @fclose($fp); [...]

Dec
25
2009

Apache Benchmark

$ ab -n 1000 -c 5 http://202.54.200.1/snkpage.html Where, -n 1000: ab will send 1000 number of requests to server 202.54.200.1 in order to perform for the benchmarking session -c 5 : 5 is concurrency number i.e. ab will send 5 number of multiple requests to perform at a time to server 202.54.200.1 Vir: http://www.cyberciti.biz/tips/howto-performance-benchmarks-a-web-server.html

Dec
19
2009

Unrar Linux

Task: To open rar (unpack) file in current directory type command: $ unrar e file.rar Please note that replace file.rar filename with your actual filename. Task: List (l) file inside rar archive: $ unrar l file.rar

Dec
16
2009

Zend framework include_path php.ini

nono /etc/php.ini ; UNIX: “/path1:/path2″ include_path = “.:/usr/local/ZendFramework-1.9.6/library:/usr/share/pear”

Dec
16
2009

Apache server virtualhost configuration

Server configuration # Ensure that Apache listens on port 80 Listen 80 # Listen for virtual host requests on all IP addresses NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /www/example1 ServerName www.example.com # Other directives here </VirtualHost> <VirtualHost *:80> DocumentRoot /www/example2 ServerName www.example.org # Other directives here </VirtualHost>

Dec
15
2009

Zend Studio + Subversion

Window -> Open Perspective | Other | CVS Repository Exploring

Dec
7
2009

Zend Framework alias

nano .bash_profile alias zf=’/usr/local/ZendFramework-1.9.6/bin/zf.sh’

Dec
3
2009

Subversion + SSL on Centos 5.4

yum install mod_dav_svn subversion mod_ssl [root@lucifer ~] htpasswd -cm /etc/svn-auth-conf yourusername New password: Re-type new password: Adding password for user yourusername [root@lucifer ~] htpasswd -m /etc/svn-auth-conf anotherusername New password: Re-type new password: Adding password for user anotherusername [root@lucifer ~] cd /var/www/ — Or wherever you placed your path above [root@lucifer ~] mkdir svn [root@lucifer ~] cd svn [root@lucifer ~] svnadmin create repos [root@lucifer ~] chown -R apache.apache repos [root@lucifer ~] service httpd restart server# openssl [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes