Total Pageviews

Thursday, May 16, 2019

linux commend rename the partition



[root@hostname]# vi /etc/fstab

/dev/some     /partition_name

#####Edit to  newname
#####press insert to edit

/dev/some     /new_partition_name

###save the file.

:wq!

#####then

[root@hostname]# mount -a

[root@hostname]# df - h

[root@hostname]# reboot

[root@hostname]# df - h


Follow kvn_krishna on Twitter

Tuesday, July 8, 2014

html 5 video tag.

Follow kvn_krishna on Twitter


<video width='320' height='240' controls autoplay>
 <source src='http://someurl/video.mp4' type='video/mp4'>
  <source src='http://someurl/video.ogg' type='video/ogg'>
  <source src='http://someurl/video.webm' type='video/webm'>

<object data='movie.mp4' width='320' height='240'>
<embed width='320' height='240' src='movie.swf'>
</object>
</video>  

Wednesday, November 20, 2013

Add loader until the page loads completely

This code used to show the loader until the page loads.......

var overlay = jQuery('<div id="overlay"> </div>');
overlay.appendTo(document.body)
$(window).load(function() {
 $('#overlay').html("<img src="ajaxLoader.gif" class="ajaxLoader"/>");

});


Follow kvn_krishna on Twitter


Ajax Loader, $.getJSON Loader,

Just copy Paste on ur Script top,

It defines globally so no need add again and again for ajax events. It will fire for the jQuery Ajax events.



var cssOverlayOption = {
"position": "fixed",
    "top": 0,
    "left": 0,
    "width": "100%",
    "height": "100%",
    "background-color": "#000",
    "filter":"alpha(opacity=50)",
    "-moz-opacity":"0.5",
    "-khtml-opacity": "0.5",
    "opacity": "0.5",
    "z-index": 10000
};

var loaderImageCenter = {
"position":"relative",
"top":"50%",
"left":"50%"
};
var overlay = jQuery('<div id="overlay"><img src="images.jpg" id="loaderImage" width="99" height="102" title="Loading..." align="middle"  /> </div>');
overlay.appendTo(document.body);


$(document).ajaxStart(function() {
$("#loaderImage").css(loaderImageCenter);
    $("#overlay").css(cssOverlayOption).show();

});


Follow kvn_krishna on Twitter

Sunday, June 23, 2013

Detect Browser in php, User agent detection in php

function detect_mobile()
{
    if(preg_match('/(alcatel|amoi|android|avantgo|blackberry|benq|cell|cricket|docomo|elaine|htc|iemobile|iphone|ipad|ipaq|ipod|j2me|java|midp|mini|mmp|mobi|motorola|nec-|nokia|palm|panasonic|philips|phone|playbook|sagem|sharp|sie-|silk|smartphone|sony|symbian|t-mobile|telus|up\.browser|up\.link|vodafone|wap|webos|wireless|xda|xoom|zte)/i', $_SERVER['HTTP_USER_AGENT']))
        return true;

    else
        return false;
}

$mobile = detect_mobile();
if($mobile === true)
{

header("location:mobiledevice/index.php");

}
else
{

echo '<h3>you are looking via system browser</h3>';

/*echo $_SERVER['HTTP_USER_AGENT'];*/

}





Follow kvn_krishna on Twitter

Detect Browser in Javascript, User agent detection in Javascript

<script type="text/javascript">
 var ismobile = navigator.userAgent.match(/(alcatel) | (amoi) | (android) | (avantgo) | (blackberry) | (benq) | (cell) | (cricket) | (docomo) | (elaine) | (htc) | (iemobile) | (iPhone) | (ipad) | (ipaq) | (ipod) | (j2me) | (java) | (midp) | (mini) | (mmp) | (mobi) | (motorola) | (nec-) | (nokia) | (palm) | (panasonic) | (philips) | (phone) | (playbook) | (sagem) | (sharp) | (sie-) | (silk) | (smartphone) | (sony) | (symbian) | (t-mobile) | (telus) | (vodafone) | (wap) | (webos) | (wireless) | (xda) | (xoom) | (zte)/i);

 if(ismobile)
 {

// window.location = 'https://www.google.com.my';
 alert("You are using mobile");

 }
 else
 {

 // window.location = 'https://www.yahoo.com';
 alert("You are using system");


 }
</script>


Follow kvn_krishna on Twitter

Detect Browser in htaccess, User agent detection in htaccess

RewriteCond %{HTTP_USER_AGENT} ^.*iPhone.*$
RewriteRule ^(.*)$ http://mobiledomin.com [R=301]

Follow kvn_krishna on Twitter