Friday, July 3, 2009

backup server

backup server

http://thuannvn.blogspot.com/2009/01/rsync-over-slow-wan-connections.html

http://sweemengs-tech-world.blogspot.com/2009/06/learned-how-to-use-rsync.html

Reload MBR from Grub

fixboot + site:blogspot.com

http://www.yolinux.com/TUTORIALS/LinuxTutorialRecoveryAndBootDisk.html

http://forums.fedoraforum.org/showthread.php?t=137916

http://hardwareforu.blogspot.com/2008/06/fixboot.html

http://mynewlaptop.blogspot.com/2008/06/correcting-windows-crashes.html

http://ultcomprepair.blogspot.com/2008/07/windows-xp-fix-bootini.html

http://opesh.blogspot.com/2007/06/restore-vistas-master-boot-loader.html

http://easytorepair.blogspot.com/2008/12/fix-bootcfg-commands-on-recovery.html

Wednesday, July 1, 2009

Install Eclipse WTP

Install Eclipse WTP

http://www.vogella.de/articles/EclipseWTP/article.html

http://confluence.sakaiproject.org/display/BOOT/Install+Eclipse+WTP

http://www.eclipse.org/webtools/community/tutorials/DevelopingWTP/DevelopingWTP.html

http://www.eclipse.org/pdt/downloads/

http://live.eclipse.org/

http://eclipse-info.blogspot.com/2009/06/eclipse-galileo-quick-glance.html

http://www.eclipse.org/Xtext/

http://planeteclipse.org/planet/rss20.xml

http://www.ibm.com/developerworks/opensource/library/os-eclipse-galileo/index.html?ca=drs-

NFS server Fedora 11

Setting up a Fedora NFS server

http://fconfig.wordpress.com/2006/08/17/setting-up-a-fedora-nfs-server/

http://www.server-world.info/en/note?os=Fedora_11

http://www.mjwired.com/

http://www.labtestproject.com/

http://2tbsp.com/node/40

Tuesday, April 28, 2009

Streamincloud.com

The h264 encoder can produce a higher quality video at a lower bitrate, saving you bandwidth costs. We encode all videos at 512kbps.

Load balancing server is capable of running simultaneously in an array of replicated servers to handle any volume of videos from our users.

http://developer.amazonwebservices.com/connect/entry.jspa?externalID=1421

http://www.linuxjournal.com/article/9005

http://www.elctech.com/articles/installing-ffmpeg-with-faac-and-x264-encoders-from-source-on-ubuntu

http://research.edm.uhasselt.be/~h264/ (intro)

http://flowplayer.org/forum/7/12671

http://www.myownserver.info/index.php/additional-configurations-and-settings-linux/49-ffmpegpackagelinuxinstall.html

http://eugenia.gnomefiles.org/2008/10/23/h264-encoder-benchmark/

http://www.videolan.org/developers/x264.html

http://blogs.smugmug.com/don/2007/08/21/finally-flash-supports-h264-video/

http://www.flvhosting.com/help/viewthread.php?id=147

http://getonebyone.com/h264.html#Downloads

http://blog.monogram.sk/janos/2008/12/29/monogram-x264-encoder-1020/ (good)

http://ubuntuforums.org/showthread.php?t=786095

http://me.dm/blog/2009/01/using-cloudberry-explorer-with.php

http://streamincloud.com/examples/

http://www.youtubehq.info/convert-your-video-to-h264-for-free/

http://bradrhoads.blogspot.com/2009/03/flash-with-high-quality-video-mp4-with.html

http://videocodecs.blogspot.com/

http://videos-flash.blogspot.com/2007/01/flash-video-streaming-and-open-source.html

http://linux-tipps.blogspot.com/2008/08/hd-video-encoding-in-sync-with-ffmpeg.html

http://www.nazly.net/post/installing-ffmpeg-and-ffmpeg-php-on-centos-230/

http://juliensimon.blogspot.com/2008/12/howto-compiling-ffmpeg-x264-mp3-xvid.html

http://www.austenconstable.com/2008/08/06/howto-compiling-the-latest-ffmpeg-x264-on-centos-4/

http://www.mediacollege.com/


Happy streaming!

Monday, April 20, 2009

Resize YouTube Video

Here is the code how to resize youtube video embed code, even this code will work to non-youtube embed videos.....

<?php

$embed = '<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/SOiGqFceMYo&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/SOiGqFceMYo&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>';

//$alt = preg_match_all('/(width|height)=("[^"]*")/i', $embed, $matches);

$embed = preg_replace('/(width)=("[^"]*")/i', 'width="200"', $embed);
$embed = preg_replace('/(height)=("[^"]*")/i', 'height="200"', $embed);

echo $embed;

?>

Output here:



Now try to resize youtube player with php regular expression replace preg_replace()......

Sunday, April 19, 2009

Install PECL on Windows

PECL is a repository for PHP Extensions, providing a directory for php extensions and hosting facilities for downloading and development of PHP extensions.

We can use Xampp 1.7 with PECL on Windows!

Download PECL from here....
http://in2.php.net/get/pecl-5.2.6-Win32.zip/from/a/mirror

Using PECL we can improve web application's speed using APC ....
http://www.rooftopsolutions.nl/article/107

Sandeep Verma.

Friday, April 17, 2009

Javascript Event Log ~ Console

This is the javascript function used for tracking javascript events as in alert(). This may be replacement of alert() to better track the javascript events and error/success messages.

/*
Below is the function where to call console()
*/
window.document.onclick = function(){ console(window.event.target.onclick) };

function console(msg)
{

mywin = window.open('', 'console', 'width=500,height=150,left=800,top=800,scrollbars=yes,location=no');

if (mywin && msg!=null)
mywin.focus();

mywin.document.title='Javascript Console...';

if(msg!=null)
mywin.document.writeln('<div style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; border-bottom: 1px dotted #FFB64A; padding:4px;">'+msg+'</div>');
}

Thursday, March 26, 2009

Web Security

These are some useful links for web security:

http://www.selfseo.com/website_security_articles.php

http://www.askapache.com/htaccess/security-with-apache-htaccess.html

http://www.sitesecuritytips.com/how-to-check-website-security-2/

http://www.debian-administration.org/articles/465

http://www.watsonhall.com/methodology/top10-website-security-myths.pl

http://www.onlinesecurity-guide.com/

http://www.stopbadware.org/home/security

http://www.kent-website-designer.co.uk/website_security.html

http://www.phpfreaks.com/tutorial/php-security/

http://www.webmasters-central.com/t/siteprotection/images.shtml

http://daniel0.net/phpfreaks_tutorials/php_security/php_security.pdf

http://www.webmasters-central.com/t/siteprotection/email.shtml

http://www.owasp.org/index.php/Reviewing_Code_for_Cross-site_scripting

http://en.wikipedia.org/wiki/Cross-site_scripting

http://www.mobiledatanow.com

Enjoy Browsing........

How to convert video files into FLV by mobile device

1 - Create email (Mobile Profile) like username@domain.com using cpanel API or curl.
2 - Use this Email for sending video from mobile via internet to username@domain.com.
3 - Make a script for reading these email from user’s inbox by IMAP function.
4 - Create a cron job (every hour) for read/save these attached video to site in a folder.
5 - Make a script for converting these videos to FLV by ffmpeg and mail user about converted video by email.
6 - Enjoy videos. :)

Useful Linux Commands……

General Information
# cat /proc/version (Linux Version)
# cat /proc/meminfo (Memory Information)

Zip File/Folder in Linux
# zip -9 -r
# zip -9
Use “-9? for best compression. The compressed file works fine with Windows XP compression tool.

Execute Shell Script
# chmod x+ file.sh
# ./file.sh

System User
# useradd -d /var/www wwwuser
# passwd wwwuser
# userdel wwwuser
# userdel -r wwwuser

List loaded Modules
# lsmod

Extract here
# tar -xvzf latest.tar.gz -C ./(folder name)
# unzip file.zip

Upload site with zipped version
# zip -9 -r /var/www/html/html.zip /var/www/html
# wget http://75.101.199.175/html.zip
# unzip html.zip
# cd /root/var/www/html
# mv * /var/www

Create shortcuts in linux
# rm -rf /var/www/
# ln -sf /var/scalr/app/www /var/
# chmod a+rX -R /var/www
# ln -sf /var/log/apache2 /var/www/logs

Compute Load
# uptime (1,5,15 minute)
# w
# top
* CPU usage
* ‘uptime’ for load average
* ‘top’ for an overall system view
* ‘iostat’ for storage I/O statistics
* ‘netstat’ for network statistics
* ‘mpstat’ for CPU statistics
* ‘tload’ for display an ncurses graphic of the recent load

Linux Ports/processes
# netstat -an
# lsof -i
# nslookup www.*.com
# ps aux | grep mysqld
# netstat -an
# netstat -an | grep 3306

Updrage php 5.2.x
cd /etc/yum.repos.d
wget http://remi.collet.free.fr/rpms/remi-fedora.repo
yum –enablerepo=remi update mysql
yum –enablerepo=remi update php
apachectl restart

Others
# whereis file
# locate filename
# find / -name filename
# shutdown -r now (restart)

PHP Web Tricks/Tips

Some Web PHP Tricks/Tips :)

Database:
1. Delete all information from databse related to, if deleting user or any content from CMS.
2. Use PDO, ADO, Pear, Zend etc. library to connect to database.
3. Take regular backup for database.
4. Use better naming convension.

Folders:
1. Use better naming convension.
2. Take regular backup for folders.
3. Protect project’s folder to unauthorized access, just put index.html or use apache security.
4. Folder name are case sensitive on servers like linux.
5. Don’t use 0777 permission on any folder use 0755.

Files:
1. Use better naming convension.
2. Use better documentation for web files, apply comments for coding and indent it.
3. Make consistency in DB, Filesnames, Variables, Page design.
4. Take regular backup for files.
5. Use caching for file to make site speed more fast.
6. Create debug files .txt, .log, .html etc. (fopen() | fwrite()) for tracking logical bugs.

Images:
1. Use version number in image URL to avoid image caching. (”san”)
2. Images should have Etags, Max Age and far future expired header for caching.
3. Use a global funtion to display images ( draw_images($src, $attr); )

Class:
1. Use better naming convension.
2. Use encryption class (md5, sha, base64 etc. with salt) for storing password and important data into database.
3. Spidering web page (Curl, Pear etc.) is used for getting content of web page.

Functions:
1. Use function or include files for multiple use of web data to make reusability, integrity and productivity.
2. Use PHP session ID, remote IP and page name on increment views/hits.
3. Make function to load CSS, JS, Links, Forms & Elements, Images, Iframes etc. on webpage. (load_css_file(), load_js_file()….)
4. Looping should be start from Left to Right…

Variables:
1. Use better naming convension.
2. Use defined variables/constants for folder names, DB table names, Files and global variables (avoid hard coding, be happy coder).

CSS:
1. Avoid inline CSS on pages because it effect the page load time & speed also it matter in W3C validation.
2. Combine multiple CSS file in a single file with cached version.
3. Avoid conflict in CSS.
4. Avoid CSS expressions.
5. Use CSS Sprite for images.

JS:
1. Avoid inline JS on pages because it effect the page load time & speed also it matter in W3C validation.
2. Combine multiple JS file in a single file with cached version.
3. Use valid syntax for browser checking in javascript.
4. Avoid duplicate JS function.

Ajax:
1. Minimize the errors in HTML closing tags etc.
2. Use proper hyrarchy for HTML tags.
3. Use Math.random() in Ajax URL as parameter.
4. Send URL as parameter after encodeURIComponent() similar to urlencode() in PHP.
5. Use file_get_contents($url) for first time filling Ajax DIV.
6. Use new window to display javascript alert debug messages as append messages in log files.
7. Use Ajax Cached version.

WebPage:
1. On login page username/password should be case sensitive.
2. Open terms of use page in popup window on registration page.
3. Use better UI for Errors/Success messages.
4. Use cancle button near submit button.
5. Use captcha code on pages by session value to avoid Spams.
6. Put valid ALT values in IMG tags.
7. Use Enter button event on form’s submit control.
8. Use scrolling DIV on webpages for better GUI.
9. Use returnto parameter for redirecting page after login.
10. Use remember option on login page.
11. Use valid/correct statements in error/success/warning messages.
12. Use dynamic Title and Meta tags on page.
13. Use error pages like 404, 500 etc. by .htaccess
14. Use good NO/Blank image for image not found.
15. Use htmlspecialchars() in strings displayed on webpages for W3C validations.
16. Use favicon for webpages for better GUI.

Emails:
1. Use good words like Dear, Regards, Thanks etc. in emails.
2. Attach some links, images, videos etc. for proper understanding.
3. Use reference and ref. # in emails.

Tools:
1. Use IDE like APTANA, Dreamweaver, Zend Editor.
2. Use DW’s context menu for HTML/PHP code to avoid W3C errors/warnings.
3. Use FireFox plugins for development (Web Developer, Firebug, Scribefire, ColorZilla, FireFTP, S3Fire, ElastoFox, Gtalk, GrabScreen, YSlow, FireShot etc.) for site’s speed, performance and optimization.
4. Make sure we are using secure FTP, Email Client….
5. Command Line tools (putty, CMD etc.) are very good utilities for batch processes and large files.

Search:
1. View source and display function (echo, print etc.) are very useful for finding bugs and faults.
2. Try to search visual concept like jQuery, Ajax etc. on google images search engine.
3. Use google operator for getting better results.

Keep browsing, happy coding……. :)

Wednesday, March 18, 2009