linux

How do I change stdin Stream with Eclipse run command?

Hey, I'm working on a project where rather than using command line arguments I am supposed to just pipe a file to stdin and pipe output to another file. ie I need to run something like: ./program < infile.txt > outfile.txt Is there a way to specify to Eclipse this is the command I want when it is run? I am running the Eclipse-C/C++...

fflush and while loop

Hello, I have been trying to use fflush to make a progress bar. To test fflush, I wrote the small code below. It works as it supposed to when I uncomment "sleep(1);" but it works in an unexpected way if it remains commented out. It prints the first dash, waits than prints all remaining 9 of them and quits. I don't understand why it...

How does one write a window decorator for compiz?

Hi, I wanted to know how to do this. I realize this is kind of esoteric knowledge, since it's not really necessary. However, it is a topic of interest to me, and I would like to know about it. What I don't understand is how compiz works as a whole. If gtk-window-decorator is just a program by itself (which I believe it is), then how do...

Cygwin and alternatives to replicating linux commands on windows

I keep running into issues with a .bat script I want to write to automate some tasks related to the setup of my PHP application. I can't for instance do simple wget to download files and so on. I hear that by installing Cygwin, the user should be able to have access to all linux related commands, so my script will run without problems....

Find function signature in Linux

Given a .so file and function name, is there any simple way to find the function's signature through bash? Return example: @_ZN9CCSPlayer10SwitchTeamEi Thank you. ...

PostGreSQL without password prompt : .pgpass ignored

Hello all, I'm trying to enable root (Ubuntu 8.04) to use psql command without password prompt (for scripting purpose). Everything worked fine with PostGreSQL 8.3, but I migrate to PostGreSQL 8.4 and the login without password doesn't work anymore. I've a correct .pgpass file (the same used for 8.3), the right of /root/.pgpass are 0600...

Will a child process send SIGCHLD on abort()?

If an application does a fork() and the child dies with an abort() (due to failing an assert()), will the parent process receive a SIGCHLD? If it's relevant this is on Debian 4 (gcc version 4.1.2). ...

How C++ select() function works in Unix OSs ?

I have used the select() function to implement servers, but now I have to implement it by myself (as a part of a project). int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); Can anyone please help me to implement this function? Any sources, articles? Can anyone explain what is happeni...

Bash read/write file descriptors -- seek to start of file

I tried to use the read/write file descriptor in bash so that I could delete the file that the file descriptor referred to afterward, as such: F=$(mktemp) exec 3<> "$F" rm -f "$F" echo "Hello world" >&3 cat <&3 but the cat command gives no output. I can achieve what I want if I use separate file descriptors for reading and writing: ...

prevent git checkout from overwriting a file

Another dev checked his .rvmrc into the git repo. I've since removed it and added it to gitignore, but every time in need to go back in time it overwrites my .rvmrc. I'm on OSX, so I've discovered I can use the OSX file locking mechanism ("Locked" checkbox in Get Info) to stop this happening on my dev machine, but how would this be don...

how to include python modules in linux?

I found this xgoogle python modules http://github.com/pkrumins/xgoogle, very interesting. How exactly should i include or install these files in linux?? if i want to do something like this using xgoogle python module? >>from xgoogle.search import GoogleSearch I know that we can use from, import to use modules, but to include an exte...

how to use pylint in vim

I do not want to install another plugin, like pylint.vim, And today, I decide to use vim edit python instead of pydev which is a eclipse plugin. But I got issues. I have add this in my vimrc autocmd BufWritePost *.py !pylint <afile> but pylint does not contains filename in output ************* Module mymodule E: 22: invalid syntax ...

How do applications resolve to different versions of shared libraries at run time ?

I'm a noob to how shared libraries work on linux. I am trying to understand how do applications resolve different revisions of the same shared library at run-time on linux. As far as I understand, a shared library has three "names", for example, libmy.so.1.2 (real-name i.e. the actual obj file) libmy.so.1 (SONAME, which is embedded ...

Why is my preview file doesn't work in sh???

What this is meant to do is, collects the arguments which are the names of the image files and checks them if they exist and are readable, then it converts the image to the preview file in the layout (imagename)_preview.jpg and underneath it it would have the size of the orignal file in 'bytes'. Here is my script. #!/bin/sh clear for i ...

Learning Linux from Windows Newbie questions

I am a newbie in linux and programming. I want to learn linux command and use create some C and C++ programme to interact with the linux API from my windows XP. However, I am not sure how to set up the environment from my windows based computer. What programme should I install? Also, it seems like linux has Ubuntu, Fedora. I heard of Re...

High quality image re-sampling in Mono/C#/ASP.NET

I've developed a site that requires high quality resizing of uploaded photos. The site works perfectly under ASP.NET on Windows. This afternoon I tried running it under Mono/Apache/Ubuntu 10.10. To my surprise, it worked - except for the image resampling. It seems the libraries underlying Mono's Graphics/GDI+ implementation don't imple...

How to specify the library version to use at link time?

Following question http://stackoverflow.com/questions/3839756/how-do-applications-resolve-to-different-versions-of-shared-libraries-at-run-time, I wondered how to specify on the link command line which version of the library to use? Let's say I have libmy.so.1.0 libmy.so.1 -> libmy.so.1.0 libmy.so.2.0 libmy.so.2 -> libmy.so.2.0 l...

Linux ipconfig command

I am a new user of Linux and have freshly installed RHEL5 operating system on 1 of my system. I have chosen DHCP during installation. Now after installation when I tried to run ipconfig command on the shell prompt I got this message bash: iconfig: command not found I am a root user. I do not understand why am I getting this error. M...

ipkg: dependencies on versions? adding support for more architectures?

Can you limit the Depends: field in your control files to specific versions, lists of versions, or ranges of version as you can in dpkg? It also seems to me that ipkg out of the box only supports the architectures "arm" and "all", and not x86, which is what I would like to use. Is this a simple modification to the source or a config fi...

Find All Possible Combination of Features (Column) in a Tab Delimited Data

I have a data that looks like this: 1 1:-0.394668 2:-0.794872 3:-1 4:-0.871341 5:0.9365 6:0.75597 1 1:-0.463641 2:-0.897436 3:-1 4:-0.871341 5:0.44378 6:0.121824 1 1:-0.469432 2:-0.897436 3:-1 4:-0.871341 5:0.32668 6:0.302529 -1 1:-0.241547 2:-0.538462 3:-1 4:-0.871341 5:0.9994 6:0.987166 1 1:-0.757233 2:-0.948718 3:-1 4:-0.871341 5...