Showing posts with label Internet. Show all posts
Showing posts with label Internet. Show all posts

Monday, 24 February 2014

How the HTTP Live Streaming works: The Basics of HTTP Live Streaming

The research for this article started when some of my subscription users started complaining that they could only see a few minutes of one of my longer webinars before they needed to reset their browser. At first, I thought this was caused by bad programming on our part. But, further research made me realize that iOS devices only stream about 10 minutes of continuous video content when they are connected to a cellular data network, then they stop.
Period.
This article explains why. (If you want a more technical explanation, read this Apple Support Note.)
NOTE: If any of the following conditions are true, you can ignore this article:
  • You stream all your videos off YouTube, Vimeo, or other commercial streaming service
  • Your videos run less than 10 minutes
  • No one watches your videos on an iOS mobile device (apparently, Android devices don’t have this limitation).
Understanding Live Streaming isn’t easy, but it isn’t impossible, and this article provides a cookbook you can follow which makes a lot of it fairly simple.
SOME BACKGROUND
There are two types of web video:
  • Progressive downloads
  • Streaming video

Find more on below link:

Referred: The Basics of HTTP Live Streaming

Tuesday, 10 May 2011

Connecting to AWS EC2 (Linux) Instance With PuTTY via SSH In order to connect to an Amazon Web Services EC2 Linux instance using PuTTY over SSH you mu

Connecting to AWS EC2 (Linux) Instance With PuTTY via SSH
----------------------------------------------------------
In order to connect to an Amazon Web Services EC2 Linux instance using PuTTY over SSH you must generate a PPK file from your private key, then import the PPK to PuTTY. PuTTY does not natively support the private key format generated by Amazon EC2, therefore PuttyGen must be used to convert keys to its internal format.

please, download the following file with the complete information.

Connect to your Amazon AWS EC2 Linux machine using SSH and PuTTY in Windows

Monday, 9 May 2011

Checking IE Browser using PHP Script

Checking IE Browser using PHP Script
-------------------------------------
if (preg_match('|MSIE ([0-9].[0-9]{1,2})|',$_SERVER['HTTP_USER_AGENT'])) {
{
 echo 'IE';
}
else {
 echo 'Other Browser';
}

Monday, 5 July 2010

SLC Result 2066/67, 2010 has been published, to view result goto http://www.nepalipathshala.com/slc

School Leaving Certificate (SLC) examination result 2066/2067 (2010 AD) has been just published on 02 July 2010...
School Leaving Certificate (SLC) examination result 2066/2067 (2010 AD) has been just published 02 July 2010...

For details information, please do LogOn to http://www.nepalipathshala.com/slc,

Best of luck for better result to you !!!

Friday, 27 November 2009

How to Use PHPMailer to send mail, PHPMailer() Class, class.phpmailer.php

1. First, download the PHPMailer library class.
2. Include the class.phpmailer.php to the file from where you want to send mail.
3. Make a local library function class of your choice.

for example, the following "func.global.php" as
/* ------------------file name: - func.global.php ---------- */
function sendMailWithAttachment($config, $email_data)
{
$email = $email_data;
$mail = new PHPMailer();
$mail->CharSet = "utf-8";

if($config['email_type'] == 'smtp')
{
$mail->IsSMTP();
$mail->SMTPAuth = TRUE;
$mail->Username = $config['email_username'];
$mail->Password = $config['email_password'];
$mail->Host = $config['email_hostname'];
}
else if ( $config['email_type'] == 'sendmail')
{
$mail->IsSendmail();
}
else { $mail->IsMail(); }

$mail->FromName = $email['from_name'];
$mail->From = $email['from_email'];

if ( count($email['bcc']) > 0)
{
$counter = 0;
foreach ($email['bcc'] as $value)
{
if($counter == 0) { $mail->AddAddress($value); }
else { $mail->AddBCC($value); }

$counter++;
}
} else
{
$mail->AddAddress ( $email['to_email'];
}

if ( !empty($email['attachment']))
{
$mail->AddAttachment ($email['attachemnt']);
}

$mail->IsHTML (FALSE);
$mail->Send();

$sentMessage = array();
$sentMessage['isSent'] = TRUE:
$sentMessage['sentMessage'] = "Message has been sent";
if ( ! $mail->Send())
{
$sentMessage['isSent'] = FALSE;
$sentMessage['sentMessage'] = "Message could not be sent

";
$sentMessage['sentMessage'] .= "Mailer Error : ", $mail->ErrorInfo;
}

return $sentMessage;
}
/* end of sendMailWithAttachment function. */


4. Use the above "func.global.php" file's function called sendMailWithAttachment() as;

/* ------------------file name: - sendEmail.php ---------- */

require_once ( "class.phpmailer.php");
require_once ( "func.global.php");

/* To send the email as normal php mailto() function ways but throw the your own SMTP mail server. */
$config = array('email_type'=>'smtp', 'email_username'=>'smtpuser', 'email_password'=>'smtppswd', 'email_host'=>'hostserver');

/* To send the email as normal php mailto() function ways. */
$config = array('email_type'=>'sendmail');
$email_data = array('from_name'=>'Jastin', 'from_email'=>'jastin.td@gmail.com',
'to_email'=>'kuliek@hotmail.com',
'bcc'=>array('gostels@live.com','hellopotak@yahoo.com'),
'attachement'=>'C:\docs\my_pics.jpeg'
);

sendMailWithAttachment ($config, $email_data);

If you like to read more about the PHP Mailer, click here

Sunday, 22 November 2009

How to Install Magento on XAMPP in XP

(UPDATED-03.25.09) - I have started using WAMP. Magento has a nice install guide on their wiki. The guide covers both XAMPP and WAMP but I've been having problems getting v1.2 or newer of Magento to work with XAMPP. Thus the switch to WAMP. So far I am liking WAMP better.

XAMPP is an easy to install LAMP environment used for testing. Magento is an open source ecommerce package. You should already have XAMPP installed and a copy of Magento. Start Apache and MySql if not already running.

Enable curl in XAMPP
1) Locate the following files:
C:\Program Files\xampp\apache\bin\php.ini
C:\Program Files\xampp\php\php.ini
C:\Program Files\xampp\php\php4\php.ini
2) Uncomment the following line on the php.ini files by removing the semicolon.
;extension=php_curl.dll
3) Restart your apache server

Create Magento database
1) Open a browser and navigate to http://127.0.0.1/phpmyadmin/
2) Create a new data base named magento

Install Magento
1) Extract the Magento-1.0.19870.4. zip file
2) Copy the extracted files to the httpdoc folder of XAMPP (rename any exsisting index files for your XMAPP install)
3) Navigate your browser to http://127.0.0.1/index.php
4) Follow the Magento install wizard

Friday, 13 November 2009

To reload the Parent Window from Clild Window by Javascript


< a href="#" onClick="javascript:parent.location.reload()" > Click to Reload Parent window < /a >

Thursday, 12 November 2009

HTML to PDF, generate PDF with HTML data,

To generate the HTML contents in PDF datatype or .pdf file format. Use the following steps:

1. Download the dompdf from
    http://code.google.com/p/dompdf/
or http://sourceforge.net/projects/dompdf/

2. Upzip(if necessary) and keep the dompdf/ folder at your's project root directory.

then, make a function to generate pdf file for download or write a file to the disk as;

/* function to generate the .pdf file for download. */

function get_generate_pdf ($htmlContent, $filename)
{
require_once ("../dompdf/dompdf_config.inc.php");

$dompdf = new DOMPDF();
$dompdf -> load_html($htmlContent);
$dompdf -> render();

$dompdf -> stream($filename);
}

/* function to write the .pdf file with HTML Contents. */
function get_write_pdf_file ($htmlContent, $filename)
{
require_once ("../dompdf/dompdf_config.inc.php");

$dompdf = new DOMPDF();
$dompdf -> load_html($htmlContent);
$dompdf -> render();

$pdfContent = $dompdf -> output();
file_put_contents($filename, $pdfContent);
}

/* function to write the file Contents. */
function get_write_file ($content, $filename, $mode="w")
{
$fp = @fopen ($file, $mode);

if ( ! is_resource($fp)) { return false; }

fwrite ($fp, $content);
fclose ($fp);
}

$htmlContent = "< html >< head >< title >SamplePDF file< /title >< /head >
< body >< strong >You can include any kinda html content in this body format.< /strong >< /body >< /html >";

$filename = "sample_pdf_file.pdf";

/* Calling above function for html content in pdf attachment file format. */
get_generate_pdf ($htmlContent, $filename)

/* Calling above function for html content in pdf attachment file format. */
get_generate_pdf ($htmlContent, $filename);

Friday, 6 November 2009

PDF and PHP, Generate PDFs with PHP

There is a lot of PHP code available to generate PDF but most of it requires downloading and installing php extensions. In a shared hosting environment you don't always have access to php configuration, which is why ezPDF is nice. ezPDF is open source PDF generation PHP. See below for an example of 'on the fly' pdf generation, using ezPDF.

include_once ('class.ezpdf.php');
//ezpdf: from http://www.ros.co.nz/pdf/?
//docs: http://www.ros.co.nz/pdf/readme.pdf
//note: xy origin is at the bottom left

//data
$colw = array( 80 , 40, 220, 80, 40 );//column widths
$rows = array(
array('company','size','desc','cost','instock'),
array("WD", "80GB","WD800AAJS SATA2 7200rpm 8mb" ,"$36.90","Y"),
array("WD","160GB","WD1600AAJS SATA300 8mb 7200rpm" ,"$39.87","Y"),
array("WD", "80GB","800jd SATA2 7200rpm 8mb" ,"$41.90","Y"),
array("WD","250GB","WD2500AAKS SATA300 16mb 7200rpm" ,"$49.88","Y"),
array("WD","320GB","WD3200AAKS SATA300 16mb 7200rpm" ,"$49.90","Y"),
array("WD","160GB","1600YS SATA raid 16mb 7200rpm" ,"$59.90","Y"),
array("WD","500GB","500gb WD5000AAKS SATA2 16mb 7200rpm","$64.90","Y"),
array("WD","250GB","2500ys SATA raid 7200rpm 16mb" ,"$69.90","Y"),
);

//x is 0-600, y is 0-780 (origin is at bottom left corner)
$pdf =& new Cezpdf('LETTER');

$image = imagecreatefrompng("background.png");
$pdf->addImage($image,0,0,611);

$pdf->selectFont("fonts/Helvetica.afm");
$pdf->setColor(0/255,0/255,0/255);
$pdf->addText(80,620,10,"List of Hard Drives");

$pdf->setLineStyle(0.5);
$pdf->line(80,615,540,615);
$pdf->setStrokeColor(0,0,0);

$pdf->setColor(0/255,0/255,0/255);
$pdf->addText(30,16,8,"Created ".date("m/d/Y"));

$total=0;
$curr_x=80;
$curr_y=600;
foreach($rows as $r)
{
$xoffset = $curr_x;
foreach($r as $i=>$data)
{
$pdf->setColor(0/255,0/255,0/255);
$pdf->addText( $xoffset, $curr_y , 10, $data );
$xoffset+=$colw[$i];
}
$curr_y-=20;
}

$pdf->ezStream();
?>


Demo:
Download Demo PDF (dynamically generated with php)
Download all-in-one example.zip 349KB (includes ezPDF)

Notes:
* The above code generates a 1 page pdf, but a multi-page PDF is possible using the $pdf->ezNewPage() function. Any $pdf->addText() or $pdf->addImage() calls after that point are added to the new page.
* The size of a LETTER page in ezPDF is 612x792 (w by h in pixels)
* The (x,y) origin (0,0) is at the bottom left of a PDF page

Further Reading
* ezPDF and
* ezPDF API Docs[pdf]
* pdf-php at sourceforge

Thursday, 5 November 2009

Nepali Date, Get Nepali Date, Today's Nepali Date

You can Get Nepali Date to your site from us;
Nepali Date Sample
(no need to update daily, it will be auto update)

For that Please Contact at :
Email: info@grabhost.net
visit: www.date.grabhost.net

Thank You !!!

Thursday, 16 July 2009

Brute Force Protection

While trying to browse the site, if you get this
--------------------------------------------------------------------------------------------
The requested URL /suspended.page/ was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
------------------------------------------------------------------------------------------
It could be due to due to Brute force attempt was detected.

Brute Force Protection
This account is currently locked out because a brute force attempt was detected.
Please wait 10 minutes and try again. Attempting to login again will only increase this delay.
If you frequently experience this problem, we recommend having your username changed to something less generic.

Solution / Fix

Account Locks Out Due to Brute Force Protection in cPanel WebHost Manager (WHM)


Occasionally, when user or website administrator attempts to login to cPanel’s WebHost Manager (WHM), or remote or local log in via Telnet or SSH to Linux console to the web server, the login is denied and not allowed. The following error message may appear.

This account is currently locked out because a brute force attempt was detected. Please wait 10 minutes and try again. Attempting to login again will only increase this delay. If you frequently experience this problem, we recommend having your username changed to something less generic.


The brute force protection on cPanel-powerd web host is provided by cPHulk, which prevents malicious forces from trying to access the server’s services by guessing the login password for that service. When an account on the system has experienced too many failed login attempts, the particular account will automatically been “protected” by forbidding further login attempts, including all-important root account. cPHulk Brute Force Protection will also block out an IP address which has been detected to send too many unauthorized logon attempts.

As a result, server’s owner are potentially been locked out of the server if the cPHulkd is enabled, even the wild-guessing brute force hacking is done by hackers in another corner of the world.

When WHM locks out an user account, especially “root”, the best way is to wait for 10 minutes to see if the account will be unlocked. If the locks persists, webmaster and administrator who still can remote login via SSH to the server as root can manually remove the lockouts via following steps:

  1. Type mysql at console to access MySQL client.
  2. At MySQL client prompt, enter the following commands (preceding with mysql>)one after one, pressing Enter each time:

    mysql> use cphulkd;

    Expected result: Database changed.

    mysql> BACKUP TABLE `brutes` TO ‘/path/to/backup/directory’;
    mysql> BACKUP TABLE `logins` TO ‘/path/to/backup/directory’;

    Above command will backup the brutes table, the main table used by cPHulk to record locked accounts and denied IP addresses.

    mysql> DELETE FROM `brutes`;
    mysql> DELETE FROM `logins`;

    Above commands will remove all blocked IP addresses and locked accounts from the system, enabling full access again. If you’re familiar with SQL statements, it’s possible to use WHERE clause to specify logins or IP address that you want to remove only.

    mysql> quit;

    Exit MySQL client.

If you can’t login to the server due to brute force protection, you probably have to contact web hosting service provider support to physically access the server to remove the Brute Force Protection. To avoid future blockage or lock out, it’s recommended to add own IP address as Trusted Hosts List whitelist in cPHulk Brute Force Protection. To do so, go to WHM -> Security -> Security Center -> cPHulk Brute Force Protection. Inside “Configure cPHulk”, click Trusted Hosts List link.