unix

Subversion post-commit hook

Hello, I have created a subversion post-commit hook to send out an email everytime a commit is made.Im calling a python script from the file post-commit in /var/svn/repos/hooks . REPOS="$1" REV="$2" ~/svnnotify.py $REV But the problem is that the svn commit command is taking a longer time to terminate as it waits for the python sc...

cscope menu without recreating the database ?

I usually create the cscope database with the command, cscope -bqRv But at times, I just want to access the cscope menu usually got by running, cscope -R This needlessly recreates the cscope database, something, I don't always need. Is there anyway to get to the cscope menu without recreating the database ? ...

C++ program problem

I am new to C++ programming. So I was trying my luck executing some small programs. I am working on HP-UX which has a compiler whose executable is named aCC. I am trying to execute a small program #include <iostream.h> using namespace std; class myclass { public: int i, j, k; }; int main() { myclass a, b; a.i = 100; ...

Oldest code in a typical Linux distro

Just out of curiosity: What's the oldest code/package in a typical linux distro? Emacs? GCC? ...

I never really understood: what is POSIX?

What is POSIX? I read the Wikipedia article and I read it ever time I encounter the term. Fact is that I never really understood what it is. Can anyone please explain it to me by explaining "the need for POSIX" too? ...

setting a gdb exit breakpoint not working?

I've set breakpoints on exit and _exit and my program (multithreaded app, running on linux 2.6.16.46-0.12 sles10), is somehow still exiting in a way I can't locate (gdb) c ... [New Thread 47513671297344 (LWP 15279)] [New Thread 47513667103040 (LWP 15280)] [New Thread 47513662908736 (LWP 15281)] Program exited with code 0177. (gdb) t...

sending mails thru unix shell scripting

Hi I have to write a script to send mails thru unix shell scripts. The following script allows me to have variable message body. Is it possible to have a variable subject part in the bellow code?? #!/bin/bash # Sending mail to remote user sender="[email protected]" receiver="[email protected]" body="THIS IS THE BODY"...

Security test for writing to remote directory

Short question: how can I test whether or not a directory in my website is in practice writable for the rest of the world (even outside my own machine)? Context: I run this website where the hosting provider has implemented an odd security system. To let PHP write files to disk on the (linux) server, the target dir should have write pe...

Switching focus between editor and terminal in Kate

When working in Unix with various programming languages I often use Kate as my primary editor. It has a really nice function of being able to open a built-in terminal window which is quite useful. The problem is that switching back and forth to the terminal view using a mouse is quite a pain and I can't find any shortcuts for this. Th...

mono, c#, sockets, performance

Hi! I developed simple async server that listens to unix socket and sync client that send the some small piece of data. Time between moment when i send data from client to the moment when server receives them is completly random, from 1 to 9 seconds. I wonder why is the reason? Server is implemented as shown in msdn example here (using ...

Bourne Shell Scripting -- simple for loop syntax

I'm not entirely new to programming, but I'm not exactly experienced. I want to write small shell script for practice. Here's what I have so far: #!/bin/sh name=$0 links=$3 owner=$4 if [ $# -ne 1 ] then echo "Usage: $0 <directory>" exit 1 fi if [ ! -e $1 ] then echo "$1 not found" exit 1 elif [ -d $1 ]...

Apache virtual host configuration on debian

Migrated to Server Fault Apache virtual host configuration on debian Im new to apache configuration and would be really glad if someone helped me with the following.Im running apache on a virtual private server, running the debian operating system. In /etc/apache2/sites-available, i have two virtual hosts defined,site1.com.conf and si...

How do I find out what options git-diff uses when it invokes less?

I want to reproduce the pager behavior that git-diff uses but I don't know how. Is there a way I could find out what options it uses with less? I already tried this: strings "$(dirname $(which git-diff))/*" | grep 'less ' And this (while less was running): ps aux | grep less <= Didn't show me which options it was using. I'm on Darwin....

Descriptor passing with unix domain sockets

When we want to pass a descriptor from child to process, UNP V1(Unix network programming V1) specifies a complex procedure of doing this, first to create msghdr struct and then something, etc. Why cant we pass a descriptor as normal data means as we do send , recv for other data through unix domain sockets? I am able to understand the p...

Fetching unix users from SQL Server

Hi, We have some tables where we store some sensitive information. These tables have one extra column "ModifiedBy". Currently we insert the value for this column programmatically. I am wondering if we have some way to get the current unix user into SQL Server. The idea is to auto-populate the user name/id into that column with the use ...

Orphan child process in UNIX [ksh]

UID PID PPID C STIME TTY TIME CMD "usename" 70986 1 23 14:41:59 - 250:37 [ksh] I have this child process running on my UNIX server. The PPID for this process is "1" so and there is no TTY attached to this process. So I am not able to kill it... kill -9 70986 completes with retun code ZERO but does not do anything... Worst thing is tha...

Implementing DHCP client

On unix using C, my client is listening on port 68 with superuser mode. After sending DHCP discover message, when I try to receive, it blocks in recvfrom means there is no message received or is it like system has a process (DHCP client) listening on same port 68 which receives the message and thats my process are not able to receive th...

log file creation problem in unix

i have command ccv this will output as below Your Project : gdgdd750V64OG , Building Block : cgd9gdd . if i do ccv | awk '{ print $9}' cgd9gdd now i am tring to create a log file by running a build process & tee log_`date +%Y%m%d%H%M%S`_`ccv | awk '{ print $9}'` but this is not creating the log corrrectly. ins...

Converting Date and Time To Unix Timestamp

I'm displaying the date and time like this 24-Nov-2009 17:57:35 I'd like to convert it to a unix timestamp so I can manipulate it easily. I'd need to use regex to match each part of the string then work out the unix timestamp from that. I'm awful with regex but I came up with this. Please suggest improvements ^.^ /((\d){2}+)-((Ja...

Ideas for my "advanced UNIX" school program

I am sorry, that I am bringing my school stuff here, but I am out of ideas. I am attending an "advanced UNIX programming" course, and we have to make a proposal for the program, which, if accepted, we have to finish later and will get credits. The thing is, I try to think something original, but I can't think of anything that is both i...