unix

Samba, other non interactive accounts - noshell, nologin, or blank?

Conducting a user account cleanup accross Solaris and Redhat linux systems, many of which have a number of Samba shares. What preference do people have for creating the local unix accounts for non interactive Samba users? In particular, the shell entry: noshell nologin blank And why? JB ...

Why does Imake interpret certain words in a Imakefile to numerical values?

I've found it very difficult to find any existing documentation on this. What I'm trying to find out is why Imake would interpret a word such as "unix", "linux" or "i386" to a number 1 in the produced Makefile? I'm sure it is a function of indicating whether or not your on that system or not. I've not been able to find that this is a ...

Interfacing with telephony systems from *nix

Does anyone know of any 'standard' way to interface with a telephony system (think Cisco CCM) from a C/C++ app in *nix? I have used MS TAPI in the past but this is Windows only and don't want to go the jTAPI (Java) route, which seems to be the only option on the face of it. I want to monitor the phone system for logging purposes (so I ...

Network Socket command

Unix.....>>netstat -al | grep 8787 (will see packets on port 8787) ...

Unix Proc Directory

I am trying to find the virtual file that contains the current users id. I was told that I could find it in the proc directory, but not quite sure which file. ...

Symlink in windows XP

Hi, there. The question is how to make the similar thing like symlink in windows like in *nix. It's really hard to write whole path to the file in console (even using [tab], it's not the way if you need to change language). Adding everything in PATH is tiring too. It'll be great to make a symlink running one command. Actually I'm lookin...

What process is listening on a certain port on Solaris?

So I log into a Solaris box, try to start Apache, and find that there is already a process listening on port 80, and it's not Apache. Our boxes don't have lsof installed, so I can't query with that. I guess I could do: pfiles `ls /proc` | less and look for "port: 80", but if anyone has a better solution, I'm all ears! Even better if I...

Checking if a directory contains files

How do I check if a directory contains files? Something similar to this: if [ -e /some/dir/* ]; then echo "huzzah"; fi; but which works if the directory contains one or several files (the above one only works with exactly 0 or 1 files). ...

Automated naming of AF_UNIX local datagram sockets?

I'm implementing a simple service using datagrams over unix local sockets (AF_UNIX address family, i.e. not UDP). The server is bound to a public address, and it receives requests just fine. Unfortunately, when it comes to answering back, sendto fails unless the client is bound too. (the common error is Transport endpoint is not conne...

Alternative to 'truss -p' instruction

I am looking for a command in Unix that returns the status of a process(active, dead, sleeping, waiting for another process, etc.) is there any available? A shell script maybe? ...

How do you run a script on login in *nix?

I know I once know how to do this but... how do you run a script (bash is OK) on login in unix? ...

emulate unix 'cut' using standard windows command line/batch commands

Is there a way to emulate the unix cut command on windows XP, without resorting to cygwin or other non-standard windows capabilities? Example: Use tasklist /v, find the specific task by the window title, then extract the PID from that list to pass to taskkill. ...

gdb: how to set breakpoints on future shared libraries with a --command flag

I'm trying to automate a gdb session using the --command flag. I'm trying to set a breakpoint on a function in a shared library (the Unix equivalent of a DLL) . My cmds.gdb looks like this: set args /home/shlomi/conf/bugs/kde/font-break.txt b IA__FcFontMatch r However, I'm getting the following: shlomi:~/progs/bugs-external/kde/font...

In bash, environmental variables not tab-expanding correctly

In bash, environmental variables will tab-expand correctly when placed after an echo command, for example: echo $HOME But after cd or cat, bash places a \ before the $ sign, like so: cd \$HOME If I use a variable as the second argument to a command, it won't expand at all: cp somefile $HOM What mysterious option do I have in my ...

Bash prompt in OS X terminal broken

I am using bash in os X Terminal app, and my custom $PS1 breaks when I scroll through my history. PS1="${BLUE}\u${CYAN}@${RED}\h${BLUE}\w\n\[${red}\$${NC}\]" also tried PS1="${BLUE}\u${CYAN}@${RED}\h${BLUE}\w\r\n[${red}\$${NC}]" The problem seems to be in the newline. I have used this bash prompt on Slackware no prob. ...

lsof survival guide

lsof is an increadibly powerful command-line utility for unix systems. It lists open files, displaying information about them. And since most everything is a file on unix systems, lsof can give sysadmins a ton of useful diagnostic data. What are some of the most common and useful ways of using lsof, and which command-line switches are u...

What is the recommended version of GNU autotools?

We maintain a RPM based software distribution at work so that we have a common set of software across all the platforms that we support. As a result we have to build a lot of third party software, and frequently find situations where we need to run autoconf/automake/libtoolize/etc to get it to build on Solaris or another platform. I'...

How do you recursively unzip archives in a directory and its subdirectories from the Unix command-line?

The unzip command doesn't have an option for recursively unzipping archives. If I have the following directory structure and archives: /Mother/Loving.zip /Scurvy/Sea Dogs.zip /Scurvy/Cures/Limes.zip And I want to unzip all of the archives into directories with the same name as each archive: /Mother/Loving/1.txt /Mother/Loving.zip ...

How do I remove the passphrase for the SSH key without having to create a new key?

I set a passphrase when creating a new SSH key on my laptop. But, as I realise now, this is quite a PITA when you are trying to commit(git,svn) to a remote location over SSH many times in an hour. One way I can think of is, delete my SSH keys and create new. Is there a way to remove the passphrase, while still keeping the same keys? A...

How do I run a script when ip-address changes (most likely using a dhclient hook) on a (Ubuntu) Linux machine?

Hi, I have a script which contacts a few sources and tell them "the IP-address XXX.XXX.XXX.XXX is my current one". My test web server has a dynamic IP-address through DHCP and amongst other things it needs to update a DDNS entry when its IP-address changes. However it's not the only thing it does, so I will need to run my own custom scr...