unix

Core dump of a multithreaded program

Hi, i have regularly worked with single threaded programs. i never saw a multithreded program crashing since i havent worked on any. is there any difference between both the core dumps? is there any additional information provided in the core dump of a multithreaded program when compared to a single threaded program? ...

"/bin/sh 'ls -l -R'" vs "/bin/sh -c 'ls -l -R'"

What is the difference between the following two commands, when run on AIX? /bin/sh 'ls -l -R' /bin/sh -c 'ls -l -R' ...

Unix: prepending a file without a dummy-file?

I do not want: $ cat file > dummy; $ cat header dummy > file I want similar to the command below but to the beginning, not to the end: $ cat header >> file ...

Export MySQL to CSV using UNIX

Is it possible to Export a MySQL to a CSV using the command line in UNIX? ...

How do I do multiple processes for Django, on my WSGI apache?

My friend says that Django only has 1 thread or something? And I have to edit my 000-default in order to add more processes? He suggests 4 or 5. What exactly is this, and what do I have to do? Thanks, I'm a noob. ...

Unix and FreeBSD

My final goal is to write the program which can run on the Unix OS. I know that there are many Unix versions, and don't know exactly for now which one I need to support. I cannot install any Unix OS right now. The only thing I can do is to use free OS which is close to Unix as much as possible. Is FreeBSD a good choice for this? I know t...

Why can't my Apache see my media folder?

Alias /media/ /home/matt/repos/hello/media <Directory /home/matt/repos/hello/media> Options -Indexes Order deny,allow Allow from all </Directory> WSGIScriptAlias / /home/matt/repos/hello/wsgi/django.wsgi /media is my directory. When I go to mydomain.com/media/, it says 403 Forbidden. And, the rest of my site doesn't work because all st...

Is there a way to determine a terminal's background color?

Hello folks. (not sure if this question belongs here or to superuser) I'd like to know if there is any way to determine a terminal's background color ? In my case, using gnome-terminal. It might matter, since it's entirety up to the terminal application to draw the background of its windows, which may even be something else than a plai...

Using a database/index sequential file independently of the Unix distribution

What I'm planning to do is a) parse a file for some lines matching a regular expression b) store the match in some sort of database / file so I don't have to do the parsing again and again c) call another program passing the matches as arguments While I can imagine how to do a) and c), I'm a little bit unsure about b). The matches are o...

How do I maximize code coverage?

Hey all, the following is a snippet of code taken from the unix ptx utility. I'm attempting to maximize code coverage on this utility, but I am unable to reach the indicated portion of code. Admittedly, I'm not as strong in my C skills as I used to be. The portion of code is indicated with comments, but it is towards the bottom of the bl...

Hopping from a C++ to a Perl/Unix job

Hi all, I have been a C++ / Linux Developer till now and I am adept in this stack. Of late I have been getting opportunities that require Perl, Unix (with knowledge of C++,shell scripting) expertise. Organizations are showing interest even though I don't have much scripting experience to boast off. The role is more in a Support, mainten...

Scanf with Signals

I have a signal that blocks SIGINT and basically says "Sorry, you can't quit.\n" The issue is this can occur during a scanf. When this occurs during a scanf, scanf takes in the printf as input. How can I do a printf that will cause scanf to basically hit the enter key automatically. I don't care that I am getting bad input. I just wan...

confusing fork system call

Hi, i was just checking the behaviour of fork system call and i found it very confusing. i saw in a website that Unix will make an exact copy of the parent's address space and give it to the child. Therefore, the parent and child processes have separate address spaces #include <stdio.h> #include <sys/types.h> int main(void) { pid_t ...

aumix problem- how can I make the changes permenantly

Hai every one. How can I make the changes in the aumix permanently? I am running the aumix application using the following command thinapplaunch aumix. I am increasing the volume manually. I saved and quit. I am again launching that application using the same command. thinapplaunch aumix Now all the changes ...

How to redirect or show a page rather than "Forbidden" when i have directory listings off (htaccess/unix)

Hi, I've set it in htaccess so it won't display the contents of directories, rather it will just show the usual Forbidden page. how can i either: show a certain page or redirect to a certain page rather than just this default "Forbidden" page? thanks ...

Programmatically check if a process is running on Mac

Is there any Carbon/Cocoa/C API available on Macs that I can use to enumerate processes? I'm looking for something like EnumProcesses on Windows. My goal is to check from code whether a process is running (by name). Thanks! ...

Why can't I pipe the output of uuencode to mailx in a single Perl open statement?

Here's my code that is not working: print "To: "; my $to=<>; chomp $to; print "From: "; my $from=<>; chomp $from; print "Attach: "; my $attach=<>; chomp $attach; print "Subject: "; my $subject=<>; chomp $subject; print "Message: "; my $message=<>; chomp $message; my $mail_fh = \*MAIL; open $mail_fh, "uuencode $attach $attach |mailx...

shell script passing subset of arguments

From the wrapper shell scripts i am calling the Java program. I want the Unix shell script to pass all the arguments to java program except the EMAIL argument. HOW Can i remove the EMAIL argument and pass the rest of the arguments to the java program. EMAIL argument can come at any position. valArgs() { until [ $# -eq 0 ]; do ...

clear command in my mac os terminal gives the following error

dyld: Library not loaded: /opt/local/lib/libncursesw.5.dylib Referenced from: /opt/local/bin/clear Reason: image not found Trace/BPT trap ...

Discovering maximum packet size

I'm working on a network-related project and I am using DTLS (TLS/UDP) to secure communications. Reading the specifications for DTLS, I've noted that DTLS requires the DF flag (Don't Fragment) to be set. On my local network if I try to send a message bigger than 1500 bytes, nothing is sent. That makes perfect sense. On Windows the send...