Pages

30/11/2013

Access NAT and Network configuration tool in VmWare Player

The NAT and Network configuration tool available for Windows users in VmWare Workstation used to be available for VmWare Player users too but since release 6, it's become a little harder to get.

All you need are two files: vmnetcfg.exe and vmnetcfglib.dll. You can find them both in a typical Workstation installer (the free trial version too), by running this command against the installer:

VMWare-worksation-INSTALLER_NAME.exe /e .\unpack

now just browse to the newly created unpack folder and rename _vmnetcfglib.dll without the leading underscore, then copy both in your Player installation directory.

22/11/2013

[Oracle] 12c install error INS-30131

While trying to install Oracle 12c on Windows, in the very first steps, you may encounter an INS 30131 error saying:

[INS-30131] Initial setup required for the execution of installer validations failed. Cause: Failed to access the temporary location

This may happen because upon installation, Oracle's trying to access the C drive as a network share but fails to do so. To fix it, make sure you can actually access the C$ share on your machine.

[Windows] Cannot access hidden C admin share

If you get an error while trying to access the Windows hidden C share (C$):

net use \\localhost\c$
System error 53 has occurred.

The network path was not found.

You may find the following articles useful: KB254210 and KB951016.

A simple thing is just to make sure your TCP/IP NetBIOS Helper and Server services are running (Start-Run, services.msc) and try again:

net use \\localhost\c$
The command completed successfully.

Of course, your user must be either an administrator or be part of the administrator group.

If it still fails, manually edit the registry (Start-Run, regedit). Browse to:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System 

and create a new DWORD value LocalAccountTokenFilterPolicy set to 1

08/11/2013

[Java] Hexadecimal to Binary

To convert a String representation of an hex to its binary String representation in Java:

 static String[]hex={"0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"};  
 static String[]binary={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"};  
   
 public static String hex2Binary(String hexStr){  
      String bin="";  
      for(int i=0;i<hexStr.length();i++){  
           String temp = String.valueOf(hexStr.charAt(i));  
           for(int j=0;j<hex.length;j++){  
                if(temp.equalsIgnoreCase(hex[j]))bin+=binary[j];  
           }  
      }  
      return bin;  
 }  

[Java] String to Hexadecimal and viceversa

To convert a String to its hex representation in Java, simply:

 public static String string2Hex(String str){  
         
       char[] chars = str.toCharArray();  
    
       StringBuffer hex = new StringBuffer();  
       for(int i = 0; i < chars.length; i++){  
           hex.append(Integer.toHexString((int)chars[i]));  
       }  
    
       return hex.toString();  
  }  
   


and in the other direction:

 public static String hex2String(String hex){  
         
       StringBuilder sb = new StringBuilder();  
         
       /*two hex characters for each ASCII one*/  
       for( int i=0; i<hex.length()-1; i+=2 ){  
    
            String output = hex.substring(i, (i + 2));  
            int decimal = Integer.parseInt(output, 16);  
            sb.append((char)decimal);  
       }  
    
       return sb.toString();  
  }