linux

Uninstall python built from source?

I've installed python 2.6 from source, and somehow later mistakenly installed another python 2.6 from a package manager too. I can't find a way to uninstall a python that was built from source, is this possible/easy? Running ubuntu 10.04 Thanks. ...

Extract Closed captions from dvb-t

I want to be able to get the closed captions from a stream on a dvb-t card on my linux machine. From what I can tell when I use mythtv to view the card it can see the captions and display them on screen. But I would like to have a script running that gathers the captions and places them in a txt file. Card: Winfast DTV1000S / DTV3200 ...

Changing the filename of a memory mapped file

Is it possible to change the name of an already open memory mapped file, or, do I need to close it, rename it and then mmap it again? ...

Compare two files

I have 2 text files to compare on their first column. The following comm command shows the common lines from the 2 files correctly. comm develop1.txt qa1.txt -12 But the following diff command does not show the difference as expected. diff develop1.txt qa1.txt --side-by-side Expected output is as follows: mysql-data/webservice 28...

Simulate Mouse Clicks on Python

I'm currently in the process of making my Nintendo Wiimote (Kinda sad actually) to work with my computer as a mouse. I've managed to make the nunchuk's stick control actually move the mouse up and down, left and right on the screen! This was so exciting. Now I'm stuck. I want to left/right click on things via python when i click A, When...

hexadecimal value of ip into standard format

is there any function in linux to display the value 7d162f7d in the format 125.22.47.125 ie convert the hexadecimal ip address in its standard ip format ...

Packaging proprietary software for Linux

Hi, I'm doing cross-platform development and I want to build a nice, self-contained (!) package for Linux. I know that that's not the way it's usually done, but the application requires all data in one place, so I'm installing it into /opt, like many other proprietary software packages do. I will eventually provide deb and rpm packages,...

Rsync how to include directories but not files ?

Hi, I have a directory structure and files like this data/ data/a.txt data/folder/ data/folder/b.txt data/folder/folder/ data/folder/folder/c.txt ... a.txt, b.txt, and c.txt are large files that are computer-generated and renewed frequently. They should NOT be backuped -- but I want to backup the directory structure : data/ data/fol...

connect to another server with dwr remoting

i want to write a server using dwr (server A) at machine A. This server will connect to another server (server B, which is on machine B) using SocketChannel after a client login to server A. however, i get a access denied (java.net.SocketPermission 203.170.117.218:8001 connect,resolve). I trace the code and found that exception is thrown...

Error with taskset

I'm trying to assign a process to one core of my machine using taskset. But it gives me this error: $ sudo taskset 0x00000001 -p 20145 Password: execvp: No such file or directory failed to execute -p What do I have to do to make it work? Thanks ...

'optimize' attribute directive ignored

I have a project for which optimization has been set to "-Os" for all files via gcc command line flags. However, I want to disable optimization for some methods in one of the source files. To accomplish that, I am trying to specify the optimization attribute for those methods. However, gcc says that it is ignoring optimize attribute duri...

How does compiler know that the function you used is a system call?

For the following snippet of code, int n; char buf[100]; int fd = open ("/etc/passwd", O_RDONLY); n = read ( fd, buf, 100); How the compiler comes to know that read is a system call not any library function? How it retrieves the system call number (__NR_read)? ...

Xlib : how to get CAPS LOCK status

Hello, How to retrieve CAPS Lock key information using Xlib if it is on or off ? Regards, Levon ...

Schedule a job in Gearman for a specific date and time

From what I can see Gearman does not support scheduled jobs or delayed jobs. I was thinking that perhaps the scheduled job could be queued in at first and then added to the Gearman queue after the at time period has expired. at tasks are persistent as they are written as files to a directory in the spool directory of the server. So the ...

Is it good to link a shared library against other shared libraries?

I have an application X which uses shared libraries A,B and C. Shared library C also uses some symbols from Shared library A. Application X is linked against A and B during compile time and it does dlopen to load C at run time. My question is Is it a good idea to link C against A during link time or leave the symbol resolution for run...

Is res_query thread-safe?

Is res_query (int res_query(const char *dname, int class, int type,unsigned char *answer, int anslen);) thread-safe? I think so, because it writes its answer to an user-allocated buffer (in contrast to gethostbyname that uses a statically allocated buffer). Does somebody know for sure? ...

What issues will arise launching on LAMP from development on XAMPP?

I am considering developing a php/MySql website on my Windows machine. But I am worried about complications when I go to put it on the the server at, say, GoDaddy and the issues that may arise from their LAMP (they would use LAMP, right?) stack. Are they too perilous and/or numerous to rationalize development with the XAMPP (what about ...

linux g++ linking 64 bit shared library code to static libraries

Context: I can create a shared object library which is linked to a static library without any problems on 32bit linux. When I attempt the same build on 64bit linux, I see this linker error: relocation R_X86_64_32S against `a local symbol' can not be used when making a shared object; recompile with -fPIC This error is quite common on...

ELF file by hand

Hey, I've created an ELF file by hand, it has two sections(.text and .shstrtab) and a programm header which loads the .text section. The .text section is very small and it only consists of following three instructions... # and exit movl $0,%ebx # first argument: exit code movl $1,%eax # system call number...

VNC on CentOS 5.5 + Gnome

Hi Guys/gals I have successfully started a vncserver and can connect to it through the browser via 111.111.111.111:5081. It looks like it's working because I do see the Gnome cursor (X). However, apart from the cursor I just have a black screen. No taskbar or anything. Right click provides nothing either. Does anyone have any idea wh...