unix

Enthought Python, Sage, or others (in Unix clusters)

I have access to a cluster of Unix machines, but they don't have the software I need (numpy, scipy, matplotlib, etc), so I have to install them by myself (I don't have root permissions, either, so commands like apt-get or yast don't work). In the worst case, I will have to compile them all from source. Is there any better way to proceed...

symlink files newer than X age, then later remove symlink once file ages?

Hello everyone, i have a large number of files/folders coming in each day that are being sorted automatically to a wide variety of folders. I'm looking for a way to automatically find these files/folders and create symlinks to them all within an "incoming" folder. Searching for file age should be sufficient for finding the files, however...

after dup2, stream still contains old contents?

so if I do: dup2(0, backup); // backup stdin dup2(somefile, 0); // somefile has four lines of content fgets(...stdin); // consume one line fgets(....stdin); // consume two lines dup2(backup, 0); // switch stdin back to keyboard I am finding at this point.. stdin still contains the two lines I haven't consumed. Why is that? Because the...

Understanding the concept of Inodes

I am referring to the link: http://www.tux4u.nl/freedocs/unix/draw/inode.pdf I am confused on parts: 12 direct block pointers 1 single indirect block pointer 1 double indirect block pointer 1 triple indirect block pointer Now the diagram says that each pointer is 32/64 bits. [Query]: Why and how are these values inferred? I mean w...

How to trace a raw (character) device stream on Unix ?

I'm trying to trace what is transiting in a raw (character) device on an Unix system (ex: /dev/tty.baseband) for DEBUG purpose. I am thinking of creating a deamon that would: upon start rename /dev/tty.baseband to /dev/tty.baseband.old. create a raw node /dev/tty.baseband spawn two threads: Thread 1: reading /dev/tty.baseband.old writ...

Exit SSH from the script

I Want to exit ssh: How does the below line work: ssh -f -T ${USAGE_2_USER}@${USAGE_2_HOST} Or do i need to write it some other way . Please tell should I use exit with ssh an how? I am using ssh in my script . I want to exit from it after the execution of it, with out showing them up in the proccess. ...

Is this safe? Is this OK to do in MYSQL?

I have always done this: mysqldump -hlocalhost -uuser -ppass MYDATABASE > /home/f/db_backup/MYDATABASE.sql mysql -uuser -ppass MYDATABASE < MYDATABASE.sql But, if I do this instead...is this safe? Is this identical to the above??? mysqldump -hlocalhost -uuser -ppass MYDATABASE | gzip > /home/f/db_backup/MYDATABASE.sql.gz zcat MYDATAB...

What's wrong with this statement in Perl?

print "$_", join(',',sort keys %$h),"\n"; It's giving me an error below: Use of uninitialized value in string at missing_months.pl line 36. 1,10,11,12 this print statement is present in a for loop as below: foreach my $num ( sort keys %hash ) { my $h = $hash{$num}; print "$_", join(',',sort keys %$h),"\n"; } ...

expr non-numeric argument shell script

The below check is not working: if [ $LEN = `expr $CNPROC + $CTotal` ]) and returns expr non-numeric argument shell script. Always it is going to else. Please tell me what is the mistake. Earlier I was not using while so the same thing was working fine now suddenly when I did put it in the while loop it is no working. #!/usr/bin/ks...

what's the use of 0 in wait system call?

Hi, The syntax for the wait system call is pid= wait(&var) where pid is the process id of child and var is the variable which will contain the reason for exiting child. But what happens when we use wait((int *)0)? What does it exactly mean? Thank you. ...

books about Firewall development

Hi, i was just asked today, but i couldn't answer precisely so that's why i'm asking here :-) There is any book about Firewall design and implementations (Unix environment and C)? For sure, i could recommend TCP/IP books, and what i did, but there is some design decisions, that are not related with TCP/IP. For sure, i said about the n...

How can I configure vim so that when I send the process a USR1 signal it saves and quits (as opposed to creating the .swp recovery file)

Here's my situation. I have a bunch of vim processes open. Rather than go through one by one and save/quite (:x!) I'd like to send all of the processes a signal - say USR1 - and instead of having it create a recovery .swp file, I'd like it to save the file and exit normally. Possible? ...

What is the difference between $@ and $* in shell scripts ?

In shell scripts, what is the difference between $@ and $* ? Which one is the preferred way to get the script arguments ? Are there differences between the different shell interpreters about this ? ...

Any info about book "Unix Internals: The New Frontiers" by Uresh Vahalia 2nd edition (Jan 2010)

This summer I'm getting into UNIX (mostly *BSD) development. I've graduate level knowledge about operating systems. I can also understand the code & read from here and there but the thing is I want to make most of my time. Reading books are best for this. From my search I found that these two books The Design and Implementation of th...

Get file name before the extension

I have some files in the same directory (in UNIX filesystem) that looks like: a.txt.name b.xml.name c.properties.name a.txt.name2 b.xml.name2 c.properties.name2 How do I get the string before the name or name2 part using some shell command? ie. the a.txt, b.xml, c.properties part? ...

Does deleting 'M'odified line in SVN Commit have an effect

When running the commandsvn ci you get a text editor that allows you to place a comment, below that is there is the text "--This line, and those below, will be ignored--", then the files modified, added, or deleted. If I were to delete a line such as: M folderA/fileA Would it remove that file from the check in, or is that just an SVN ...

How can I wrap an executable on UNIX (SunOS) so that it is never run more than once at the same time?

I have an executable (no source) that I need to wrap, to make sure that it is not called more than once at a time. I immediately think of some sort of queue wrapper, but how do I actually make it so that my wrapper is called instead of the executable itself? Is there a better way to do this? The solution needs to be invisible because the...

Commons VFS and IBM MVS System

Hello All, I'm using Apache Commons VFS / SFTP, we are trying to download files from the IBM MVS system. The download part is all good, however, we can not open up the zipped files after downloading. Seems like the zip file was compressed using a different algorithm or something Anyone has any pointers? *Note, the same function wo...

How to use FTP get/put from Solaris to IBM Mainframe?

Hi there, For some reason when I try to use get or put from a Solaris box to an IBM mainframe, the ftp client appears to hang. I've tried all sorts of different variations (for example, including using quotes and not), and all I ever get is a "200 Port Request OK". But I never get the prompt back, and eventually the connection breaks. ...

Finding File WIth Fixed File Size (>0) in Unix/Linux

I have a list of file that looks like this 4 -rw-r--r-- 1 neversaint hgc0746 53 May 1 10:37 SRX016372-SRR037477.est_count 4 -rw-r--r-- 1 neversaint hgc0746 53 May 1 10:34 SRX016372-SRR037478.est_count 4 -rw-r--r-- 1 neversaint hgc0746 53 May 1 10:41 SRX016372-SRR037479.est_count 0 -rw-r--r-- 1 neversai...