I'm using python and dbus. What i really need is a way to get the input from my microphone into my python program and then play it back from the program. I googled a lot and it seems pyaudio might do the trick but pyaudio does not work with my ubuntu 10.04.
The next option i saw was telepathy. But i don't need something that big, eithe...
Using the following simplified code extract:
DIR='a b'
mount_command="./mount.cpfs $loop $DIR -f $OPTS"
sudo $mount_command
Executes this line when trace is on:
+ sudo ./mount.cpfs /dev/loop0 a b -f -o default_permissions,allow_other,attr_timeout=0
But DIR is not quoted, and so a and b are passed as different parameters, rather tha...
Hi, there. On Linux, is there any way in which I could shutdown the system if none action is taken by the user in some time(e.g. 30 minutes)?
Thanks in advance.
...
I am writing to a text file using the write function with the file descriptor set a O_NONBLOCK.
fd = open(filepath, O_RDWR | O_NONBLOCK , 0777);
write(fd, string, size);
The questions I have are as following:
How large is the file buffer size until it is blocked?
If I am using O_NONBLOCK as above, what would happen if the buffer i...
Good time of day! Prompt please me, where can I find information about creating a system of plug-ins in C + +? linux
...
I installed zeromq on ubuntu 10.04 and the compilation went through without any errors.
However when i try to run the python test, it results in this error:
jerome@VM1:~/zeromq/pyzmq-2.0.7$ python setup.py test
running test
Traceback (most recent call last):
File "setup.py", line 144, in <module>
'Topic :: System :: Networking'
...
I'm trying to detect whether I am running on a virtual environment (vmware, virtualbox, etc)
On Windows I've use several ASM but I can't use them in Linux, mainly because the code might be compiled and run on either 32 or 64 bit Linux.
The following code works on both Windows 32 and 64 and was tested on VMWare, virtualbox and other virt...
How to capture all keyboard strokes using shell script .Is there any command that is related to keyboard activities.
...
The man page on fork() states that it does not copy data pages, it maps them into the child process and puts a copy-on-write flag. Is that behavior:
consistent between flavors of Linux?
considered an implementation detail and therefore likely to change?
I'm wondering if I can use fork() as a means to get a shared read-only memory blo...
I guess some signals will be sent to the process. Some or one? If more than one in which order do they occure?
And what happens if the Terminate button is pressed and if the process has forked?
And what happens if the process has started other processes by system(...)?
...
What would you suggest as a starting project for learning essential Linux programming skills? I don't mean just coding something in Linux, but really Linux specific stuff, in the spirit of having something tangible to show in a job interview where Linux skills are required.
Also stories on how you got started with Linux coming from othe...
I have a single Linux server running 3 site on Apache. Let's call them RailsApp1, RailsApp2, and SimpleApp. Both Rails applications are using Mongrel clusters. The other application is just a single HTML file. I have different Virtual Host files setup in Apache for each site, as well as mongrel_cluster.yml files for both Rails sites (cod...
#include <stdio.h>
int main(void)
{
double resd = 0.000116;
long long resi = 0;
printf("%lld %f %lld %f\n", resd, resd, resi, resi);
return 0;
}
gives (Linux, gcc, x64)
0 0.000116 0 0.000116
^^^^^^^^ odd, since the memory for resi is zeroed
Actually, compiled with g++ it gives random r...
I'm making a search engine for our gigantic PHP codebase.
Given a filepath, how can I determine with some degree of certainty whether a file is a text file, or some other type? I'd prefer not to have to resort to file extensions (like substr($filename, -3) or something silly), as this is a linux based filesystem, so anything goes as far...
I have this script which processes lines containing windows file paths. However the script is running on Linux. Is there a way to change the os library to do Windows file path handling while running on linux?
I was thinking something like:
import os
os.pathsep = '\\'
(which doesn't work since os.pathsep is ; for some reason)
My sc...
If I rsync a directory with some remote directory under an sshfs
management, even if the rsync process finishes synching the
directory contents, there seems to be a time lag for the sshfs
directory to get updated. It is unintuitive and makes some
automation process relying on sshfs contents unstable.
How do I eliminate the lag?
...
So I have a python script that relies on a couple modules. Specifically pexpect and pyinoitify. I know you can compile a python script into a .exe in windows, but is there something relatively equivalent in linux? I don't care about it being a binary, I'd just like to be able to distribute my script without requiring the separate install...
I have a folder with about 1700 files. They are all named like 1.txt or 1497.txt etc. I would like to rename all the files so that all the filenames are 4 digits long.
IE 23.txt becomes 0023.txt.
What is a shell script that will do this? Or a related question: How do I use grep to only match lines that contain \d.txt (IE 1 digit, t...
First of all, I'd like to point out that I have no experience using Mono.NET, so bear with me if the questions are silly.
I'm working on an application that is written in native C++ code and works in Windows (VS2008) and Linux/Mac (gcc). There is a library that I am looking to integrate with, which is currently compiled in MS.NET (versi...
I have been trying to figure out how a shell knows which directory you're currently in. I know there is an environment variable $PWD but when I try changing it manually, it changes what my shell shows at the prompt but commands like ls and cd are unaffected.
cd is an internal shell command so I can understand it might use info stored wi...