Util: Folder Compare Tool


I have recently developed a python utility to compare files with same name stored in the root of two folders.

Few Usage of the tool:

  • Validating the dynamic reports before and after migration of database
  • Validating the text files between two servers after sync.
  • Validating the text files between two version of application.

The python scripts can be download from http://sourceforge.net/projects/pyfoldercompare/

App-V 5.x Interview Questions.


What is the use of Package Accelerator
App-V Package Accelerators enable application packaging easily and automatically without monitoring the application installation while following a step-by-step recipe.
What does Package Accelerator contains
It contains the following types of files

·         DeploymentConfig and UserConfig XML files.

·         Manifest file

·         Any files created by the app at time of sequencing containing customizations etc. that are not provided by the installation files

·         Files necessary for the virtual environment and streaming optimization

What type of installation files not supported by App-V Package Accelerator
Self extracting executable installation files are not supported.
Can powershell be used to create the Package Accelerator
yes
Can powershell be used to create the App-V Package using Package Accelerator
yes, Powershell needs to run in elevated privilege.
How App-V Package Converter works
It is a powershell script

— Work in Progress —

TIPS: IE Cleanup


Delete ALL:  RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255

Delete History:  RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 1

Delete Cookies:  RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 2

Delete Form Data:  RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 16

Delete Passwords:  RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 32

Delete Temporary Internet Files:   RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

Delete Files and Settings Stored by addons:  RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 4351

Memory Game: JQUERY


<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
        Remove this if you use the .htaccess -->
        
        <meta http-equiv="pragma" content="no-cache" />
        <title>Memory Test</title>
        <meta name="description" content="" />
        <meta name="author" content="Mayank Johri" />

        <meta name="viewport" content="width=device-width; initial-scale=1.0" />

        <!-- Replace favicon.ico & apple-touch-icon.png in the root of your domain and delete these references -->
        <link rel="shortcut icon" href="/favicon.ico" />
        <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
        <style>
            #quest{
                width: 24em;
                height:24em;
                margin-left:auto;
                margin-right:auto;
                border: 1px solid #1E90FF;
            }
            .mango{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/mango.svg) ;
                background-size: 4em 4em;                
            }
            .orange{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/Orange_Icon.svg) ;
                background-size: 4em 4em;                
            }
            .grapes{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/grape_red.svg) ;
                background-size: 4em 4em;                
            }
            .freshorange2{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/freshorange2.svg) ;
                background-size: 4em 4em;                
            }
            .Peach{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/Peach.svg) ;
                background-size: 4em 4em;                
            }
            .passion{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/passion.svg) ;
                background-size: 4em 4em;                
            }
            .watermelon{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/watermelon.svg) ;
                background-size: 4em 4em;                
            }
            .apple{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/Red_Apple.svg) ;
                background-size: 4em 4em;                
            }
            .pineapple{
                height: 4em;
                width: 4em;
                margin: 1em;
                float: left;
                background: url(imgs/Pineapple.svg) ;
                background-size: 4em 4em;                
            }
            .box{
                /*background-color: #0000FF;*/                
                height: 4em;
                width: 4em;
            }
            .blank{
                background-color: #FF9933;
                
                height: 4em;
                width: 4em;
            }
        </style>
    </head>

    <body>
        <div style="text-align: center;">
            <header>
                <h1>Memory Game</h1>
            </header>
            <div id="quest">

            </div>
            <div style="clear: both;" style="text-color: blue" >Click Count: <span id="count">0</span> | Items Left: <snap id="left">16</span> </div>
            <footer>
                <p>
                    &copy; Copyright  by Mayank Johri
                </p>
            </footer>
        </div>
        

        <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
        <script>
            count = 0;
            Array.prototype.shuffle = function () {
                for (var i = this.length - 1; i > 0; i--) {
                    var j = Math.floor(Math.random() * (i + 1));
                    var tmp = this[i];
                    this[i] = this[j];
                    this[j] = tmp;
                }
            
                return this;
            }
            
            $().ready(function(){
                count = 0;
                objs = new Array("orange", "apple", "grapes", "freshorange2", "Peach","mango", "passion", "watermelon",
                             "orange", "apple", "grapes", "freshorange2", "Peach","mango", "passion", "watermelon")
                objs.shuffle();
                for (var index = 0; index < objs.length; ++index) {
                    $("#quest").append(
                        "<div class='" + objs[index] + "'> \
                        <div class='blank'>    </div>"
                    )
                }
                $("#quest>div").on("click", function(){
                    count++;
                    $("#count").text(count);
                    $(this).find(">div").toggleClass("blank box");
                    if($("#quest>div>.box").length == 2){
                        var other = $("#quest>div>.box").parent().not($(this)).attr("class");
                        if($(this).hasClass(other)){
                            $("#quest>div>.box").parent().css({"visibility":"hidden"});
                            $("#quest>div>.box").toggleClass("blank box");
                        }else{                        
                            $("#quest>div>.box").toggleClass("blank box");                
                        }
                    }else{
                    }
                })                
            })
        
        </script>
    </body>
</html>

TIPS: WMI: VBScript: Start a process with different priority


dim intProcessID
Const HIGH = 128
strComputer = “.”

Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2:Win32_Process”)
Set objStartup = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2:Win32_ProcessStartup”)
objStartup.PriorityClass = HIGH          !!!!! ‘ Here you can define the priority of the process. !!!!!!
Set objConfig = objStartup.SpawnInstance_
objWMIService.Create( sCommand, sWorkingDir, objConfig, intProcessID)

JQuery: Sample: simple Jigsaw Puzzle


<!DOCTYPE html>
<html>
<head>
<title>test</title>
<style>
div {
display: block;
width: 100px;
height: 100px;
/*background-color: orange;*/
border: 1px solid orange;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
float: left;
}
#countdown{
display:block;

width: 5em;
height: 2em;
margin-right: auto; margin-left: auto;
text-align: center;

}
</style>

</head>
<body>
<div style=”width: 100%; height: 420px;”>

<div style=”width: 410px; height: 410px; background: url(us3.JPG);” >
<div style=”background:url(us3.JPG); background-position: -200px -100px ;”></div>
<div style=”background: url(us3.JPG); background-position: -100px 0 ;”></div>
<div style=”background: url(us3.JPG); background-position: 0 -300px ;”></div>
<div style=”background: url(us3.JPG); background-position: -100px -200px ;”></div>
<div style=”background: url(us3.JPG); background-position: 0 -100px ;”></div>
<div style=”background: url(us3.JPG); background-position: -100px -300px ;”></div>
<div style=”background: url(us3.JPG); background-position: -200px 0 ;”></div>
<div style=”background: url(us3.JPG); background-position: -300px -200px ;”></div>
<div style=”background: url(us3.JPG); background-position: 0 0 ;”></div>
<div style=”background: url(us3.JPG); background-position: -200px -200px ;”></div>
<div style=”background: url(us3.JPG); background-position: -300px -100px ;”></div>
<div style=”background: url(us3.JPG); background-position: -100px -100px ;”></div>
<div style=”background: url(us3.JPG); background-position: -200px -300px ;”></div>
<div style=”background: url(us3.JPG); background-position: -300px 0 ;”></div>
<div style=”background: url(us3.JPG); background-position: 0 -200px ;”></div>
<div style=”background: url(us3.JPG); background-position: -300px -300px ;”></div>
</div>

<div style=”width: 410px; height: 410px; align:center; float: right;”>
<p>
Arrange the blocks in this block
</p>
</div>
</div>

<div id=”countdown” style=”left: 50%; “> </div>

<button style=”width: 10em”>start</button>

<script src=”js/jquery-1.9.1.min.js” ></script>
<script src=”js/jquery-ui.min.js”></script>
<script>
var select = false;
var count = 120;
$().ready(function(){
$(“.block”).hide();
})
$(“button”).click(function(){
$(“.block”).show();
setInterval(function(){
count = count -1;
$(“#countdown”).text(count);
}, 1000);
});
$(“.block”).mousedown(function(e) {
var element = this;
var x= e.pageX – this.offsetLeft;
var y = e.pageY – this.offsetTop;
if (select == false){
select = true;
$(window).bind(“mousemove”, function(e1){
$(element).css({
“position” : “absolute”
});
$(window).css({
“-webkit-user-select” : “none”
});
$(element).css({
“left” : (e1.pageX – x) + “px”
});
$(element).css({
“top” : (e1.pageY – y) + “px”
});

})
}else{
$(window).unbind(‘mousemove’);
select = false;
}
});
</script>
</body>
</html>