Posts

How to Run Java code in new terminal Through Java Code in Linux

Hi,      Here I have written the snippet for running the java process in new terminal through java code just put your java code name and run simply. import java.io.*; class CodeRunInTerminal {     public static void main(String args[]) throws IOException     {         String command= "/usr/bin/xterm -e java codename";//where the java is command and codename is java code which you want to run in new terminal.         Runtime rt = Runtime.getRuntime();         Process pr = rt.exec(command);     } } Thanks.

How to Kill Java Process in Linux Operating System using Java Code

Java Code for killing the Java process in Linux OS. Hi,     Here I have written the small snippet for killing the java running  process in linux OS. public void checkprocess() {     String s = null;     int x=0;     try     {         Process p = Runtime.getRuntime().exec("jps"); //JPS command is used for showing all the java running process with ID.         BufferedReader stdInput = new BufferedReader(new InputStreamReader(p.getInputStream()));         BufferedReader stdError = new BufferedReader(new InputStreamReader(p.getErrorStream()));         while ((s = stdInput.readLine()) != null)         {             String[] tokens = s.split(" ");             if(tokens.length!=2)             {                 throw new IllegalArgumentException();             }             String commandid = tokens[0];             String prcess = tokens[1];             System.out.println("Processes  Name is : "+prcesss);             if(prcs.equals("P

How to Execute Query & Stored Procedure in Linux Using Shell Scripting.

How to Execute Query & Stored Procedure in Linux Using Shell Scripting. You can simply use below mention script for executing the query or procedure. #!/bin/sh mysql -u root –ppassword -e 'call test_procedure();' Databasename Where -p is used password in which you can mention the password of your mysql. Where -e is used for executing the   query or stored procedure. Where databasename is used for your mysql database name. #!/bin/sh mysql -u root –ppassword -e ‘select * from tbl_test;’ Databasename   This single line can be used for   executing stored procedure as well as sql query. You can save this script into any extension of file but you need to give the permission first for executing the script file for example: #chmod +x filename

Limitations of MySQL Database

Limitations of MySQL Database Many of the Mysql user does not know the limitations of Mysql database. So here I am writing some of the Mysql limitations are as follows. In mysql database the maximum size of the table is determined by operating system in which the Mysql is installed. So the maximum size of table is allowed by the operating system. Below mentioned table showing the file size limit of operating systems : Operating System File Size Limit Windows (FAT32) 4GB Windows (NTFS) 2TB MacOS 2TB Linux 4TB Solaris 9/10 16TB Limitations of Joins : The maximum number of tables that can be referenced in a single join is 61. This also applies to the number of tables that can be referenced in the definition of a view. It can also applies to LEFT and RIGHT OUTER JOINS. Limitations of the MyISAM storage engine : Large files up to 63-

How to configure the VNC server in Linux and Centos

How to configure the VNC server in Linux and Centos? We can configure the VNC server and can be automatically started when the system boots or restart. Before this service we will have to work with some commands and script needs to be done. Firstly, need to edit the   /etc/sysconfig/vncservers file to include the users in this file you want to run VNC servers . Append a line to that file as follows: Step 1 :-   VNCSERVERS="N:user" Where N is the number of users want to use the VNC server   sessions to run on where the user is the username you want the server to run as. Here below are the example for the same VNCSERVERS="N:user1 Y:user2" Example :- VNCSERVERS="1:root 2:root" Step 2 :- $ vncpasswd    Password:     Verify: If you want to have the full Linux environment, create   ~username/.vnc/xstartup and include the following lines: Step 3 :- #!/bin/bash unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc

Monitoring of Linux Server & Asterisk Server.

Image
MONITORING OF   LINUX SYSTEM [1 ] top : top is a command that neatly list all processes with valuable info sort by CPU and memory usage. 'top' provides lots of information on the processes running, including the percentage of the cpu and the memory being consumed by that process, who 'owns' the process and it's pid (Process ID), it also shows the output of 'uptime' and a summary of memory usage, similar to 'free'. The output of 'top' is full screen, and refreshes itself frequently (or at user definable intervals). #top [2] To see last shut down time Of RHEL System: #last -x|grep shutdown | head -1 [3 ] To see last reboot history of RHEL System. #last reboot [4] W command is use to see the Login Linux user time. It shows the uptime of the linux system #w #w root [5] netstat -tulpn command to display listening sockets/ports and associated program. #netstat -tulpn