~ Mayank Johri’s Tips ~

November 6, 2009

More App-V Interview Questions

  1. Why the Flag files in OSD Scripts should be saved in Virtual File System instead of Physical System
  2. How to create default.sprj file.

November 4, 2009

FAQ: Ruby GEM error: ERROR: While executing gem … (URI::InvalidURIError)

Filed under: Uncategorized — mayankjohri @ 11:27 am
Tags: , ,

set the http_proxy system variable as
set http_proxy=http://proxy.mj.com:8080
instead of
set http_proxy=proxy.mj.com:8080

October 27, 2009

App-V Interview Questions

  1. What is App-V Sequencing
  2. What is VFS Sequenging
  3. What is MNT Sequencing
  4. What is SystemGuard
  5. What are the protocols supported for streamming
  6. What is active upgrade
  7. Which applications can be sequenced.
  8. How to manage exclusion list
  9. Can network shortcut applications be sequenced
  10. Can host files be sequenced
  11. Define the normal upgrade process
  12. What precausions are needed while sequencing
  13. How reboots are handled while sequencing
  14. Can all types of services be sequenced
  15. Why application is launched more then once while sequencing.
  16. How much disk space is required on sequencing machine
  17. Which hardware component be updated to get better performance in sequencing process.
  18. What is a suite and how we can create them
  19. What is the difference between update and active upgrade
  20. What is the difference between suite and dynamic suite
  21. Why only Q drive is necessary for sequncing can we have any other also.
  22. Name few disadvantages of using SCCM server for deploying App-V Applications
  23. Name few advantages of using SCCM server for deploying App-V Applications

October 15, 2009

Convert Virtualbox vdi to VMware vmdk Files

Filed under: Tips — mayankjohri @ 10:57 am
Tags: ,

QEMU-IMG can be used to convert virtualbox vdi file to vmware vmdk file

qemu-img.exe convert -O vmdk virtualbox.vdi vmware.vmdk

October 13, 2009

Demo Calender in wx.python

Filed under: Python — mayankjohri @ 12:47 pm

This is my wx.Calender demo in wx.python

###########################################################################
# -*- coding: ISO-8859-1 -*-
## This program is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of the License, or
## (at your option) any later version.
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
## You should have received a copy of the GNU General Public License
## along with this program.  If not, see <http://www.gnu.org/licenses>.
__author__ = "Mayank Johri"
__copyright__  = "2009"
__version__ = "0.0.1"
__date__ = "Oct 13 2009"
__license__ = "GNU 3 or latest."
###########################################################################
import re
import datetime
import calendar
import wx
import string
import wx.calendar as cal
import sys
import os
APPDIR = sys.path[0]
TBMENU_RESTORE = wx.NewId()
TBMENU_CLOSE   = wx.NewId()
year = ['January',
     'February',
     'March',
     'April',
     'May',
     'June',
     'July',
     'August',
     'September',
     'October',
     'November',
     'December']
def thismonth():
    """ Presently not using"""
    calendar.setfirstweekday(0)
    today = datetime.datetime.date(datetime.datetime.now())
    current = re.split('-', str(today))
    current_no = int(current[1])
    current_month = year[current_no-1]
    current_day = int(re.sub('\A0', '', current[2]))
    current_yr = int(current[0])
    myCal = '%s %s' %(current_month, current_yr)
    myCal = myCal + '\n' + "M  T  W  Th F  Sa Su" + '\n'
    month = calendar.monthcalendar(current_yr, current_no)
    nweeks = len(month)
    for w in range(0,nweeks):
        week = month[w]
        for x in xrange(0,7):
            day = week[x]
            if x == 5 or x == 6:
                classtype = 'weekend'
            else:
                classtype = 'day'
            if day == 0:
                classtype = 'X'
                myCal = myCal + str(classtype).ljust(3)
            elif day == current_day:
                myCal = myCal + str(day).ljust(3)
            else:
                myCal = myCal + str(day).ljust(3)
        myCal = myCal + '\n'
    return (myCal)
class MyTaskBarIcon(wx.TaskBarIcon):
    def __init__(self, frame):
        wx.TaskBarIcon.__init__(self)
        self.frame = frame
        icon = wx.Icon(os.path.join(APPDIR, 'clock.ico'), wx.BITMAP_TYPE_ICO)
        self.SetIcon(icon)
        self.Bind(wx.EVT_TASKBAR_LEFT_DCLICK, self.OnTaskBarRightClick)
        self.Bind(wx.EVT_MENU, self.OnTaskBarActivate, id=1)
        self.Bind(wx.EVT_MENU, self.OnTaskBarClose, id=2)
    def OnTaskBarRightClick(self, event):
        if not self.frame.IsShown():
            self.frame.Show()
        else: self.frame.Hide()
    def CreatePopupMenu(self):
        menu = wx.Menu()
        menu.Append(1, 'Show/Hide')
        menu.Append(2, 'Close')
        return menu
    def OnTaskBarClose(self, event):
        self.Destroy()
        self.frame.Destroy()

    def OnTaskBarActivate(self, event):
        if not self.frame.IsShown():
            self.frame.Show()
        else: self.frame.Hide()
    def OnTaskBarDeactivate(self, event):
        if self.frame.IsShown():
            self.frame.Hide()
class MayaCalendar(wx.Dialog):
    def __init__(self, parent, id, title):
        wx.Dialog.__init__(self, parent, title="Maya Calender, Ver: 0.0.1")
        vbox = wx.BoxSizer(wx.VERTICAL)
        calend = cal.CalendarCtrl(self, -1, wx.DateTime_Now(),
            style = cal.CAL_SHOW_HOLIDAYS|cal.CAL_SEQUENTIAL_MONTH_SELECTION)
        vbox.Add(calend, 0, wx.EXPAND | wx.ALL, 20)
        self.Bind(cal.EVT_CALENDAR, self.OnCalSelected, id=calend.GetId())
        self.SetSizerAndFit(vbox)
        self.Show(True)
        self.tskic = MyTaskBarIcon(self)
        self.Centre()
    def OnCalSelected(self, event):
        date = event.GetDate()
        dt = string.split(str(date), ' ')
        s = ' '.join([str(s) for s in dt])
        self.text.SetLabel(s)
class MyApp(wx.App):
    def OnInit(self):
        frame = MayaCalendar(None, -1, 'Maya Calender, Ver: 0.0.1')
        frame.Show(True)
        self.SetTopWindow(frame)
        return True
app = MyApp(0)
app.MainLoop()

October 12, 2009

demo code for wx.TaskBarIcon

Filed under: Python, Tips — mayankjohri @ 3:08 pm
Tags:

Below is the demo code for wx.TaskBarIcon,

import wx
class sysTrayDemo(wx.Frame):
    def __init__(self, parent, id, title):
        pass
        wx.Frame.__init__(self, parent, -1, title, size = (800, 600),
                         style=wx.DEFAULT_FRAME_STYLE|wx.NO_FULL_REPAINT_ON_RESIZE)
        # FIXME: substitute your icon file here.
        icon = wx.Icon('systray.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(icon)
        if wx.Platform == '__WXMSW__':
            # setup a taskbar icon, and catch some events from it
            self.tbicon = wx.TaskBarIcon()
            self.tbicon.SetIcon(icon, "SysTray Demo")
            wx.EVT_TASKBAR_LEFT_DCLICK(self.tbicon, self.OnTaskBarActivate)
            wx.EVT_TASKBAR_RIGHT_UP(self.tbicon, self.OnTaskBarMenu)
            wx.EVT_MENU(self.tbicon, self.TBMENU_RESTORE, self.OnTaskBarActivate)
            wx.EVT_MENU(self.tbicon, self.TBMENU_CLOSE, self.OnTaskBarClose)
        wx.EVT_ICONIZE(self, self.OnIconify)
        return
    def OnIconify(self, evt):
        self.Hide()
        return
    def OnTaskBarActivate(self, evt):
        if self.IsIconized():
            self.Iconize(False)
        if not self.IsShown():
            self.Show(True)
        self.Raise()
        return
    def OnCloseWindow(self, event):
        if hasattr(self, "tbicon"):
            del self.tbicon
        self.Destroy()
    TBMENU_RESTORE = 1000
    TBMENU_CLOSE   = 1001
    def OnTaskBarMenu(self, evt):
        menu = wx.Menu()
        menu.Append(self.TBMENU_RESTORE, "Restore SysTray Demo")
        menu.Append(self.TBMENU_CLOSE,   "Close")
        self.tbicon.PopupMenu(menu)
        menu.Destroy()
    #---------------------------------------------
    def OnTaskBarClose(self, evt):
        self.Close()
        # because of the way wx.TaskBarIcon.PopupMenu is implemented we have to
        # prod the main idle handler a bit to get the window to actually close
        wx.GetApp().ProcessIdle()
class MyApp(wx.App):
    def OnInit(self):
        self.redirect=True
        frame = sysTrayDemo(None, -1, "SysTray Demo")
        frame.Show(True)
        return True
def main():
    app = MyApp()
    app.MainLoop()
if __name__ == '__main__':
    main()

Sequencing Project 2003 Issue

Filed under: Application Virtualization — mayankjohri @ 11:31 am
Tags: ,

Add the “%appdata%\Microsoft\MS project\” to exclusion list to avoid error while streaming

October 9, 2009

MSI Interview Questions

Filed under: MSI — mayankjohri @ 1:59 pm
Tags: ,
  1. Explain the difference between Property and PROPERTY
  2. Describe the process flow of an installation in terms of the User Interface, Immediate and Deferred sequences
  3. What are the ADDLOCAL and ADDSOURCE properties?
  4. What is the difference between installations using ALLUSERS=””, ALLUSERS=1 and ALLUSERS=2 option?
  5. Advertised vs non-advertised shortcuts, what’s the difference?
  6. Maximum how many files you can add in msi?
  7. ProductCode, PackageCode, UpgradeCode, Explain them
  8. Explain Backend mechanism of Self repair
  9. Suppose you’re in an environment where you can’t use advertisement, explain how you would go about setting userspecific settings
  10. What is the impact of leaving COM information in a generic registry component as apposed to in each relevant component
  11. How many sequences are there in an MSI
  12. Please sketch the entire process of creating a package, from the software request up to package delivery
  13. How many different sequance tables are there in an MSI
  14. Difference between dll/ocx and exe registraction
  15. How we can make two applications with same GUID to install on the same machine?
  16. How we create the small,minor and major upgrade?
  17. what is the disadvantage of using lock permissions table
  18. What are secure custom properties
  19. What is the difference between Repair and Self healing?
  20. What is entry point for MSI?
  21. What should be the condition of a custom action if we want to run it during installation and uninstallation ?
  22. Difference between Run, Run Once, Active Setup
  23. Use of INSTALLLEVEL Property
  24. Self-Heal (advertised shortcut) Vs Install on Demand (product Advertising)
  25. Self-Heal Vs Repair
  26. Per-user installation Vs Per-machine installation
  27. The reason why during a repair, bringing back missing files to System Folders is possible for a standard user who actually does not have a write permission to these folders.
  28. What are your thoughts and experiences for patching .msi files? What approaches have worked the best? What hasn’t worked? Why?
  29. Describe a methodology for populating the user’s profile with Windows Installer functionality. That one was funny because the interviewer was looking for Active Setup which I didn’t consider to be specific to Windows Installer.
  30. How do you configure an installation for an application that requires administrative privileges to work if the end user is not a local machine administrator?
  31. Have you ever had to modify a .msi directly without a graphic interface? Which tables did you modify and why?
  32. Describe the most difficult project you have worked on. What was the problem? How did you solve it? What did you learn?
  33. What tools are in your “packaging toolkit?”
  34. Have you had to edit permissions?
  35. How would you change permissions on files and registry entries?
  36. What are the differences between the lock permissions table and external tools for editing?
  37. How would you populate components from a machine-based installation to a user profile?
  38. What tools do you regularly use asides from your primary tool (WPS or IS or etc…) in the process of creating a package?
  39. An example of a condition you would use, and what it would be useful for.
  40. If you were to receive a vendor MSI, how would you repackage it to comply with company standards?
  41. Do you recommed modifying vendor MSIs? Why/why not?
  42. What are the advantages of using MSIs?
  43. Explain to me what self healing is and how you can leverage it for user specific files/registries
  44. Besides self-healing, what other options do you have for creating user specific files/registries and under what scenarios would you use those?
  45. How would you troubleshoot an application that does not run on a locked down environment but does run as administrator?
  46. When would you use Setup Capture and what kind of clean up would you performed on a captured MSI?
  47. Have you created merge modules? Why?
  48. What is the purpose of Validation and how do you handle ICE errors on vendor MSIs?
  49. Walk me through the entire packaging process from request to deployment you’ve been exposed to in previous roles.

October 6, 2009

Howto: Delete Rows in wx.Grid

Filed under: Python — mayankjohri @ 3:19 am
Tags: , ,
def fm_bDeleteServerDetails(self, event):
lst = self.m_gdServerDetails.GetNumberRows()
selected = []
for r in range(lst):
if self.m_gdServerDetails.IsInSelection(r, 0) == True:
selected.append(r)
selected.reverse()
for r in selected:
self.m_gdServerDetails.DeleteRows(r,1)
	def fm_bDeleteServerDetails(self, event):
		lst = self.m_gdServerDetails.GetNumberRows()
		selected = []
		for r in range(lst):
			if self.m_gdServerDetails.IsInSelection(r, 0) == True:
				selected.append(r)
		selected.reverse()
		for r in selected:
			self.m_gdServerDetails.DeleteRows(r,1)

September 30, 2009

processTame

Filed under: Uncategorized — mayankjohri @ 2:47 pm
Tags:
import os
import sys
import win32process
import win32api
import subprocess
import win32con
def setpriority(pid=None,priority=1):
	priorityclasses = [win32process.IDLE_PRIORITY_CLASS,
	win32process.BELOW_NORMAL_PRIORITY_CLASS,
	win32process.NORMAL_PRIORITY_CLASS,
	win32process.ABOVE_NORMAL_PRIORITY_CLASS,
	win32process.HIGH_PRIORITY_CLASS,
	win32process.REALTIME_PRIORITY_CLASS]
	if pid == None:
	        pid = win32api.GetCurrentProcessId()
        handle = win32api.OpenProcess(win32con.PROCESS_ALL_ACCESS, True, pid)
        win32process.SetPriorityClass(handle, priorityclasses[priority])
if (len(sys.argv) == 0):
    print("usage: processtame.exe ")
else:
    if (os.path.exists(sys.argv[1])):
    app = subprocess.Popen(sys.argv[1])
    pid = app.pid
    setpriority(pid, 0)
    app.wait()

September 10, 2009

Searching Machine & User in OU

Filed under: Uncategorized — mayankjohri @ 1:05 pm
Tags: ,

users: dsquery user -name “username”
Computers: dsquery computer -name “computername”

August 7, 2009

MultiBoot WinXP and Linux using Grub.

Filed under: Uncategorized — mayankjohri @ 2:48 am
Tags: ,

If winxp is installed on second drive and linux is installed on first drive then add/update the following entries in the /boot/grup/menu.lst file

title Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader +1

February 2, 2009

Bug: PCLinuxOS 2007: LiveCD fails to boot on System’s with SATA Harddrive

Filed under: Linux — mayankjohri @ 7:48 pm

Error:

LiveCD fails to boot with the following error:

Searching for the loop image [DONE]

ERROR: Unable to mount the livecd
Dropping you to a limited shell
…………….

Resolution

Add the following word on grub menu

all-generic-ide

January 16, 2009

SFTSequencer.com failes with “Installer failed in execution”

Resolution:
shutdown the windows update service.

December 16, 2008

FAQ: AppV : Can I stream application if it was sequenced on other OS

Filed under: FAQ's, Microsoft SoftGrid Application Virtualization — mayankjohri @ 5:44 pm
Tags: ,

Short Answer is Yes & No.

Long Answer: If the application was sequenced on WinXP and streamed on Vista then there is more chances for the application to work but reverse is not recommended.

December 14, 2008

TIPS: Python: How to convert python script to executable

Filed under: Development, Python — mayankjohri @ 12:15 am
Tags: ,

Python script can be converted in a standalone executable using one of the exe builder like
* py2exe (Windows)
* py2app (Mac OS)
* PyInstaller (all platforms)
* cx_Freeze (Windows and Linux)
* bbFreeze (Windows and Linux)

December 10, 2008

TIPS: Linux : Compress a directory

Filed under: Linux, Tips — mayankjohri @ 3:22 pm
Tags: ,

The following command can be used to compress entire directory in a file :

tar cjf <FileName>.tar.bz2 <DirectoryPath>

December 1, 2008

Tips: Convert flv to mpg or avi

Filed under: Tips — mayankjohri @ 12:36 am
Tags: ,

Following converts video.flv into video.mpg file:

CODE
ffmpeg -i video.flv -ab 56 -ar 22050 -b 500 -s 320x240 video.mpg

and following converts  video.flv into video.AVI with MP3 Audio:

CODE
ffmpeg -i I_test.flv -ab 56 -ar 22050 -b 500 -s 320x240 -vcodec xvid -acodec mp3 video.avi

November 11, 2008

TIPS: DELTREE in Windows XP

Filed under: Tips, Windows — mayankjohri @ 1:43 pm
Tags: ,

deltree can be simulated using the following .cmd file:

  1. Create an empty file deltree.cmd in %windir%\system32 folder
  2. Add the following content to the file, and save the file.

@echo off
del /S /F /Q %1
rd /S /Q %1

November 6, 2008

My Virtual Applications Repository

Filed under: Application Virtualization — mayankjohri @ 3:59 pm
Tags:

SVS Virtual packages for many OpenSource applications can be downloaded from

http://sourceforge.net/projects/appvrepo/

Next Page »

Blog at WordPress.com.