unix

strange character "â" in cmake generated makefile errors

Terrible title, sorry. I used cmake to generate a makefile and I specified g++ as the C++ compiler and when I run the generated makefile using make or gmake I get all these compile errors and all my symbols have trailing â's on them. Any thoughts on what might be behind these mysterious â's? ...

What is the diffrence between Trap and Interrupt ?

What is the diffrence between Trap and Interrupt ? This is a question from an Exam so i need the basic diffrence/s ...

write a background process to check process is still active

In UNIX, I have a utility, say 'Test_Ex', a binary file. How can I write a job or a shell script(as a cron job) running always in the background which keeps checking if 'Test_Ex' is still running every 5 seconds(and probably hide this job). If it is running, do nothing. If not, delete a directory at the specified path. ...

postfix problem sending email "RCPT reject localhost not listed"

i am hacing a hard time getting postfix to send emails. this is the mail.log entry: Jun 30 18:27:46 vm21 postfix/smtpd[15682]: warning: ::1: address not listed for hostname localhost Jun 30 18:27:46 vm21 postfix/smtpd[15682]: connect from unknown[::1] Jun 30 18:27:46 vm21 postfix/smtpd[15682]: NOQUEUE: reject: RCPT from unknown[::1]:...

tcp connection from unix to java

Hello everybody. I'm looking for something,I don't know if it exists. I have a Java server, something like while (true) { try { Socket socket = server.accept(); new ConnectionHandler(socket); System.out.println("Waiting for a new client message..."); } catch (IOEx...

Overhead of times() system call - relative to file operations

What is the relative overhead of calling times() versus file operations like reading a line fread(). I realize this likely differs from OS to OS and depends on how long the line is, where the file is located, if it's really a pipe that's blocked (it's not), etc. Most likely the file is not local but is on a mounted NFS drive somewhere ...

How do I revert back to a previous SVN commit?

Suppose I'm at revision 50. But, I want to revert back to revision 45, and commit back as the stable version. How do I do that, in the most simple way? What if I want to do that with one file? What if I want to do that with the entire repository? ...

What do I change in my VIM config to do this? (remove the arrows)

My files have this "invisible arrows" How do I disable this completely? --->--->--->--- This is my vim config. What do I have to change to do this? set nohlsearch set ai set bg=dark set showmatch highlight SpecialKey ctermfg=DarkGray set listchars=tab:>-,trail:~ set list autocmd BufRead *.py set smartindent cinwords=if,elif,else,f...

How to write a shell script to compile multiple embedded sql in C files (.sqc)?

Hi, I have written 3 .sqc files i.e. embedded sql in host language C. I need to make a (Unix) shell script to simply compile all 3 sqc files in a row. How can I do that? Right now, I can individually run each .sqc file using a Makefile that basically converts the .sqc file to a c file and then compiles it. Can I make 3 individual Makef...

PS command to get memory, user, process info on IBM AIX and SunOS Solaris

I am looking for best PS command to get as much info as possible, mainly memory info like SZ, RSS with userid, pid, complete command/process. I have two servers IBM AIX and SunOS solaris. I am OK to have two different commands for two servers. I have tried "ps v", "ps al", "ps aux" on AIX, but looking for command that gives more info...

Python's subprocess module returning different results from Unix shell

I'm trying to get a list of the CSV files in a directory with python. This is really easy within unix: ls -l *.csv And, predictably, I get a list of the files that end with .csv in my directory. However, when I attempt the Python equivalent using the Subprocess module: >>> import subprocess as sp >>> sp.Popen(["ls", "-l", "*.csv"], s...

Unix directory structure: managing file name collision

Usually every time `make install' is run, files are not put in a specific directory like /usr/prog1. Instead, the files are put in directories where files from other programs are already in like /usr/lib and /usr/bin. I believe this has been a common practice since long time ago. This practice surely increases the probability of file nam...

How can I compile X11 statically?

I'm compiling parallel C code on a cluster (HECToR). Although I won't be running any parallel jobs interactively, my code contains some references to X11 functions which are used when it's run sequentially. The cluster I'm using doesn't support shared libraries, which rules out X11, at least in the way I've been using it so far. Could ...

How can I convert a file pointer ( FILE* ) to a file descriptor (fd)?

I have a FILE *, returned by a call to fopen(). I need to get a file descriptor from it, to make calls like fsync(fd) on it. What's the function to get a file descriptor from a file pointer? ...

How to do Multi file find and replace from unix prompt

I want to replace 'localhost' with an actual ip like '1.1.1.1' in every file in a directory including subfolders, plus I want it to log the filenames it changed. I'm having a difficult time doing this, what command should I use? ...

PHP equivalent of the `du` command?

I'm writing a simple file-caching engine in PHP that needs to be able to see how big a directory is. What I'm looking for is the equivalent of Unix's du command to simply print the total filesize of a directory. I can write it myself, but if somebody else already figured out all the issues of recursing and handling symlinks and so on, ...

Create a video from images unix command line with transitions

I found several questions with answers on how to create a video from images. I setup two of them and was able to produce the videos correctly. I tried the following: ImageMagick convert -delay 100 -quality 75 photo1.jpg photo2.jpg movie.mpg FFMPEG ffmpeg -r 10 -b 1800 -i photo1.jpg photo2.jpg movie.mpg The end result is the video disp...

jQuery uploadify I/O error UNIX

Hi, I've a problem with jQuery uploadify script and I didn't found any solution. I've integrated this script on my project and everything is working fine on a Windows server(localhost) but when I try to run it on an UNIX server and I/O error is risen. This only happens when I try to upload a file that already exists on uploading folder...

How can I compare two zip format(.tar,.gz,.Z) files in Unix

I have two gz files. I want to compare those files without extracting. for example: first file is number.txt.gz - inside that file: 1111,589,3698, 2222,598,4589, 3333,478,2695, 4444,258,3694, second file - xxx.txt.gz: 1111,589,3698, 2222,598,4589, I want to compare any column between those files. If column1 in first file is...

How To Create Vector of Vector In R

I have input data that contain lines like this: -0.438185 -0.766791 0.695282 0.759100 0.034400 0.524807 How can I create a data structure in R that looks like this: [[1]] [1] -0.438185 -0.766791 0.695282 [[2]] [1] 0.759100 0.034400 0.524807 ...