linux

bash/mysql complains about ) character

I'm trying to execute this: $ mysql --user=XXX --password=XXX --batch --skip-column-names \ -e "SELECT userid, displayname FROM Users" stackoverflowdb | \ split -l 50 -a 5 - "result." but bash complains about ) 'unexpected' character (i have this character and few other 'weird ones' in my mysql password). I tried to take my password ...

Changing file permissions in kernel.

I am writing kernel module(C in Linux) and I want to change the permission of the other files in it. any solution? since I am in kernel I can't use chmod syscall and ... thanks for your help This is my Makefile: > obj-m += ca.o > > all: > make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules > > clean: > ...

Clearing output of a terminal program Linux C/C++

I'm interested in clearing the output of a C program produced with printf statements, multiple lines long. My initial guess was to use printf("output1\n"); printf("output2\n"); rewind(stdout); printf("output3\n"); printf("output4\n"); but this produces output1 output2 output3 output4 I was hoping it would produce outpu...

load-time ELF relocation

Hi, I am writing a simple user-space ELF loader under Linux (why? for 'fun'). My loader at the moment is quite simple and is designed to load only statically-linked ELF files containing position-independent code. Normally, when a program is loaded by the kernel's ELF loader, it is loaded into its own address space. As such, the data ...

Options to configure a Linux box from Java

I'm trying to make an java application to manage Linux servers from a web interface. It is a bad idea to perform each task by calling bash shell ? Are there any other options other than those to use C, Perl or another language? ...

Sending shell commands to a Linux server over the network

Is there a tool that will allow me to issue commands over the network without SSH? For example, I'd like to create a new linux box armed with DVD burners and send this command over the network "growisofs -dvd-compat -Z /dev/dvd -dvd-video dvd" with arguments and send the file to burn. The system would be automated so I need something th...

What is the most efficient way to exchange high volume data between 2 process?

Recently I am building the software for a DVR. It will be installed on a x86 pc server with 2 or more PCIE x4 video encoder card plugged in. We have 2 seperated proces, one has to get encoded video data from these encoder card, the other has to save these data to hard driver. Why we have 2 process? Some histroy problem. So, what...

Developing for Linux

Hello Guys, I want to develop multimedia encoder for Linux. I want to make use of ready command line codecs like ffmpeg. I want to build nice GUI for that & pass arguments to command line encoders. I am thinking to use Qt. (Is it possible?) I don't know anything about Linux programming, but I have been an Ubuntu user for 8 months. P...

Linux Terminal: how to capture or watch other terminal session

Let say i access to a server using ssh. In the same time there are another person access that server..is it possible to watch what is going on in that person's terminal..it's mean i can only watching what is he typing... ...

What does the Linux /proc/meminfo "Mapped" topic mean?

What does the Linux /proc/meminfo "Mapped" topic mean? I have seen several one-liners that tell me it is the "Total size of memory in kilobytes that is mapped by devices or libraries with mmap." But I have now spent almost twenty hours searching the 2.6.30.5 kernel source code trying to confirm this statement, and I have been unable to...

Prepend to regex match

I got a variable in a bash script that I need to replace. The only constant in the line is that it will be ending in "(x)xxxp.mov". Where x's are numbers and can be of either 3 or 4 of length. For example, I know how to replace the value but only if it is a constant: echo 'whiteout-tlr1_1080p.mov' | sed 's/_[0-9]*[0-9][0-9][0-9]p.mov...

Multi-process synchronization - better choice than semaphores?

I've got a queue resource that is shared across multiple producers and multiple consumers. All are independent processes; no one process "owns" the queue. By nature of the implementation access to the queue must be controlled and only one process must be allowed to push or pop at any given moment. I figured using a POSIX named semapho...

mmap(2) vs mmap(3)

Does anyone know what the difference between mmap(2) and mmap(3) is? Man section 3 is described as "This chapter describes all library functions excluding the library functions described in chapter 2, which implement system calls." Doesn't mmap(3) perform a system call? Reading the two man pages, I see that mmap(2) seems to accept a m...

Purpose of ibs/obs/bs in dd

I have a script that creates file system in a file on a linux machine. I see that to create the file system, it uses 'dd' with bs=x option, reads from /dev/zero and writes to a file. I think usually specifying ibs/obs/bs is useful to read from real hardware devices as one has specific block size constraints. In this case however, as it i...

Cat magic - end of input

When "cat > xx.txt << EOF" is entered on the command line, further input from cmdline goes to file xx.txt until EOF is written. EOF is not a sacred word here, if instead the command was cat > xx.txt << BBB, then cmdline input goes to xx.txt until BBB is written. I don't know whats the rationale behind ( << end_of_input_sequence)this. C...

How to tell if a full-screen application is running?

Is it possible in python to tell if a full screen application on linux is running? I have a feeling it might be possible using Xlib but I haven't found a way. EDIT: By full screen I mean the WHOLE screen nothing else but the application, such as a full-screen game. ...

Creating GUI with Python in Linux

Quick question. I'm using Linux and I want to try making GUI with Python. I've heard about something like Qt, GTK+ and PyGTK but I don't know what they are exactly and what the difference between them is. Is there any difference on how they work with different DEs like GNOME, KDE, XFCE etc.? Is there any IDE that allows you to create GU...

How to write Flash Action Scripts in Linux machine?

I want to know how to develop flash applications in Linux? Is it possible, then which are the Applications? ...

How to Organize my File/Folders in Linux?

Hi All, I am Using Fedora 10, I would like to organize my files and folders? ie: Suppose I got a .bin file it automatically install all files properly, we don't want to bothered about anything. (Like windows all the files are into the "c:\Program Files"). But in Linux Which is the path for the install files. One of my installation go...

Check the open FD limit for a given process in Linux

Hi, I recently had a Linux process which "leaked" file descriptors: It opened them and didn't properly close some of them. If I had monitored this, I could tell - in advance - that the process was reaching its limit. Is there a nice, Bash\Python way to check the FD usage ratio for a given process in a Ubuntu Linux system? EDIT: I no...