linux

lapack import error with NumPy

Trying to import numpy in Python 2.6 I run into: from numpy.linalg import lapack_lite ImportError: libmkl_lapack.so: cannot open shared object file: No such file or directory There are multiple instances of Intel's Math Kernel Library on the machine providing libmkl_lapack.so and I'm pointing at them with every relevant or semi-releva...

Bash - get last dirname/filename in a file path argument

I'm trying to write a post-commit hook for SVN, which is hosted on our development server. My goal is to try to automatically checkout a copy of the committed project to the directory where it is hosted on the server. However I need to be able to read only the last directory in the directory string passed to the script in order to chec...

How to install Fortran compiler (gcc42-fortran)

I'm trying to install R and came across this error during installation: http://projects.uabgrid.uab.edu/r-group/wiki/install-R, which is why i need to install the fortran compiler. Every .rpm i have downloaded of the gcc42.fortran has given me this error: libgfortran2 >= 4.2.1_20070724-50.18 is needed by package gcc42-fortran-4.2...

Performance of fopen() on win32

I am trying to write some code that works on both Linux and Win32. The most noticeable difference I find between them (in my code) is performance of fopen(). Following code takes 5 sec on my Ubuntu and the same code takes more than 100 sec on windows XP. I would like to make a note here that ubuntu is VM while XP is on a real machine. ...

What is a key-value memory storage system that is not intended to be persistent, but can store over 1MB?

Basically, I want memcached that can store over 1MB. ...

Are Apple platforms the only place Objective-C is a good choice?

If you are not developing for an Apple platform, are there reasons to choose Objective-C? I know of GNUstep (which I do not find visually pleasing), but what else is there? If you want to develop for multiple platforms, including OS X or iOS but also Linux or Windows, when might Objective-C be a good choice? ...

Where can I get the latest information about aio on Linux 2.6.x

Recently I am learning how to write a high performance web server.There is a experiment by RedHat says that epoll is faster than aio. someone says that because aio in Linux kernel is implemented with pthread. It's difficult for me to find latest information to prove this.Also I don't know is epoll still better than aio now on Linux?So I ...

Run Linux commands from Daemon

Hi, I need to run a linux command such as "df" from my linux daemon to know free space,used space, total size of the parition and other info. I have options like calling system,exec,popen etc.. But as this each command spawn a new process , is this not possible to run the commands in the same process from which it is invoked? And at...

Regarding error numbers in Linux

Hi Is there any link or material where I can learn more about the different error numbers in Linux ?? At present in man errno I get a single line for each error number but I would like to know the conditions or chances for which particular error occurs (A more detailed description in short words) For e.g. EADDRNOTAVAIL 99 /* Cannot ...

ARM-linux4.3.2, can't open socket with PF_PACKET type

Hello, I'm using FriendlyARM with linux 2.6.29 and compiling with ARM-Linux GCC 4.3.2 When trying to open a socket with PF_PACKET it fails with errno 97, Address family not supported by protocol. This is an example program that illustrates the problem - #include <stdio.h> #include <sys/socket.h> #include <netpacket/packet.h> #in...

Process state when calling syscall?

What process state has when it calls a syscall? I mean, don't asume it's an I/O syscall like read or write... It's the process itselft that executes kernel code, or the process is suspendes and there's like a "kernel thread" that execute the syscall handler (and knows wich process called (current))? I'm not sure if changes from execu...

Using output of previous commands in bash

In Mathematica, it is possible to reuse the output of the previous command by using %. Is something similar possible for bash (or some other shell)? For example, I run a make which gives warnings, but I want to find all warnings. So, I type make | grep "warning" but I'm not able to see the output of the make then. I would like to ...

warning: "IPPROTO_TCP" redefined warning: this is the location of the previous definition

I am getting this warning when compiling In file included from server.c:48: unixwin.h:23:1: warning: "IPPROTO_TCP" redefined In file included from server.c:42: /usr/include/netinet/in.h:45:1: warning: this is the location of the previous definition below is the sections refered to in the error: file unixwin.h 15 16 #i...

specific interface name for an interface in linux

Hi, Is there a possibility that I can hardcode interface name(say eth1) to a specific interface in the linux driver code? This is in a controlled environemnt only, so breaking from default linux way(dynamically assigning name) is ok. ...

Port Visual Studio C++ to Linux

Hi, We have a not very complicated but big (i.e. lots of files) Visual Studio C++ Win32 Console written in C++0x standard in VS2010. It does not use any non standard code or anything (Hopefully!). I now wanna port it to Linux. Which way is the quickest way to do it? autoconf? old-fashioned make file? any other solution? ...

warning: "IPPROTO_TCP" redefined warning: this is the location of the previous definition

I am getting this warning when compiling In file included from server.c:48: unixwin.h:23:1: warning: "IPPROTO_TCP" redefined In file included from server.c:42: /usr/include/netinet/in.h:45:1: warning: this is the location of the previous definition below is the sections refered to in the error: file unixwin.h 15 16 #ifndef FALSE 17...

how can i print the column in text file to row wise using unix command?

I have file like this.. for eg: number,dac,amountdac,expdate,0 1111,1,0.000000,2010-07-21,0 1111,2,0.000000,2010-07-21,0 1111,3,0.000000,2010-07-21,0 1111,4,0.000000,2010-07-21,0 1111,5,0.000000,2010-07-21,0 1111,6,0.000000,2010-07-21,0 1111,7,0.000000,2010-07-21,0 1111,8,0.000000,2010-07-21,0 1111,9,0.000000,2010-07-21,0 1111,10,0.0000...

What are the right ways to call shell commands (incl. those requiring root rights) from PHP/Java/Python web applications?

I am looking forward to develop a remote system management web application (like Webmin is, for example). Obviously I am going to need to call shell commands to be executed as issued by root or another specific non-nobody user. What are general guidelines for this task? The only solution coming into my mind now is running the web serve...

How to return spawned process exit code in Expect script?

I use expect for running test scripts. Tests return success/failure through exit code. But expect return equivalent exit code. How to make expect return proper exit status? My tests are sql scripts run with psql (postgresql command processor). Since psql doesn't allow to specify database password as a command line parameter, expect scri...

How to access a smartcard in Java on Linux?

I'm trying to access a smartcard on a linux system on a VM. The USB device is mapped to the VM and can be listed via lsusb (ID 076b:3021 OmniKey AG CardMan 3121). I can access the smartcard via pkcs11-tool and pkcs15-tool. Also firefox can access the token via the /usr/lib/opensc-pkcs11.so library. But when I try to access the smartcar...