Protect website folders by .htaccess

<IfModule dir_module> DirectoryIndex index.html index.php index.php4 index.php3 index.cgi index.pl index.htm index.shtml index.phtml </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !(css) RewriteCond %{REQUEST_URI} !(js) RewriteCond %{REQUEST_URI} !(images) RewriteCond %{REQUEST_URI} !(videos) RewriteCond %{REQUEST_URI} !(cache) </IfModule>

pdftohtml

pdftohtml converters  PDF documents into HTML format, which is more suitable for Internet publishing. The converter produces HTML documents with texts, pictures, graphics and bookmarks. pdftohtml software does not require Adobe Acrobat, or even Acrobat Reader. Install pdftohtml on Fedora/Linux: # yum install pdftohtml # which pdftohtml Usage: pdftohtml [Option] <PDF File> [<HTM File>] Source: … Read more

pdftk – fedora – merge pdf files

Pdftk allows to manipulate PDF easily and freely. It does not require Acrobat, and it runs on Windows, Linux, Mac OS X, FreeBSD and Solaris etc. Features: Merge PDF Documents Split PDF Pages into a New Document Rotate PDF Pages or Documents Decrypt Input as Necessary (Password Required) Encrypt Output as Desired Fill PDF Forms with … Read more

Resume Builder pdf2txt, word2txt

Reading PDF Files XPDF package includes “pdftotext.” You have to install XPDF/pdftotext then run the following PHP statement to get the PDF text: $txtcontent = exec(‘/usr/local/bin/pdftotext svnlabs.pdf -‘); Reading DOC Files This package is called Antiword. Here’s the PHP code to grab the Word DOC content: $txtcontent = exec(‘/usr/local/bin/antiword svnlabs.doc’);

Configure Amazon EC2

1.Boot 2 linux servers on EC2 2.Assign elastic IP to each of them 3.Register a domain (eg svnlabs.com) 4.On the domain settings – create 2 host records – ns1.svnlabs.com and ns2.svnlabs.com and point each record to each of the elastic IPs. 5.On your 2 nameserver instances – create dns zone for ns1. and ns2 respectively … Read more

Mysql useful queries

Age: Select DATE_FORMAT (NOW(), ‘%Y’) – DATE_FORMAT(BirthDate, ‘%Y’) – (DATE_FORMAT(NOW(), ’00-%m-%d’) < DATE_FORMAT(BirthDate, ’00-%m-%d’)) AS Age From tbl_member where 1; Change collation: Alter table `tbl_student` convert to character set utf8 collate utf8_swedish_ci; Shift mysql column: ALTER TABLE tableName MODIFY column column_2 int AFTER column_1; Get video info with user info: SELECT `video_id` , `video_title` , … Read more

Form’s array element in javascript

How to access form’s array element in javascript? Web Post Mobile Post Application Post Open Source Post Solution: <form action=”<?=$_SERVER[‘PHP_SELF’]?>” method=”post”> <input name=”post[]” type=”checkbox” value=”web” /> Web Post <input name=”post[]” type=”checkbox” value=”mobile” /> Mobile Post <input name=”post[]” type=”checkbox” value=”application” />Application Post <input name=”post[]” type=”checkbox” value=”open” /> Open Source Post </form> <script type=”text/javascript”> for(i=0;i { if(document.sv.elements[i].type==”checkbox” … Read more

HTML WYSIWYG Editor for Fedora

http://kdewebdev.org/ Quanta Plus is a web development tool for the K Desktop Environment. Quanta is designed for quick web development and is rapidly becoming a mature editor with a number of great features and lies at the heart of the KDE Web Dev suite of tools. http://bluefish.openoffice.nl/ Bluefish is a powerful editor targeted towards programmers … Read more