Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs.

learn more… | top users | synonyms

15
votes
3answers
7k views

Override MAILTO for a single crontab entry

We have a role account at work that has a pretty big crontab. Its MAILTO is pointed at a shared address, so that a number of us get notified if something fails. I'd like to add an entry to this ...
29
votes
7answers
54k views
1
vote
0answers
28 views

Simple anti DDoS protection in FreeBSD [duplicate]

I have a lot of request from data centers to my web server on FreeBSD and sometimes it've have a lot of performance problem with my web projects. Adding to IPFW list all IP's data centers is ...
0
votes
2answers
63 views

Moving files between hosts using intermediate storage area [closed]

Is there any good existing solution for moving files from host A to host C, using host B a an passive intermediate storage area. A -> B -> C Limitations Host A and host C are on separate networks ...
1
vote
2answers
78 views

Crontab - How to determine current active processes started by cron

We have a very sensitive application which heavily makes use of crontab and we would like to track of how many processes started by crontab are still running. In short, we have a limit of 300 cron ...
-3
votes
1answer
255 views

Change existing file type from standard file “-” to directory “d” as shown with Unix ls -l

In summary, if I use ls -l it yields something for a directory like... drwxr-xr-x and the reported error for a directory with files in it, is it shows as a standard file and ls -l yields... ...
1
vote
2answers
111 views

Finding out what happened that I cannot connect to SFTP server?

We have a server with Windows Server Enterprise that runs a simple console app that connects to another server via SFTP in order to download files. I believe the remote server is Unix server, but I'm ...
3
votes
1answer
341 views

Limiting memory usage and minimizing swap thrashing on Unix / Linux

I have a few machines that I machine that I use for running large numbers of jobs where I try to limit the number of jobs so as not to exceed the available RAM of the machine. Occasionally I ...
1
vote
1answer
61 views

Why does denyhosts `hosts-restricted` file have contents when there are no `restricted-usernames`?

I have a user that is getting blocked by denyhosts on a daily basis after some initial problems and confusion with keys, passwords, account names and such, even though I keep unblocking him. When I ...
23
votes
7answers
4k views

Can a program tell it is being run under sudo?

I have a program that should behave differently if it is being run under "sudo". Is there a way it can find out if it was run under sudo? Update: Someone asked why would I want to do this. In this ...
16
votes
2answers
6k views

Making libmagic/file detect .docx files

As seen elsewhere, docx, xlsx and pttx are ZIPs. When uploading them to my web application, file (via libmagic andpython-magic) detects them as being ZIP. I store the contents of the file as a blob ...
1
vote
3answers
338 views

Accidentally overwrote file instead of appending. Is there hope?

I accidentally did this: command > ~/.bash_profile Instead of command >> ~/.bash_profile I know, I'm an idiot. Is there a way to recover the old .bash_profile file? Thanks a lot for ...
1
vote
2answers
206 views

find all end subdirectories in a tree

given the following structure: oz123@debian:~/ $ tree . . ├── a │   ├── a1 │   ├── a2 │   └── a3 ├── a1 │   ├── a11 │   ├── a12 │   └── a31 ├── b │   └── b1 │   ├── b11 │   │   └── b21 │   ...
0
votes
2answers
151 views

Why can't I cd to a root owned folder, as a member of the root group? [closed]

I verified I'm a member of root: user_me@host1:~$ sudo useradd -G root user_me useradd: user 'user_me' already exists However, I can't cd to /root/testing from my user: user_me@host1:~$ cd ...
5
votes
4answers
10k views

how to export VARs from a subshell to a parent shell?

I have a Korn shell script #!/bin/ksh # set the right ENV case $INPUT in abc) export BIN=${ABC_BIN} ;; def) export BIN=${DEF_BIN} ;; *) export BIN=${BASE_BIN} ;; esac # exit 0 <- ...
0
votes
3answers
2k views

sed replace unix path with variable that contain another unix path [closed]

I need to replace Unix path via sed with variable that contain another unix path in a bash script Example: another_unix_path=/another/unix/path sed -i 's/ \/some\/path\/file.txt/ ...
0
votes
0answers
16 views

Expand variable in system.d configuration files

I am wondering if it is possible in a system.d configuration file to expand variables as in a shell. The proxy configuration must be defined in HTTP_PROXY, http_proxy, HTTPS_PROXY, https_proxy and ...
35
votes
9answers
35k views

How to reduce memory usage on a Unix webserver

I'm currently using a Joyent Accelerator to host my webapps, and it's working fine, however I need to reduce costs so I'm downgrading my current plan and that imposes some new memory limits (256M rss, ...
7
votes
2answers
99 views

Setting timezone to UTC in unattended install

In FreeBSD, I'd like to set the timezone to UTC in an unattended way. If I run tzsetup, and select "yes" and "a" in the dialogs, for choosing UTC, I see that there are no /etc/localtime files present. ...
-1
votes
4answers
2k views

need to make password less login for same linux server with same user [duplicate]

I need to make passwordless login for same linux server with same user. [airwide@eir ~]$ hostname -i 10.3.7.73 [airwide@eir ~]$ ssh airwide@10.3.7.73 airwide@10.3.7.73's password: how can make to ...
0
votes
1answer
60 views

WUFTP: sleeping: fcntl lock of pid file failed: Permission denied

Our main and largest FTP server, which uses wuftpd as FTP server software is facing constant drops of connection. It has been running for years now, all of suddenly, is presenting this problem. ...
2
votes
0answers
156 views

Unix Server Vs Windows in application deployment (Not a web application) [closed]

Ok, I was browsing through a lot of forums, but I couldn't get a very convincing answer for the same. My question is - What is the advantage of deploying an application in UNIX server instead of ...
8
votes
3answers
13k views

how to find files with incorrect permissions on unix?

I'm looking for a way to search a directory or directories and list all the files that have the wrong permissions for a public directory.
16
votes
4answers
14k views

What are the advantages/disadvantages of hard versus soft mounts in UNIX?

This question may vary between distros but, in general, what are the advantages/disadvantages of using a hard or soft mount in the UNIX world? Are there certain situations where one is more ...
3
votes
2answers
56 views

Can idle NFS mounts on several clients impact performance

We had a NFS server at work which was working with slight lag. However as more mount points were getting created at several clients(serviced by the same server) we noticed the performance coming to a ...
0
votes
1answer
261 views

Postgres /root": Permission denied

why on ubuntu 14.10 every time that i try to start the postgres on: sudo -p 'sudo password: ' -u postgres /usr/lib/postgresql/9.4/bin/initdb -D /mnt/postgresql/9.4/data show this: could not ...
0
votes
0answers
423 views

NAT with IPFW in FreeBSD without divert

I'm using IPFW and trying to do NAT on my LAN (FreeBSD 11). I'm following https://forums.freebsd.org/threads/ipfw-nat-setting.46929/ but I can't get it working. The FreeBSD manual uses divert which is ...
7
votes
8answers
7k views

Linux - use “su -” but keep the current directory

When I do su - to get to root, my current directory is set to root's home. Is there anyway to keep the current directory that I was in, much like sudo -s. Or is the answer to use sudo?
2
votes
3answers
2k views

is there any advantage mounting an LV by UUID instead of by path?

I know I can specify mounts in fstab by either putting their path (like /dev/sda1 or /dev/mapper/myvg-logicalVolume1) or by fs label (LABEL=root) or by UUID (UUID=1234-5678-...). I see a clear ...
78
votes
1answer
46k views

How do I change my private key passphrase?

I have an existing public/private key pair, the private key is password protected, the encryption may be either RSA or DSA. These keys are the kind you generate with ssh-keygen and generally store ...
0
votes
0answers
41 views

disable simple paged results control support

Trying to make my client, originally developed for OpenLDAP, also compatible with Oracle DSEE. Oracle DSEE is missing support for simple paged results, which the client code uses. Yet, ODSEE supports ...
0
votes
0answers
142 views

PJSUA playing wave file on state “EARLY”

I'm trying to create a system, where a wave file is generated and then some of our employees are called by pjsua and the wave file is played to them. Everything seems fine, I am running the following ...
3
votes
2answers
1k views

dmesg time vs system time time isn't correct

I hope that here is somebody that can help me with this strange problem. I think that i know why it is happening but i don't know how to solve it. Maybe it is because the BIOS time isn't set correct ...
84
votes
7answers
123k views

How to forcibly close a socket in TIME_WAIT?

I run a particular program on linux which sometimes crashes. If you open it quickly after that, it listens on socket 49201 instead of 49200 as it did the first time. netstat reveals that 49200 is in ...
4
votes
3answers
56 views

Extracting the date of the latest message from an mbox file

How would I go about extracting the "Date:" header for the latest received message in an mbox file? Note that it's not simply an issue of grep'ing for the latest occurrence of "^Date:", since it ...
1
vote
2answers
45 views

Dangers of closing file descriptors

In the Stack Overflow question Check if a program exists from a bash script the accepted answer notes that closing stderr is dangerous: (minor side-note: some will suggest 2>&- is the same ...
0
votes
1answer
176 views

How to lock a user into a directory (not SSH)

I have regular users who are not SSH'd into a machine but are accessing the machine directly. How can I lock them into their home directory or any directory? At the moment they can successfully run rm ...
1
vote
1answer
236 views

Setting Samba passwords using Chef without storing plain text passwords in data bags

We have a server that is configured using Chef. Currently, the way that chef manages the passwords is by simply copying down the samba tdb databases and updating the shadow hashes of each user. ...
3
votes
1answer
50 views

Should I rather explicitly run programs in foreground (instead as a daemon), or `expect fork` when configuring upstart daemons?

Many programs allow to be run either in daemon mode (which is usually the default), or explicitly run it in foreground with a flag such as -f. Now when configuring upstart to run programs like this, ...
8
votes
4answers
17k views

What's a proper way of checking if a PID is running?

I have a .pid file, and I need to check if the process is running. So far I found two options kill -0 `cat something.pid` which prints out an error if the pid isn't running. I know this can be ...
1
vote
1answer
38 views

How can I automate the retrieval and usage of passwords from within a script?

We have automated scripts that access certain devices and are getting the passwords for the devices from a root-read-only plain-text file. Is there some kind of architecture we can use so that we can ...
0
votes
1answer
45 views

CPIO ulimit reached error

I have been googling this without much luck. I hope someone can help here. We have a customer running SCO Unixware 7 machine. This machine does a daily backup to tape. These have stopped running. ...
1
vote
2answers
69 views

How to prevent rsync from chown'ing remote users files

I'm doing rsync /local/path/to/src user1@remote:/path/to/dest. dest belongs to user2@remote. How do I keep rsync from chown'ing dest to user1 after syncing? Please note that I have already tried ...
0
votes
1answer
99 views

Hostname changes history in unix systems

I've been trying to find a command or file that contains all the previous hostnames a Linux/Solaris machine has had, but I can't seem to find any way to do this. The question is really about the ...
0
votes
1answer
78 views

Using PowerCLI Versus using asp.net WMI to scan and retrive informaion about ESX hosts

I want to scan and view information about ESX hosts which have "ESXi 5.0 Update 1" as their OS inside my asp.net web application. mainly to be able to retrieve the ESX specification and all the vms ...
2
votes
1answer
88 views

logrotate compression parameters

I've been using cstream for a while for many things, for example to reduce the impact that mysqldump has on drives. However, I have always done so by calling the binary directly from a script or ...
3
votes
2answers
104 views

Postfix virtual domain mapping for a Linux username containing @

I could not make Postfix work with Linux usernames containing @ Postfix has virtual domain map, in /etc/postfix/virtual It looks something like this: domain.ru domain.ru ...
2
votes
0answers
101 views

what is the the difference between all the NSS caching daemons? [closed]

I would like to see a comparison between nscd (part of glibc), unscd, nsscache, sssd and nss-pam-ldapd. Those are all the alternatives to nscd that i could find in Debian... Our setup is that we ...
33
votes
23answers
53k views

Finding the Public IP address in a shell script

I can find my IP address using ifconfig or hostname -i command. But how do I find my Public IP? (I have a static public IP but I want to find it out using unix command)
0
votes
0answers
135 views

red5 server installation could not resolve dependencies issue

I am trying to install Red5 server on my dedicated VPS server. My server is Ubuntu 12.04. I'm doing my installation over SSH in Terminal on Mac. I have Java 7 JDK and JRE installed. I am doing ...