Top BookMarking Sites

Save your important links online with top bookmarking sites……

1 | twitter
2 |
3 | Yahoo! Buzz
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |

Happy Diwali

दीपावली क़े शुभ अवसर पर आप क़ो बहुत-बहुत शुभकामनाएँ………….”शुभ दीपावली”

Happy Diwali

Wildcard DNS – subdomain profile

A wildcard DNS record is a record in a DNS zone that will match requests for non-existent domain names. A wildcard DNS record is specified by  “*” as the left most label of a domain name, e.g. *

DNS zone Entry 86400 IN SOA
IN MX 10
mail A
ns1 A
ns2 A
* A

.htaccess file:
<IfModule mod_rewrite.c>

RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteCond %{HTTP_HOST} ([^.]+)\.example\.com
RewriteRule ^$ profile.php?uid=%1


Now if you want it will redirect to profile.php with uid=sandeepverma

Find Apache Document Root

solution: Find Apache Document Root

# grep -i 'DocumentRoot' httpd.conf

# find / -name httpd.conf
# locate

(if file here /etc/httpd/conf/httpd.conf)

# grep -i 'DocumentRoot' /etc/httpd/conf/httpd.conf

solution: ffmpeg, libogg, libvorbis, freetype, gcc, faad2, faac

These are the basic tools/libs for video encoding:

sudo yum -y install \
SDL* glew glew-devel libmad-devel tre tre-devel \
libogg libogg-devel libvorbis libvorbis-devel \
boost boost-devel bzip2-devel bzip2-libs fribidi* \
lzo lzo-devel mysql-libs mysql-devel jasper jasper-devel \
faac faac-devel enca enca-devel hal hal-devel hal-libs \
cmake gperf nasm libXmu-devel fontconfig-devel \
freetype-devel libXinerama-devel pcre-devel gcc-c++ \
sqlite-devel curl-devel libsamplerate-devel libcdio-devel \
pulseaudio-libs-devel avahi-devel ffmpeg-devel libmad-devel \
a52dec-devel libdca faad2-devel libmpeg2-devel libass-devel \
libvorbis-devel libogg-devel libmpcdec-devel flac-devel \
wavpack-devel python-devel subversion

Read PDF and Word DOC Files Using PHP

Read PDF and Word DOC Files Using PHP

Reading PDF Files

To read PDF files, you will need to install the XPDF package, which includes “pdftotext.” Once you have XPDF/pdftotext installed, you run the following PHP statement to get the PDF text:
view sourceprint?
1.$content = shell_exec(‘/usr/local/bin/pdftotext ‘.$filename.’ -‘); //dash at the end to output content

Reading DOC Files

Like the PDF example above, you’ll need to download another package. This package is called Antiword. Here’s the code to grab the Word DOC content:
view sourceprint?
1.$content = shell_exec(‘/usr/local/bin/antiword ‘.$filename);

The above code does NOT read DOCX files and does not (and purposely so) preserve formatting. There are other libraries that will preserve formatting but in our case, we just want to get at the text.

CIFS – Common Internet File System

Common Internet File System (CIFS) is a proposed standard protocol that lets programs make requests for files and services on remote computers on the Internet. CIFS uses the client/server programming model. A client program makes a request of a server program (usually in another computer) for access to a file or to pass a message to a program that runs in the server computer. The server takes the requested action and returns a response. CIFS is a public or open variation of the Server Message Block Protocol developed and used by Microsoft. The SMB Protocol is widely used in today’s local area networks for server file access and printing. Like the SMB protocol, CIFS runs at a higher level than and uses the Internet’s TCP/IP protocol. CIFS is viewed as a complement to the existing Internet application protocols such as the File Transfer Protocol (FTP) and the Hypertext Transfer Protocol (HTTP).

CIFS lets you:

  • Get access to files that are local to the server and read and write to them
  • Share files with other clients using special locks
  • Restore connections automatically in case of network failure
  • Use Unicode file names

Mount Windows File System on Linux

# mount -t cifs //192.168.0.x/projects -o username=uname,password=pwd /mnt/public

Install Fonts in Fedora

  1. Log in as root or use su at command line
    $ su
  2. Go to the font storage directory:
    # cd /usr/share/fonts
  3. Create a subdirectory for the Arial fonts:
    # mkdir arial
  4. Copy the Arial fonts into this directory from font sites or windows FONTS folder.
  5. Make the font files accessible systemwide:
    # chmod 0775 -R arial
  6. Run fc-cache to cache the arial fonts on system:
    # fc-cache arial

Install the Alternative PHP Cache (APC)

The Alternative PHP Cache (APC) is a free, open, and robust framework for caching and optimizing PHP intermediate code.

yum install php-pear
yum install php-devel httpd-devel
yum groupinstall ‘Development Tools’
yum groupinstall ‘Development Libraries’
pecl install apc

Regular Expressions (REX)

‘/; (120×160|240×280|240×320|320×320)\)/’



‘/<input type\=”hidden” name\=”([^”]+)”.*?value\=”([^”]*)”[^>]*>/si’