linux

error for gdbserver

Anybody knows the error message? gdbserver[949] segfault at 81c ip 0000081c sp bfeef918 error 4 in gdbserver [8048000+1c0000] segmentation fault Thanks, ...

Is there a good reason to write my own daemonize function instead of using daemon(3)?

There are a lot of example implementations of daemons on the net. Most that I saw do not use the daemon(3) function to run the program in the background. Is that just a matter of taste, ignorance, or is there a good reason to write my own daemonize function? Is there a specific disadvantage in using daemon(3)? Is it insecure? ...

linux background card swipe reader

I currently have a USB card swipe attached to an embedded linux machine and from what I can tell and from what I have researched it acts as a keyboard, and inputs all the data as if I were typing. Now I have a perl script that takes all this data and saves it to a file. The only problem is, it only knows to take the data when the perl sc...

video conferencing stack for embedded devices

I am looking for a video conferencing stack that I can run on an embedded device. Cam will be connected through USB, hw video acceleration and ethernet is available. We are running linux & directfb. Any suggestions? ...

synchronizing files and symlinks between two linux os.

I am facing with the bug following: https://bugzilla.samba.org/show_bug.cgi?id=4531 rsync will always get the older symlink of the other side overwrite the newer one on the local side. Wayne has suggested to use unison, however it is a non-developing old project that I have suspect to use. What can you suggest me for ? My main aim is...

Rails sends 0 byte files using send_file

I can't get send_file(Model.attachment.path) to work. It doesn't fail, instead, it sends a 0 byte size file to the client, the file names are correct though. This problem started happening after I did a big migration from Rails 2.3.8 to 3. There were a lot of other things that took place in this migration and I will try my best to deta...

Is it safe to thread after forking?

I've learned that you should usually stick with either forking or threading to avoid running into very strange and extremely hard-to-debug problems, so until now I always did exactly that. My problem with the matter is that when I stick with only forking, creating many short-lived processes to distribute chunks of work to gets the more e...

In LINUX , everything is considered as a file .Please explain.

In LINUX , everything is considered as a file .Please explain. ...

Is Ruby on Rails solution to async notify iPhone app of updates?

I starting to investigate whether Ruby-on-Rails will help solve my problem in some way? In short, I have a legacy Linux system and application which is reading and writing a collection of images. This application also uses a sqlite database to help refer to correct image files when required. What I'd like to do is have an iPhone and/or...

svn script to commit a set of deleted files

Hi, I've deleted many files from my local copy which were present in different sub directories of main directory. I want to remove all the locally deleted files from my SVN repository also. If I'm checking the SVN status of my main directory using svn st main_dir then all the deleted files are showing with '!' symbol which means the co...

Programmatically requesting elevated rights in Linux

(This question has identical title, but question body asks it in scripting point of view, e.g. su -c, don't dupe this to that) I have a Qt GUI app that needs to perform some file operations in /etc based on user input. One option would probably to use system() with sudo, but even that requires messing with sudoers file in some point. I ...

Iptables: Two IP-Adresses, allow Port 3306 just for one

my server has two ip's: # IP one: 192.168.45.1 (allow MYSQL on Port 3306) # IP two: 192.168.45.2 (disallow MYSQL on Port 3306) . how can i configure iptables, to drop incoming connections for a specific IP and allow it to the other? . # # Allow MYSQL-Port only for 192.168.45.1! # /sbin/iptables -A INPUT -p tcp 192.168.45.1 --dpor...

Why does a main function without a return statement return value 12?

I have written a program that prints a table. I have not included the return syntax in the main function, but still whenever I type echo $? it displays 12. My source code : #include <stdio.h> int main(void) { int ans,i,n; printf("enter the no. : "); scanf("%d",&n); for(i=1;i<=10;i++) { ans = n*i; ...

Recover Index File + Overwrite or Hacked by SomeOne + Linux Server

Some body overwrites my index file of every folder at linux server. Is it possible to recover all the files from server to make website in running state. ...

expand an IPv6 address so I can print it to stdout

I am using getifaddrs() and inet_ntop() to get the ip addresses on the system. When the system is set to IPv6 the address returned is in the shortened version (using :: for zeros). Is there any way to expand that address to a full one? This is the code I am using: struct ifaddrs *myaddrs, *ifa; void *in_addr; char buf[64]; if(getifadd...

Linux change group permission to match owner permissions

Suppose I have a directory on Linux with a bunch of files and subdirectories. This is that root directory: drwxr-xr-x 13 user1 group1 4096 May 7 15:58 apps Now, I only want to alter the group portion of those permissions. I want to alter it such that it matches exactly the owner portion. The result for that directory would be: d...

What is the best way to close this group of processes?

I have the following group of processes, which need to be closed programmatically by the first listed process, which is a C program that I am coding. PID PGRP SESN PPID USER TTY CMD 6553 6553 6553 1 root ? ./startserv 6554 6553 6553 6553 root ? expect -- /usr/bin/unbuffer ./srcds_run... 6555 655...

Hard-coding paths in Linux

Coming from Windows background here. Is it an acceptable practice for GUI Linux applications to store their data files (not user-specific) at hard-coded locations (e. g. /etc/myapp/stuff)? I couldn't find any syscalls that would return the preferred directory for app data. Is there a convention out there as to what goes where? ...

Git and hard links

Since git does not recognize symbolic links that point to outside of the repository. is there any problem using hard links ? Git could break them ? Can point me to detailed information ? ...

Process command line in Linux 64 bit

I have problems accessing the process command line from Linux 64 bit Assembly program. To reproduce this with minimal code, I made this 32-bit program which prints first 5 characters of the program name: .section .text .globl _start _start: movl %esp, %ebp movl $4, %eax # write movl $1, %ebx # stdout movl 4(%ebp), ...