Skip to content

Python wheels: cp27mu not supported

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…

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…

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