I have this script. When I execute it from putty, it works properly, but it fails when we execute it using java ProcessBuilder. It fails with “Hadoop command not found” error. Below is the Java code, which I am using to execute script. Answer Problem was the other script. Script one(1) starts Java…
Tag: linux
ELF, Build-ID, is there a utility to recompute it?
I came across this useful feature in ELF binaries — Build ID. “It … is (normally) the SHA1 hash over all code sections in the ELF image.” One can read it with GNU utility: And I wonder if there is an easy way to recompute Build ID yourself? To check if it isn’t corrupted etc. Ans…
Fastest way to extract pattern
What is the fastest way to extract a substring of interest from input such as the following? Desired output (i.e., the :-terminated string following the string MsgTrace(65/26) in this example): noop I tried the following, but without success: Answer grep by default returns the entire line when a match is foun…
How to execute jython script for every 120 seconds in IBM WebSphere Application Server in linux?
This is the code I am executing in WAS /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin/ The above path where i am executing this script But i need execute those script for every 120 seconds, above script i am getting input from user.. In cron tab is not possible.. Answer I have added the code below to exec…
Keep OrientDB server running on AWS EC2
I recently downloaded and managed to start an OrientDB server/database on an AWS EC2 Linux 14.04 (I think the name is) server for an application I want to set up. I started OrientDB “as usual” by running ./server.sh in the terminal via SSH link to the EC2 server. All works fine and I can query the…
How to set executable (application) icon in Linux based Qt
I I want to change this default icon to my desired icon. How to do this ? I have searched and found solution for Windows How to set application icon in a Qt-based project? but not for Linux. I have tried to do this using .desktop file by setting Icon = myPath/icon.icon or icon.PNG But it does not work. Any
Does hyphen need to be escaped in a regular expression?
The following returns a bunch of results including those containing “->emit” But the following returns no results Why? Answer You need to drop the -w option. It says to treat the expression as a whole word. A word must be bounded by non-word characters, i.e. it must only be surrounded by charac…
C – program is terminated (fork() and exec())
I have the following code: The idea is to call with program with 1 command line argument which is a name of another compiled C program in the same folder. I want to execute that program from within the C code (hence the use of fork()), and at the same time i want to launch another program from within the
debug wget command with gdb
I want to debug wget with a special url. So how to pass the url to gdb? I already tried with –args <the url>, but it dosen’t work. Please help me. ps: I used gdb in the wrong way gdb wget –args http://www.google.com/, it should be gdb –args wget http://www.google.com/ Answer This…
Validate text file presents expected fields for each data set
If one has a document in this format: You could verify each field exists for each data point manually by scrolling through thousands of lines in a file, but that would be inefficient and time consuming. I have thought about splitting the file and comparing each section using diff, but again, that would be pro…