linux

Proper way to run a script using cron?

When running a script with cron, any executable called inside must have the full path. I discovered this trying to run wondershaper, when many errors showed when it tried to call tc. So my question is, what's the proper way to overcome this problem? Possible solutions: cd to the executable folder and prepare symbolic links to any othe...

Create AppleDouble formatted file in Linux

Hello, I'm working on an application that syncs data. For Mac OS, files are uploaded and if they contain resource fork information, the fork is read and stored as a string using: file/..namedfork/rsrc Users can access their files using a Web application(Java) that's running on a Linux server, is there a way that I can generate a valid...

how do I find out what program's on the other end of a local socket?

A process on my Linux system, strace tells me, is talking on a socket which has file descriptor 10. lsof tells me that this is a unix socket with inode 11085, and netstat further tells me that inode 11085 a stream socket, and that it's connected. Given that this process doesn't have any other threads, there must therefore be another pro...

BASH: Possible to abort shell script if any command returns a non-zero value?

I have a Bash shell script that invokes a number of commands. I would like to have the shell script automatically exit with a return value of 1 if any of the commands return a non-zero value. Is this possible without explicitly checking the result of each command? e.g. dosomething1 if [[ $? -ne 0 ]]; then exit 1 fi dosomething...

POSIX ACLs and the 'sticky' bit applied to a directory

POSIX.1e was going to define ACL (Access Control List) mechanisms for POSIX (amongst other security-related issues), but the proposals were never converted to a formal standard. Nevertheless, ACLs (not necessarily POSIX.1e ACLs) are supported at least optionally in all the main variants of Unix (Linux, BSD, MacOS X(ACL), HP-UX, AIX (p10...

how to get the command line args passed to a running process on unix/linux systems?

On SunOS there is pargs command that prints the command line aruguments passed to the running process. Is there is any similar command on other Unix environments? ...

Are there any small Unix or BSD distributions?

I was wondering if there are any small BSD or unix releases. The smallest Linux release I've seen that looked good is partedmagic (around 70MB). Free BSD needs like 4 CDs, maybe more. ...

About the pid of the process

I've a somewhat silly question, if i have a series of processes that are created ... these are not necessarily some sort of inheritance, the pid of the processes have to be numbers continuous or random pids ? ...

Where does glibc get its database of unicode attributes?

Where does glibc get its database of unicode attributes, for such functions as eg, wcwidth()? I'm interested in correcting a few errant entries, but I can't seem to find where this information is in its source distribution. If it matters, I'm primarily interested in this under debian or ubuntu linux. ...

Linux socket programming debug?

Hi, I have a function just like this: static int rcv_kern(int sock, void *buf, int len, struct sockaddr *addr, socklen_t *addrlen) { struct timeval timeout = {1, 0}; fd_set set; int status; FD_SET(sock, &set); if ((status = select(sock + 1, &set, NULL, NULL, &timeout)) == 0) { FD_ZERO(&set); fprintf(s...

64 Bit Error?

relocation truncated to fit: R_X86_64_PC32 against `.bss' I'm getting this linker error in g++ when compiling: The rest of the code isn't material since this definition breaks my compilation. The time function is found in sys/time.h. Compiled on 64-Bit RHEL. long ntime() { struct timeval tp; gettimeofday(&tp, (struct ti...

How can I remove a file "--remove-files"?

I tested: rm \-\-remove-files but I am unable to remove it. How can I do it? ...

Which system can one call "Embedded Linux based"?

I am working on SBC(Single Board Computer) board with Red Hat Linux, which is being used to get information from many routers and process packets. Can this Gateway be called an "Embedded Linux based" product? ...

How to allow file uploading outside home directory with SSH?

I'm running a Fedora 8 Core server. SSH is enabled and I can login with Transmit (FTP client) on port 22. When logged in, I can successfully upload files to the users home directory. Outside the home directory I can only browse files, not upload/change anything. How can I allow file uploading to a specific directory outside the users hom...

Does SCTP works as advertised using Linux?

I am planning to use SCTP for a embedded Linux project. Anybody has some comments on SCTP usage, mostly in one-to-many mode? Did it beat using a home-made UDP-based equivalent solution? I control the network environement and all devices involved, so compatibility is not an issue. ...

Flash trace output in firefox, linux

I'm developing an applications which I've got running on a server on my linux desktop. Due to the shortcomings of Flash on Linux (read: too hard) I'm developing the (small) flash portion of the app in Windows, which means there's a lot of frustrating back and forth. Now I'm trying to capture the output of the flash portion using flash tr...

iptable rule to drop packet with a specific substring in payload

Hi, i am trying to write rules to drop any packet, irrespective if it is outgoing, incoming or being forwareded, which has a specific sub string in the tcp or udp payload, how am i suppose to do that? ...

Network-aware wx.FileDialog

Hi all, I'm using wx.FileDialog in a wxPython 2.8.8.0 application, under Xubuntu 8.10.. My problem is that this dialog isn't network-aware, so I can't browse Samba shares. I see that this problem plagues other applications too (Firefox, Audacious...) so I'd like to ask where I could find informations on how to make it work. Is that dialo...

Rebind a socket to a different interface

Is there an existing Linux/POSIX C/C++ library or example code for how to rebind a socket from one physical interface to another? For example, I have ping transmitting on a socket that is associated with a physical connection A and I want to rebind that socket to physical connection B and have the ping packets continue being sent and re...

PHP Errors on a cronjob, works fine at prompt.

I am running the following script on a cronjob... cd /etc/parselog/ php run_all.php >/dev/null and am getting the following errors: [05-May-2009 20:30:12] PHP Warning: PHP Startup: Unable to load dynamic library './pdo.so' - ./pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0 [05-May-2009 20:30:1...