linux

Can a WCF Service provide publish/subscribe activity to a Linux-based C++ client application?

I have a WCF service written to provide certain functionality to intranet-based clients. This is easy when a client is running Windows. I want to implement the same functionality for my Windows clients that is available to my linux clients. My questions are? How can I communicate to a linux c++ based client (supporting callback opera...

linux: kill background task

How do I kill the last spawned background task in linux? Example: doSomething doAnotherThing doB & doC doD #kill doB ???? ...

/proc/user_beancounter how to perform monitoring

Hi, I want to perform monitoring of /proc/user_beancounters to see when the system hits the limits and what process is to blame. Does anybody know tools for this issue? ...

Why sizeof(spinlock_t) is greater than zero on uni-processor ?

The following line printed output as 4 whereas I was expecting 0. printk(KERN_INFO "size of spinlock_t %d\n", sizeof(spinlock_t)); I tried this on a system with single cpu. No debugging flags are enabled while building kernel like CONFIG_DEBUG_SPINLOCK or CONFIG_DEBUG_LOCK_ALLOC. According to kernel header files, it should be zero ...

Unix directory inodes - fragmentation, and dumping directory contents

We are having a problem on Linux with directory inodes getting large and slow to navigate over time, as many files are created and removed. For example: % ls -ld foo drwxr-xr-x 2 webuser webuser 1562624 Oct 26 18:25 foo % time find foo -type f | wc -l 518 real 0m1.777s user 0m0.000s sys 0m0.010s % cp -R foo foo.tmp ...

Are there recommended tutorials for writing drivers for Gnu/Linux?

I'm getting to the point where, after a year or so, I'm more or less comfortable using Linux (Ubuntu, first 8.04, now 9.04) as my main OS (it helped that the competition was, primarily, Vista). I can't shake the feeling that I should learn more about the workings under the hood. I'm relatively inexperienced in programming (I can write s...

How do you get the icon, MIME type, and application associated with a file in the Linux Desktop?

Using C++ on the Linux desktop, what is the best way to get the icon, the document description and the application "associated" with an arbitrary file/file path? I'd like to use the most "canonical" way to find icons, mime-type/file type descriptions and associated applications on both KDE and gnome and I'd like to avoid any "shelling ...

bash: split output of command by columns

I want to do this: run a command capture the output select a line select a column of that line Just as an example, let's say I want to get the command name from a $PID (please note this is just an example, I'm not suggesting this is the easiest way to get a command name from a process id - my real problem is with another command who...

How to copy a file to the home directory of the user in .spec file

Hi I am using Fedora 10 linux. I have created a .spec file now I want to write something which will make me able to to copy a file and store in Desktop of the user. So how to do this. Thanks Sunil Kumar Sahoo ...

How to keep an eclipse workspace synchronized among two machines?

I have nearly identical Linux (Fedora) machines at home and at work and I keep my files on both machines synchronized using the excellent Unison program. I have been trying to keep an eclipse workspace synchronized across the two machines but this has failed. I tried both: Synchronize just the /workspace directory, badness due to plugi...

Explanation of stack overflow when using read on a small file and a questionable workaround

I hope the question explained my problem. I would also be grateful if the workaround that "works" is explained. The traditional way of reading a file (that i know of) int fd; char buffer[MAX]; while(read(fd,buffer,MAX)>0) { buffer[MAX]='\0'; write(sockfd,buffer,MAX); memset(buffer,NULL,MAX); } was causing ...

Linux block device simulation & Fuse

Hello everyone My project involves simulating a block device by remote host. For testing I am using FUSE, my file system is a simple change of the "hello" example app, where instead of returning a constant string I just read data directly from a file. When I try to mount the file normally (mount -o loop=/dev/loop1 ) it works well. Wh...

Moving a git repo to another server

I have a git clone/repo on a development server, but I am now moving to another one. I don't want to commit all my local branches and changes to the main repository, so how can I make an exact copy of everything on oldserver to newserver? I tried oldserver:~$ scp -rp project newserver:~/project but then I just get loads and loads of "t...

Font getting reset in virtual console on GNU/Linux

Greetings. I have set a custom font on my virtual console (vt1) using the following command: shell> setfont ter-114f If I switch to X (using Ctrl+Alt+F7) and come back to the virtual console (using Ctrl+Alt+F1), the display isn't proper. Looks like the screen size is getting reset (previously set to 28 rows before switching). How ca...

Jailing user to GUI program in linux

Hello! I have a project to create a program, which prevents the user from escaping a GUI program. The program is designed for students to take exams in. The program contains a web browser page. I have looked around and asked in different places how I should do this, and I have been recommended Qt. I am now having second thoughts about ...

How does youtube support starting playback from any part of the video?

Basically I'm trying to replicate YouTube's ability to begin video playback from any part of hosted movie. So if you have a 60 minute video, a user could skip straight to the 30 minute mark without streaming the first 30 minutes of video. Does anyone have an idea how YouTube accomplishes this? ...

Rename a bunch of files in debian

I have thousands of files that I need to rename with the following format. 2008:09:18:17:45:48-alfanumeric-alfanumeric.wav the first part is a date. Ex. 2008:09:18:17:45:48-703-s.wav A want to rename it to: 20080918.174548.703.s.wav Basically to remove the ':' and to make a more human readable format and easier to split. I know that...

emulating LiveHTTPheaders server side

Is it possible to 'translate' headers from this firefox extension into server side script? edit: I'm trying to SEND headers, not retrieve them. I performed some actions in browser and i want them to be automatically repeated (with few changes) by server-side script. ...

Problem with ftp output redirect in SUSE Linux

Hi, I am working in a bash script where I need to analyze the output of an FTP session. But I encountered a problem with SUSE Linux FTP client when connecting to an AIX ftp server. The problem is that the output from the FTP command is beign shown on the screen, but is not being send to a pipe if a do a "| grep" or "| awk". Also, if I o...

Moving development from Windows to Linux

I'm a longtime Visual Studio(from versions 6 to 2008) user that really like the editor and especially the debugger. Now I'm thinking of giving Linux a go, is there a IDE with similar, or better, capabilities out there? I'm also interested in recommendations for GUI libraries, c++ or c#. ...