~ Mayank Johri's Tips ~

January 25, 2012

Windows: How to find if your windows is 32 bit or 64 bit from command line?

Filed under: Uncategorized — Mayank Johri @ 6:25 am
Tags: ,

reg query “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v PROCESSOR_ARCHITECTURE

October 27, 2011

!!! Happy Deepawali !!!

Filed under: Uncategorized — Mayank Johri @ 4:54 am

Diwal greetings, wishes, animated pictures

Enjoy,
Mayank Johri

August 26, 2011

FAQ: Python: How to get a complete list of object’s methods and attributes?

Filed under: Uncategorized — Mayank Johri @ 9:08 am
Tags: ,

use ‘dir’ to get the details

August 24, 2011

FAQ: YUM: How to search which package has a particular file

Filed under: Uncategorized — Mayank Johri @ 6:12 am
Tags: , ,

yum whatprovides “*filename*”

May 31, 2011

Tips: FreeBasic: CopyFolder

Filed under: Uncategorized — Mayank Johri @ 11:10 am
Tags: , ,
#Include once "dir.bi"
#Include once "file.bi"
#Include Once "string.bi"
#include once "ext/strings/strsplit.bi"
#Include Once "win/shlobj.bi"

sub copyfolder(dirName as string, dstdir as string)
    const attrib_mask = fbDirectory  or fbNormal Or fbHidden Or fbSystem or fbReadOnly or fbArchive
    dim as uinteger out_attr
    dim fileName as string
    dim absname as String
    
    fileName = Dir(dirName + "\*", attrib_mask, out_attr)
    print "fileName >>>> " + fileName
    Do Until Len(fileName) = 0 '' loop until Dir returns empty string
        If (fileName <> ".") And (fileName <> "..") Then '' ignore current and parent directory entries
     
            absName = dirName & "\" & fileName
            '
            If out_attr And fbDirectory Then
                dim d as string
                d = right(absName,Len(absName) - InStrRev(absName, "\"))
                Print "d = " + d        
                Print "absName =" + absName                
                dstDir = dstDir + "\" + d
                Print "DST = " + dstdir
                
                SHCreateDirectoryEx(0,StrPtr(dstDir),0)
                copyfolder(absName, dstDir )
            Else
                dim d as String
                d = right(absName,Len(absName) - InStrRev(absName, "\"))
                SHCreateDirectoryEx(0,StrPtr(dstDir),0)
                FileCopy(absName, dstdir + "\" + d)
                Print "file: " + absName + " DST: " + dstDir
            End If
        End If
      fileName = Dir(out_attr)
    Loop
end sub

April 13, 2011

Code: Freebasic: runas

Filed under: freebasic — Mayank Johri @ 4:50 am
Tags: , , ,
#Include "windows.bi"
#inclib "advapi32"

Declare FUNCTION CreateProcessWithLogonW LIB "ADVAPI32" ALIAS "CreateProcessWithLogonW" ( _
        byval lpUsername As LPCWSTR  , _
        BYVAL lpDomain AS LPCWSTR , _
        BYVAL lpPassword AS LPCWSTR, _
        BYVAL dwLogonFlags AS DWORD, _
        BYVAL lpApplicationName AS LPCWSTR , _
        BYVAL lpCommandLine AS LPCWSTR , _
        BYVAL dwCreationFlags AS DWORD, _
        BYVAL lpEnvironment AS DWORD, _
        BYVAL lpCurrentDirectory AS LPCWSTR , _
        lpStartupInfo AS STARTUPINFO, _
        lpProcessInfo AS PROCESS_INFORMATION) AS LONG

Const X_CJ_LOGON_WITH_PROFILE=1
Const X_CJ_CREATE_DEFAULT_ERROR_MODE = &H04000000

FUNCTION RunAsUser(BYVAL UserName AS STRING, _
        BYVAL Password AS STRING, _
        BYVAL DomainName AS STRING, _
        BYVAL CommandLine AS STRING, _
        BYVAL CurrentDirectory AS STRING) AS boolean

        Dim si AS STARTUPINFO
        Dim pi AS PROCESS_INFORMATION
        Dim AS String wCurrentDir,wCommandLine,wPassword,wUser,wDomain
        Dim R01 AS LONG

        si.cb = LEN(si)
        wUser = UserName
        wDomain = DomainName
        wPassword = Password
        wCommandLine = CommandLine
        wCurrentDir = CurrentDirectory
        Print wCommandLine & "TEST"
        R01 = CreateProcessWithLogonW(wUser,wDomain,wPassword, _
                        X_CJ_LOGON_WITH_PROFILE, 0&, wCommandLine, _
                        X_CJ_CREATE_DEFAULT_ERROR_MODE, 0&, wCurrentDir, si, pi)
        IF R01  0 THEN
                CloseHandle pi.hThread
                CloseHandle pi.hProcess
                Return TRUE
        ELSE
                Return FALSE
        END If
End FUNCTION

Dim As Long R01
Dim As String  user_name,password,domain,program,workingDir

user_name="username"
password="pa$$word"
domain="domain"
program="C:\\windows\\notepad.exe"
workingDir="C:\\windows"

R01=RunAsUser(user_name,password,domain,program,workingDir)

March 22, 2011

Compile juce dll using code::block and mingw.

Filed under: Uncategorized — Mayank Johri @ 6:36 am
  1. Import solution from “Build\VisualStudio2008_DLL”
  2. add liboleaut32; libshell32.a; libole32.a; libvfw32.a; libwinmm.a; libwininet.a;libws2_32.a; libdsound.a; libwsock32.a; libwldap32.a; libkernel32; libopengl32.a; libglu32.a; libuuid.a; librpcrt4.a; libgdi32.a; libcomdlg32.a; libversion.a; libdsound.a; libshlwapi.a  in library.
  3. add  “#ifndef _WIN32_WINNT
    #define _WIN32_WINNT 0×0501
    #endif” when you get “error: ‘getaddrinfo’ was not declared in this scope“  error while compiling.
  4. Set -mach=i586 in compilation option.
libwininet.a
libdsound.a
libole32.a
libwinmm.a
libgdi32.a
libuuid.a
libshell32.a
libvfw32.a
librpcrt4.a

March 2, 2011

Bug: Zune: File fails to sync with Zune

Filed under: Uncategorized — Mayank Johri @ 5:40 am

When I first got zune for myself, I was very happy that for only $90 I am getting 30GB Zune, but in few days only i found that it is not for persons like me, who like freedom and simplicity.

Anyway one of the biggest problem I found was that Zune can not be sync’ed on Linux because Microsoft forgot that there might be people (like me) who might not have Windows as Operating System.

February 24, 2011

FAQ: RUBY: Error: can not set user with registry or opaque

Filed under: FAQ's — Mayank Johri @ 5:52 am
ERROR:  While executing gem ... (URI::InvalidURIError)
 can not set user with registry or opaque

If you see the following error then check that your proxy should have protocol set properly, such as http://, ftp:// etc.

ie http_proxy=http://proxy.server.com:8080

February 5, 2011

Enjoy: Makemytrip sending people to past

Filed under: Enjoy — Mayank Johri @ 1:15 pm
Tags:

Try the following.

  1. Launch makemytrip.com, select origin as “Bangalore” and destination as “Cochin” and search
  2. Check the flight by goair which starts at 23:55 hrs and reaches destination at 00:55 hours. and makemytrip.com predicts that total time taken is -23:00 hrs :)

     

    February 2, 2011

    RPM Interview Questions

    Filed under: FAQ's,Linux,Packaging — Mayank Johri @ 5:37 am
    Tags: , ,

    Q: How to install packages with all the dependency packages if all the packages are available at a common repository?
    Ans : rpm –ivh  –aid packagename.

    Q: How to check, where a particular package installed it’s configuration files.
    Ans : rpm –qc packagename.

    Q: How to check the change log of the installed package.
    Ans : rpm -q –changelog packagename.

    Q: How to check, where a particular package installed it’s doc files.
    Ans : rpm -qd packagenme

    Q: How to check all the files installed by package?
    Ans : rpm -q –filesbypkg packagename

    Q: How to check the version of files installed by a package
    Ans : rpm -qi packagename

    Q: How to check the dependencies for a particular packages i.e. Required libraries packages etc.
    Ans : rpm -q -R packagename.

    Q: How to upgrade the packages which are already installed on to the linux box.
    Ans : rpm -F install options packagename.

    Q: What is the command to update only the rpm database.
    Ans : rpm -i –justdb packagename

    Q: What is the command to check whether a particular package installation would be successful but would not actually install the package.
    Ans : rpm -ivh –test packagename

    Q: How to check that a particular file belong to which package
    Ans : rpm -qf filename

    Q: How to list files in  a package
    Ans : rpm -ql packagename

    Q: How to verify whether the files installed by package are intact or been tampered/corrupted.
    Ans : rpm -qs packagename

    Q: What is the command to create a new RPM Database
    Ans : rpm –initdb

    Q: What is the command to rebuild the RPM Database
    Ans : rpm –rebuilddb

    November 30, 2010

    New MSI Interview Questions.

    Filed under: MSI,Windows — Mayank Johri @ 8:48 am
    Tags: , ,
    1. How to add font files in an MSI package without using Wise Package Studio’s File Display Section.
    2. Difference between deferred & immediate custom action.
    3. What will you do if you can’t solve a issue in a package.
    4. How to add shortcuts to startup folder.
    5. Which applications should not be repackaged in MSI
    6. Which & why files are stored in C:\Windows\Installer
    7. What are the differences between patching, update & upgrade
    8. How to view to installation log files, which third party tools can be used for this task.
    9. Where can I find the schema of MSI file.
    10. How will you get the table details by using MSI SDK but not using ORCA.
    11. How can Network Shortcuts be added in an MSI Package.
    12. How to install certifications using MSI
    13. What are the advantages of admin install
    14. What condition on CA will allow to “Install” and “repair” but not at “uninstall”
    15. How to create nested MSI Installation
    16. How to create MST file from two MSI files.
    17. How to ensure that MSI gets installed only on WinXPSP3, win 7 and IE 8

    November 27, 2010

    Hindi Version of Free Softwares

    Filed under: Uncategorized — Mayank Johri @ 3:34 am
    Tags: ,

    The C-DAC has derived few Open source software’s, they can be downloaded from http://www.ildc.in/Hindi/hdownloadhindi.html. They have also for various other Hindi Languages.

    November 15, 2010

    TIPS: BatchFile : Directory Path of an executing Batch file

    Filed under: FAQ's,Tips — Mayank Johri @ 10:52 am
    Tags: ,
    %~dp0 will be the directory path of the executable batch file.
    

    October 12, 2010

    Restarted working on mayaDeploy

    I have restarted the coding of mayadeploy, a Full Package Management Solution for Small Business, It will be re-coded in Python & G++, using WX as GUI library.

    Few silent features are as follows,

    1. Based on Server & Client architecture
    2. Using this managers will be able to deploy packages on to his reportee’s computer without any human intervention. (Only for App-V Packages for now)
    3. Will support following file types for deployment:- msi, exe, batch files, App-V Packages
    4. Ver: 2 will support even hardware & software reporting
    5. Will have entire Software Life cycle support.
      1. New Software request or Existing Software request
      2. Integration, packaging, UAT and Deployment lifecycle integrated.

    as always i am requesting yours comments and suggestions to make it a success.

    October 1, 2010

    Alpha 1 Version of App-V Interview Questions

    Dear All,

    My first try to consolidate all the app-v interview questions. http://sourceforge.net/projects/softgridhelper/files/Documentations/AppV%20Interview%20Questions_Ver_0.0.1Alpha1.pdf/download

    As always your comments and suggestions are most welcome.

    Enjoy,

    Mayank Johri

    September 28, 2010

    updated MSI Questions. Ver.: Alpha 4

    Filed under: Installation,MSI,Windows — Mayank Johri @ 5:44 am

    Hello all,

    I have updated the MSI Interview Questions, the updated document can be downloaded from http://sourceforge.net/projects/mayadeploy/files/FAQ/FAQ%20on%20MSI%20packaging%20and%20repackaging_0.0_1Beta4.pdf/download.

    Enjoy solving the last 3 questions.

    As always the questions & answers might be wrong.

    :) so please correct me if that is the case :) .

    Enjoy,

    Mayank Johri

    August 8, 2010

    FAQ: Valid OS Tag Values in an OSD File.

    Target OS OSD Tag Value Minimal AppV Client
    Windows NT VALUE=”WinNT”/> 4.1
    Windows 2000 VALUE=”Win2K”/> 4.1
    Windows 2000 Server VALUE=”Win2KSvr”/> 4.1
    Windows 2000 Terminal Server VALUE=”Win2KTS”/> 4.1
    Windows XP VALUE=”WinXP”/> 4.1
    Windows XP x64 VALUE=”WinXP64″/> 4.6 x64
    Windows Server 2003 VALUE=”Win2003Svr”/> 4.1
    Windows Server 2003 Terminal Server VALUE=”Win2003TS”/> 4.1
    Windows 2003 Terminal Server x64 VALUE=”Win2003TS64″/> 4.6 x64
    Windows Vista VALUE=”WinVista”/> 4.2
    Windows Vista x64 VALUE=”WinVista64″/> 4.6 x64
    Windows 2008 Terminal Server VALUE=”Win2008TS”/> 4.5
    Windows 2008 Terminal Server x64 VALUE=”Win2008TS64″/> 4.6 x64
    Windows 7 VALUE=”Win7″/> 4.5 sp1
    Windows 7 x64 VALUE=”Win764″/> 4.6 x64
    Windows 2008 R2 Terminal Server x64 VALUE=”Win2008R2TS64″/> 4.6 x64

    July 25, 2010

    FUN: Greatest Discount: REAL

    Filed under: Uncategorized — Mayank Johri @ 1:59 pm

    Few years back I went to Toys R US and found the discount and took the snap. Now I am sharing it with everyone.

    The Great Saving at Toys"R"Us

    July 24, 2010

    FAQ: MSI Interview

    Filed under: FAQ's,MSI — Mayank Johri @ 11:32 pm
    Tags: , , ,

    I am posting the first draft of FAQ of MSI packaging & repackaging. It can be downloaded from here or here.

    Download the latest from http://sourceforge.net/projects/mayadeploy/files/FAQ/

    Next Page »

    Theme: Rubric. Blog at WordPress.com.

    Follow

    Get every new post delivered to your Inbox.