Wednesday, December 6, 2017
Saturday, December 2, 2017
IO Error: The network adapter could not establish the connection
I'm not sure if the following steps will help you or not to solve the "IO Error: The network adapter could not establish the connection" issue just give a try it works in my case.
The error was:
(In NetBeans and in Sqldeveloper)
Step 1: Open CMD
Step 2: Type services.msc and hit enter
Step 3: Search for Oracle Services and make sure that the following three are running:
OracleXETNSListener
OracleXEClrAgent
OracleServiceXE
The error was:
(In NetBeans and in Sqldeveloper)
Steps:
Step 1: Open CMD
Step 2: Type services.msc and hit enter
Step 3: Search for Oracle Services and make sure that the following three are running:
OracleXETNSListener
OracleXEClrAgent
OracleServiceXE
Step 4: If not then just right click and hit start
That's all :).
Hope This will help you :p.
Thursday, November 2, 2017
Visual Studio 2017 Offline Installation
1) You will never get an ".iso" file officially from Microsoft for Visual Studio 2017 (Any edition).
Steps to create offline installer of VS2017:
2) Thus you remains with 2 options:
- Grab a web installer as Microsoft suggest and install whatever the components you need and double click on it.
- Follow the following steps to create an offline installer setup so that whenever you format you don't have to download it again or you can install it to another pc without an internet connection.
I downloaded Visual studio 2017 Community edition from here but this procedure will work for other editions too. It took me near about 13 hours and download size was ( 30.5 GB )
<<Download link for VS Community 2017 edition >> Link working as of 03-11-2017.
- Download visual studio setup exe file from the above link.
- Open Command Prompt
- Move to your downloaded directory where the exe file is
- And use the following command
vs_community_something.something.exe
This is name of your downloaded file
In my case it is -> vs_community__1972895516.1509628450.exe
It differs per download so don't worry about matching the exact digits :p
--layout dir_path
where dir_path is a location where your offline installer will present. By default, all languages will be downloaded. For me I only want english US for that
--lang en-US
you can use any language.
ISO CODE
|
LANGUAGE
|
cs-CZ
|
Czech
|
de-DE
|
German
|
en-US
|
English
|
es-ES
|
Spanish
|
fr-FR
|
French
|
it-IT
|
Italian
|
ja-JP
|
Japanese
|
ko-KR
|
Korean
|
pl-PL
|
Polish
|
pt-BR
|
Portuguese - Brazil
|
ru-RU
|
Russian
|
tr-TR
|
Turkish
|
zh-CN
|
Chinese - Simplified
|
zh-TW
|
Chinese - Traditional
|
Full command format:
vs_community setup.exe --layout "dir_path" --lang ISO-CODE
In my case it is:
vs_community__1972895516.1509628450.exe --layout "D:\VS\" --lang en-US
once you type the command and hit enter it will open Visual Studio command prompt and starts downloading.
Once the Downloading is done it will show you the following message in command prompt
Setup completed successfully.
Press any key to continue...
Press any key to continue...
REMEMBER IT DOESN'T HAVE ANY PAUSE or RESUME OPTION SO YOU HAVE TO DOWNLOAD IT COMPLETELY.
ALL THE BEST AND TELL ME TIME TAKEN AND SPEED YOU GET AND TOTAL DOWNLOAD SIZE :)
Tuesday, September 19, 2017
Code::blocks ppa
To install Code::Blocks from this PPA, open a terminal and type:
sudo add-apt-repository ppa:damien- moore/codeblock s-stable
sudo apt-get update
sudo apt-get install codeblocks codeblocks-contrib
sudo apt-get update
sudo apt-get install codeblocks codeblocks-contrib
Wednesday, August 2, 2017
RMI basic arithmetic
RMI Program for arithmetic operations:
_________________________________________________________________________________
Interaface
package RMIDemo;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
*
* @author yogesh
*/
public interface one extends Remote{
public int add(int num1,int num2)throws RemoteException;
public int sub(int num1,int num2)throws RemoteException;
public int mul(int num1,int num2)throws RemoteException;
public int div(int num1,int num2)throws RemoteException;
}
EXECUTING DEMO IN NETBEANS
_________________________________________________________________________________
Interaface
package RMIDemo;
import java.rmi.Remote;
import java.rmi.RemoteException;
/**
*
* @author yogesh
*/
public interface one extends Remote{
public int add(int num1,int num2)throws RemoteException;
public int sub(int num1,int num2)throws RemoteException;
public int mul(int num1,int num2)throws RemoteException;
public int div(int num1,int num2)throws RemoteException;
}
_________________________________________________________________________________
Implementation Class
package RMIDemo;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
/**
*
* @author yogesh
*/
public class two extends UnicastRemoteObject implements one{
public two()throws RemoteException{}
@Override
public int add(int num1, int num2) throws RemoteException {
System.out.println("Addition Performed");
return ((num1+num2));
}
@Override
public int sub(int num1, int num2) throws RemoteException {
System.out.println("Subtraction Performed");
return ((num1-num2));
}
@Override
public int mul(int num1, int num2) throws RemoteException {
System.out.println("Multiplication Performed");
return ((num1*num2));
}
@Override
public int div(int num1, int num2) throws RemoteException {
System.out.println("Division Performed");
return ((num1/num2));
}
}
_________________________________________________________________________________
Server Class
package RMIDemo;
import java.io.IOException;
import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.registry.Registry;
/**
*
* @author yogesh
*/
public class rmiserver {
public static void main(String[] args) throws RemoteException, AlreadyBoundException, MalformedURLException, IOException {
Registry r = java.rmi.registry.LocateRegistry.createRegistry(1099);//1099 is the port number
Runtime.getRuntime().exec("cmd /c C:\\Program Files\\Java\\jdk1.8.0_144\\bin\\rmic C:\\Users\\Yogesh\\Documents\\NetBeansProjects\\DSLabs\\build\\classes\\RMIDemo.two");
two twox=new two();
Naming.bind("add", twox);
Naming.bind("sub", twox);
Naming.bind("mul", twox);
Naming.bind("div", twox);
System.out.println("ALL OBJECTS CREATED");
System.out.print("\nListing");
String s[]=Naming.list("two");
for(String str:s){
System.out.println(""+str);
}
}
}
_________________________________________________________________________________
Client Class
package RMIDemo;
import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.Scanner;
/**
*
* @author yogesh
*/
public class rmiclient {
public static void main(String[] args) throws NotBoundException, MalformedURLException, RemoteException {
Scanner sc=new Scanner(System.in);
System.out.print("\nEnter two Numbers:");
int num1=sc.nextInt();
int num2=sc.nextInt();
one onex=(one)Naming.lookup("rmi://localhost/add");
one oney=(one)Naming.lookup("rmi://localhost/add");
one onez=(one)Naming.lookup("rmi://localhost/add");
one onew=(one)Naming.lookup("rmi://localhost/add");
System.out.println("Addition="+onex.add(num1,num2));
System.out.println("Subtraction="+oney.sub(num1,num2));
System.out.println("Multiplication="+onez.mul(num1,num2));
System.out.println("Division="+onew.div(num1,num2));
}
}
_________________________________________________________________________________
EXECUTING DEMO IN NETBEANS
Sunday, May 28, 2017
Installing .rpm on Ubuntu
Step 1: Installing alien
$sudo apt-get install alien dpkg-dev debhelper build-essential
Step 2:Converting .rpm to .deb
$sudo alien package_name.rpm
Step 3: Installing converted .deb
$sudo dpkg -i package_name.deb
$sudo apt-get install alien dpkg-dev debhelper build-essential
Step 2:Converting .rpm to .deb
$sudo alien package_name.rpm
Step 3: Installing converted .deb
$sudo dpkg -i package_name.deb
Installing VLC on Fedora 22 or later
$> su - #> dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm #> dnf install vlc #> dnf install python-vlc npapi-vlc
Installing Oracle 11g Express Edition on Ubuntu
Step 1: Download Oracle Database Express Edition.
Step 2: Instructions before install Oracle
-
Copy the downloaded file and paste it in directory.
-
Unzip using the command:
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
-
Install required packages using the command:
sudo apt-get install alien libaio1 unixodbc
-
Enter into the Disk1 folder using :
cd Disk1/
-
Convert RPM package format to DEB package format (that is used by Ubuntu) using the command:
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
-
Create the required script using the command:
sudo gedit /sbin/chkconfig
The text editor is started and the commands are shown at the bottom of the screen. Now copy and paste the following into the file and save:
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01
-
Change the permission of the file using the command:
sudo chmod 755 /sbin/chkconfig
-
Set kernel parameters. Oracle 11gR2 XE requires additional kernel parameters which you need to set using the command:
sudo gedit /etc/sysctl.d/60-oracle.conf
-
Copy the following into the file and save:
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912
-
Verify the change using the command:
sudo cat /etc/sysctl.d/60-oracle.conf
-
You should see what you entered earlier. Now load the kernel parameters:
sudo service procps start
-
Verify the new parameters are loaded using:
sudo sysctl -q fs.file-max
You should see the file-max value that you entered earlier.
-
Set up /dev/ mount point for Oracle. Create the following file using the command:
sudo gedit /etc/rc2.d/S01shm_load
-
Copy the following into the file and save.
#!/bin/sh
case "$1" in
start)
mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
*)
echo error
exit 1
;;
esac
-
Change the permissions of the file using the command:
sudo chmod 755 /etc/rc2.d/S01shm_load
-
Now execute the following commands:
sudo ln -s /usr/bin/awk /bin/awk
sudo mkdir /var/lock/subsys
sudo touch /var/lock/subsys/listener
Now, Reboot Your System
Copy the downloaded file and paste it in directory.
Unzip using the command:
unzip oracle-xe-11.2.0-1.0.x86_64.rpm.zip
Install required packages using the command:
sudo apt-get install alien libaio1 unixodbc
Enter into the Disk1 folder using :
cd Disk1/
Convert RPM package format to DEB package format (that is used by Ubuntu) using the command:
sudo alien --scripts -d oracle-xe-11.2.0-1.0.x86_64.rpm
Create the required script using the command:
sudo gedit /sbin/chkconfig
The text editor is started and the commands are shown at the bottom of the screen. Now copy and paste the following into the file and save:
#!/bin/bash
# Oracle 11gR2 XE installer chkconfig hack for Ubuntu
file=/etc/init.d/oracle-xe
if [[ ! `tail -n1 $file | grep INIT` ]]; then
echo >> $file
echo '### BEGIN INIT INFO' >> $file
echo '# Provides: OracleXE' >> $file
echo '# Required-Start: $remote_fs $syslog' >> $file
echo '# Required-Stop: $remote_fs $syslog' >> $file
echo '# Default-Start: 2 3 4 5' >> $file
echo '# Default-Stop: 0 1 6' >> $file
echo '# Short-Description: Oracle 11g Express Edition' >> $file
echo '### END INIT INFO' >> $file
fi
update-rc.d oracle-xe defaults 80 01
Change the permission of the file using the command:
sudo chmod 755 /sbin/chkconfig
Set kernel parameters. Oracle 11gR2 XE requires additional kernel parameters which you need to set using the command:
sudo gedit /etc/sysctl.d/60-oracle.conf
Copy the following into the file and save:
# Oracle 11g XE kernel parameters
fs.file-max=6815744
net.ipv4.ip_local_port_range=9000 65000
kernel.sem=250 32000 100 128
kernel.shmmax=536870912
Verify the change using the command:
sudo cat /etc/sysctl.d/60-oracle.conf
You should see what you entered earlier. Now load the kernel parameters:
sudo service procps start
Verify the new parameters are loaded using:
sudo sysctl -q fs.file-max
You should see the file-max value that you entered earlier.
Set up /dev/ mount point for Oracle. Create the following file using the command:
sudo gedit /etc/rc2.d/S01shm_load
Copy the following into the file and save.
#!/bin/sh
case "$1" in
start)
mkdir /var/lock/subsys 2>/dev/null
touch /var/lock/subsys/listener
rm /dev/shm 2>/dev/null
mkdir /dev/shm 2>/dev/null
*)
echo error
exit 1
;;
esac
Change the permissions of the file using the command:
sudo chmod 755 /etc/rc2.d/S01shm_load
Now execute the following commands:
sudo ln -s /usr/bin/awk /bin/awk
sudo mkdir /var/lock/subsys
sudo touch /var/lock/subsys/listener
Now, Reboot Your System
Step 3: Install Oracle
-
Install the DBMS using the command:
sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
-
Configure Oracle using the command:
sudo /etc/init.d/oracle-xe configure
-
Setup environment variables by your .bashrc file:
gedit ~/.bashrc
-
Add the following lines to the end of the file:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
-
Load the changes by executing your profile:
777 ~/.profile
. ~/.profile
-
Start the Oracle 11gR2 XE:
sudo service oracle-xe start
-
Add user YOURUSERNAME to group dba using the command:
sudo usermod -a -G dba YOURUSERNAME
Install the DBMS using the command:
sudo dpkg --install oracle-xe_11.2.0-2_amd64.deb
Configure Oracle using the command:
sudo /etc/init.d/oracle-xe configure
Setup environment variables by your .bashrc file:
gedit ~/.bashrc
Add the following lines to the end of the file:
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
export ORACLE_SID=XE
export NLS_LANG=`$ORACLE_HOME/bin/nls_lang.sh`
export ORACLE_BASE=/u01/app/oracle
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin:$PATH
Load the changes by executing your profile:
777 ~/.profile
777 ~/.profile
. ~/.profile
Start the Oracle 11gR2 XE:
sudo service oracle-xe start
Add user YOURUSERNAME to group dba using the command:
sudo usermod -a -G dba YOURUSERNAME
Step 4: Using the Oracle XE Command Shell
-
Start the Oracle XE 11gR2 server using the command:
sudo service oracle-xe start
-
Start command line shell as the system admin using the command:
sqlplus sys as sysdba
Enter the password that you gave while configuring Oracle earlier. You will now be placed in a SQL environment that only understands SQL commands.
-
Create a regular user account in Oracle using the SQL command:
create user USERNAME identified by PASSWORD;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password. If you had executing the above with a message about , then execute the following SQL command and try again:
alter database open resetlogs;
-
Grant privileges to the user account using the SQL command:
grant connect, resource to USERNAME;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password.
-
Exit the admin shell using the SQL command:
exit;
-
Start the shell as a regular user using the command:
sqlplus
Now, you can run commands...
Start the Oracle XE 11gR2 server using the command:
sudo service oracle-xe start
Start command line shell as the system admin using the command:
sqlplus sys as sysdba
Enter the password that you gave while configuring Oracle earlier. You will now be placed in a SQL environment that only understands SQL commands.
Create a regular user account in Oracle using the SQL command:
create user USERNAME identified by PASSWORD;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password. If you had executing the above with a message about , then execute the following SQL command and try again:
alter database open resetlogs;
Grant privileges to the user account using the SQL command:
grant connect, resource to USERNAME;
Replace USERNAME and PASSWORD with the username and password of your choice. Please remember this username and password.
Exit the admin shell using the SQL command:
exit;
Start the shell as a regular user using the command:
sqlplus
Now, you can run commands...
Installing Google Chrome .rpm package in Fedora
Step 1: Install Following Dependencies:
$sudo yum install lsb $sudo yum install libXScrnSaver
Step 2: download .rpm chrome package here or from https://www.google.com/chrome/.
Step 3: install .rpm chrome package using following command
$ sudo rpm -ivh google-chrome-stable_current_x86_64.rpm
Subscribe to:
Posts (Atom)