Access connected  Configured Scanners directly from web page (i.e. in web browser).  One can  capture, live crop and save images from a scanner to PC or to the configured remote server.

To view running application in your browser, Plug-in your Scanner,
Download webscanning.zip, comprises of ij.jar, plugin.jar, twain.jar, scanning.jar and webScanning.html, Extract all files to some folder and run webScanning.html.

Pre-requisites: JAVA Enabled browser, JRE Installed

webscanning.zip
File Size: 2090 kb
File Type: zip
Download File


Source Code:
I have published this as Open Source Project  to github to the following url:
https://github.com/ashishkataria/browserWebScanning

 
 
Access built-in webcams or connected USB webcams directly from a web page (i.e. in web browser).  One can  capture, live crop and save images from a live streaming  to his PC or to the configured remote server.

To view running application in your browser, Plug-in your webcam, just download File  webcamera.html given below and run it in your browser. It may take some time to download and load the webcam.jar in this case else for viewing it as offline:
Download webcam.zip, comprises of webcam.jar and webcam.html, Extract both files to some folder and run webcamera.html.

Pre-requisites: JAVA Enabled browser, JRE Installed
 
webcamera.html
File Size: 0 kb
File Type: html
Download File

webcam.jar
File Size: 7322 kb
File Type: jar
Download File

webcam.zip
File Size: 7313 kb
File Type: zip
Download File

Source Code:
I have published this as Open Source Project  to github to the following url:
https://github.com/ashishkataria/browserWebCamera

 
 
Yes, It's possible using Signed Java Applet, needs to be executed on Client machine.
I have embedded the applet on my login page, to fetch real IP (not VPN one) as well as MAC Addrees of Client (over vpn) whosoever  accesses  the login page.

Some forums on web, I came across claim  Java applets can access the original client IP address even when using proxy or vpn using:

java.net.InetAddress.getLocalHost().getHostAddress();

I tried above, but it didn't work for me. It's giving the Vpn IP Address, not the actual Client one. Hence, I thought of  fetching client ip by running ipconfig/all through the java applet.

Here the  problem is:
It lists so many IPv4 Addresses (Ethernet Adapters so many LAN's,  Network Adapter's) other than vpn ones. So It's not easy to decide which Client IP among all these has been pushing VPN Connection i.e. I mean Which Client Ip among all these has initiated the VPN Connection.

Thus, after a bit of  playing with DOS Network Commands, I found one:
route print
With this, I am able to successfully dig out the real client IP Address which has initiated the VPN Connection on Client's machine.
If you run route print command after connecting to VPN, the right first row of IPv4 Route Table metrics,  i.e the real  IP Address value under column named as  Interface which initiated  VPN .  

Here goes my Java Applet Code which fetches IP Address as well as MAC Address of Client user behind VPN, And Also sends over both Addresses  through javascript  to your JSP (Applet Embedded) Page.

import java.awt.Font;
import java.io.*;
import java.net.InetAddress;
import java.net.MalformedURLException;
import java.net.NetworkInterface;
import java.net.SocketException;
import java.net.URL;
import java.net.UnknownHostException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.util.Enumeration;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.swing.*;
import netscape.javascript.JSException;
import netscape.javascript.JSObject;


public class localfile extends JApplet
{
    public String[] array=new String[5];
    public String[] arrayips=new String[500];
    private KeyStore keystore;
    private String certiname="";
    private String sAlias="";
    JSObject window=null;
    public String myipaddress;
    public String mymacaddress;
    
    public String[] ipaddresses =new String[200];
    int i=0;
    
    public String[] macaddresses =new String[200];
    int j=0;
    
    public localfile()
    {
      
    }

    public void init()
    {
      
   try {
            p1=Runtime.getRuntime().exec("route print");
        } catch (IOException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }
        
        
        if(p1.getInputStream()!=null)
        {
            Writer writer = new StringWriter();
            char[] buffer = new char[1024];
           
            try {
                Reader reader = new BufferedReader(
                         new InputStreamReader(p1.getInputStream(), "UTF-8"));
                
                int n;
                
                 while ((n = reader.read(buffer)) != -1) {
                     writer.write(buffer, 0, n);
                 }
            }
                 catch (Exception e) {
                        // TODO: handle exception
                    }
                
                 int index=writer.toString().indexOf("Metric");
                 String finals=writer.toString().substring(index);
                 arrayips=finals.split("\\s+");
                 myipaddress=arrayips[4];
                
                 System.out.println(myipaddress);
            
                
                 try {
NetworkInterface network =          NetworkInterface.getByInetAddress(InetAddress.getByName(myipaddress));

                    byte[] mac = network.getHardwareAddress();

               

                    StringBuilder macaddress = new StringBuilder();
                    for (int i = 0; i < mac.length; i++) {
                        macaddress.append(String.format("%02X%s", mac[i], (i < mac.length - 1) ? "-" : ""));        
                    }
                    mymacaddress=macaddress.toString();
                    
                                     
                    System.out.println(mymacaddress);
                    
                } catch (SocketException e1) {
                    // TODO Auto-generated catch block
                    e1.printStackTrace();
                } catch (UnknownHostException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                catch(Exception ex)
                {
                    ex.printStackTrace();
                }
                
                 try {
                    p1.getInputStream().close();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    System.out.println(e.toString());
                    e.printStackTrace();
                }
               
                    try
                    {
                        //calling javascript function setipmac defined on jsp page
                       // setipmac is javascript function, you need to define on your jsp page to
                       // receive both Addresses from this Applet
           
                      getAppletContext().showDocument (new URL("javascript:setipmac('" + myipaddress +"','"+mymacaddress+"')"));
                  }
                    
                    catch (JSException jse)
                    {
                        jse.printStackTrace();
                  } catch (MalformedURLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
                
                
                
        }
                                  
                
             }
            

    
    public void start()
    {
        try
        {

         window = JSObject.getWindow(this);

        }
        
        catch (JSException jse)
        {
            jse.printStackTrace();
        }

        
    }
    
        Process p1;
   }


 =>That's all !!  ;)

 
 
<s:iterator value="fieldErrors">
<s:hidden  value="%{value}" id="%{key}" />
</s:iterator>

Above, we are linking hidden textfield whose id equals to %{key}i.e. fieldError Textfield name and value equals to %{value} i.e. fieldError message.

By this way, we can  take different actions on every FieldError:

On Body Onload Function, now we can check for different hidden textbox values as follows:

if(document.getElementById("FieldErrorTextBox1").value!="")
 {

}

if(document.getElementById("FieldErrorTextBox2").value!="")
 {

}
 
 
Solution:
  1. Startup the database with the mount option
    SQL> startup mount
    ORACLE instance started.

  2. Find the name of the redo log file which belongs to the active group
    SQL> SELECT MEMBER FROM V$LOG G, V$LOGFILE F WHERE G.GROUP# = F.GROUP#
    2 AND G.STATUS = 'CURRENT';

    MEMBER
    --------------------------------------------------------------------------------
    /OraRedo/RedoLogFiles/siamst_log01.dbf


  3. Using a backup control file, start the cancel based recovery. The system may suggest a non-existing archive log -- ignore it and specify the log file name {with full path} that you got in the above step
    SQL> RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
    ORA-00279: change 21375038 generated at 09/21/2007 20:12:47 needed for thread 1
    ORA-00289: suggestion : /export/pspp/oracle/dbs/arch1_4_633901491.dbf
    ORA-00280: change 21375038 for thread 1 is in sequence #4

    Specify log: {=suggested | filename | AUTO | CANCEL}
    /OraRedo/RedoLogFiles/siamst_log01.dbf
    Log applied.
    Media recovery complete.


  4. Finally open the database in RESETLOGS mode. It is recommended to reset the online logs after incomplete recovery or recovery with a backup control file
    SQL> ALTER DATABASE OPEN RESETLOGS;
    Database altered.

 
 
Solution:
Add a line to /etc/sysctl.conf file:
# To allow dba to allocate hugetlbfs pages
# Check your DBA group id, issuing command: grep dba /etc/group  will give this value
# 501 in my case
vm.hugetlb_shm_group = 501
=>That's all ;)

# SYSCTL.conf
# Kernel sysctl configuration file for Oracle Enterprise Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
# See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt
net.ipv4.conf.default.rp_filter = 2

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes
kernel.msgmnb = 65536

# Controls the default maxmimum size of a mesage queue
kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes
kernel.shmmax = 2147483648

# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 2097152
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 262144
net.core.rmem_max = 262144
net.core.wmem_default = 262144
net.core.wmem_max = 262144
vm.overcommit_memory = 1

# To allow dba to allocate hugetlbfs pages
# 1002 is your DBA group, id. grep dba /etc/group will give this value
vm.hugetlb_shm_group = 501



**************************************************************************

# SYSCTL.conf  (*correct settings for oracle 10G)
# Kernel sysctl configuration file for Oracle Enterprise Linux
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Controls IP packet forwarding
net.ipv4.ip_forward = 0

# Controls source route verification
# See /usr/share/doc/kernel-doc-*/Documentation/networking/ip-sysctl.txt
net.ipv4.conf.default.rp_filter = 2

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel

# Controls whether core dumps will append the PID to the core filename
# Useful for debugging multi-threaded applications
kernel.core_uses_pid = 1

# Controls the use of TCP syncookies
net.ipv4.tcp_syncookies = 1

# Controls the maximum size of a message, in bytes

# Controls the default maxmimum size of a mesage queue

# Controls the maximum shared segment size, in bytes

# Controls the maximum number of shared memory segments, in pages

# For 11g, Oracle-Validated setting for fs.file-max is 6815744
# For 10g, uncomment 'fs.file-max = 327679', and comment 'fs.file-max = 6553600' entry and re-run sysctl -p
 fs.file-max = 327679
#fs.file-max = 6815744

# Oracle-Validated setting for kernel.msgmni is 2878
kernel.msgmni = 2878

# Oracle-Validated setting for kernel.msgmax is 8192
kernel.msgmax = 8192

# Oracle-Validated setting for kernel.msgmnb is 65536
kernel.msgmnb = 65536

# Oracle-Validated setting for kernel.sem is '250 32000 100 142'
kernel.sem = 250 32000 100 142

# Oracle-Validated setting for kernel.shmmni is 4096
kernel.shmmni = 4096

# Oracle-Validated setting for kernel.shmall is 1073741824
kernel.shmall = 1073741824

# Oracle-Validated setting for kernel.shmmax is 4398046511104 on x86_64 and 4294967295 on i386 architecture. Refer Note id 567506.1
#kernel.shmmax = 4398046511104
kernel.shmmax = 34359738368

# Oracle-Validated setting for kernel.sysrq is 1
kernel.sysrq = 1

# Oracle-Validated setting for net.core.rmem_default is 262144
net.core.rmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.rmem_max is 4194304
# For 10g, uncomment 'net.core.rmem_max = 2097152', comment 'net.core.rmem_max = 4194304' entry and re-run sysctl -p
 net.core.rmem_max = 2097152
#net.core.rmem_max = 4194304

# Oracle-Validated setting for net.core.wmem_default is 262144
net.core.wmem_default = 262144

# For 11g, Oracle-Validated setting for net.core.wmem_max is 1048576
# For 10g, uncomment 'net.core.wmem_max = 262144', comment 'net.core.wmem_max = 1048576' entry for this parameter and re-run sysctl -p
net.core.wmem_max = 262144
#net.core.wmem_max = 1048576

# Oracle-Validated setting for fs.aio-max-nr is 3145728
fs.aio-max-nr = 3145728

# For 11g, Oracle-Validated setting for net.ipv4.ip_local_port_range is 9000 65500
# For 10g, uncomment 'net.ipv4.ip_local_port_range = 1024 65000', comment 'net.ipv4.ip_local_port_range = 9000 65500' entry and re-run sysctl -p
net.ipv4.ip_local_port_range = 1024 65000
#net.ipv4.ip_local_port_range = 9000 65500

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200




 
 
 Solution is:  BYPASS_UJVC

update  /*+ BYPASS_UJVC */ (Select AB.COUNTRY_SRNO as AB_COUNTRY_SRNO,AB.COUNTRY_DESC as AB_COUNTRY_DESC,AC.COUNTRY_SRNO as AC_COUNTRY_SRNO,AC.COUNTRY_DESC  as AC_COUNTRY_DESC From
Imigration.Im_Country Ab  Join  Test.Im_Country Ac
On Ab.Country_Srno=Ac.Country_Srno) t
    set   t.AB_COUNTRY_DESC =t.AC_COUNTRY_DESC;
 
 
<%@ page import="java.net.*"%>
<%@ page import="java.io.*"%>
<%@ page import="java.lang.String"%>
<%@ page import="java.net.*"%>
<%@ page import="java.lang.Object"%>
<html>
<body>

<%
response.setContentType("image/jpeg");
response.setHeader("Content-Disposition","attachment; filename=stuff" + ".jpg");

URL url = new URL("http://www.google.com/images/logos/ps_logo2.png");
URLConnection connection = url.openConnection();
InputStream stream = connection.getInputStream();

BufferedOutputStream outs = new BufferedOutputStream(response.getOutputStream());
int len;              
byte[] buf = new byte[1024];
while ((len = stream.read(buf)) > 0)  
      { 
 outs.write(buf, 0, len);   
      }                 
outs.close();
%>

</body>
</html>

 
 
You can generate  RSA public and private keys but when it comes to encrypting a large file using this command:
openssl rsautl -encrypt -pubin -inkey public.pem -in LargeFile.zip -out LargeFile_encrypted.zip
 
It generates the following error:

RSA operation error:
3020:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:.\crypto\rsa\rsa_pk1.c:151:

The Solution is SMIME.

1) Generate private and public keys.
     openssl req -x509 -nodes -days 100000 -newkey rsa:2048  -keyout privatekey.pem  -out publickey.pem  -subj ‘/’

2) Encrypt seemingly endless amount of data.
     openssl  smime  -encrypt -aes256  -in  LargeFile.zip  -binary  -outform DEM  -out  LargeFile_encrypted.zip  publickey.pem

 3) Decrypt 
      openssl  smime -decrypt  -in  LargeFile_encrypted.zip  -binary -inform DEM -inkey privatekey.pem  -out  LargeFile.zip

=>That's all !!  ;)