I’m trying to install pytorch (http://pytorch.org/) on Linux, and according to my machine configuration, the command I should run is: pip install https://s3.amazonaws.com/pytorch/whl/torch-0.1.6.post17-cp27-cp27mu-linux_x86_64.whl On one machine (Linux distribution Slackware 14.1) the installation fails…
Delete all files except a few using bash command
I have a directory containing lot of files in different formats. I would like to know how I can delete all files with specific format (Lets say *.dat) except a few files in a same format (e.g. A.dat and B.dat). Please advise! Answer I’d write a little script (as a command-line one-liner it is slightly t…
Hadoop command does not execute from java prcoessbuilder
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…
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