linux

Building files from TCP/IP traffic?

So, for a CS project I'm supposed to sniff a network stream and build files from that stream. For example, if the program is pointed to ~/dumps/tmp/ then the directory structure would be this: ~/dumps/tmp /192.168.0.1/ page1.html page2.html [various resources for pages1 & 2] downloaded file1 /192.168.0...

How can I make my C++ code cross platform capable?

How can I make my C++ code cross platform capable? I need it to work on Windows and Xubuntu. ...

Good C++ Debugging/IDE Environment for Linux?

I have a friend who is trying to make the switch to Linux, but is hung up on the apparent lack of debugging/IDE environments for C++, especially as they relate to template programming. He has been using visual studio for years and is maybe a little spoiled by their awesome IDE. Does anyone have any good suggestions for an environment whe...

Reading a line from a socket

I am writing some code in which i need to get a line from a socket whenever the line ends in a newline or carriage return. The line shoould be stored in a buffer. n = recv(sock, &ch, 1, 0); if (n > 0) { if (ch == '\r') { // do stuff } // } // I am using code like this inside a while but it is not working...

Move line(s) to follow another line in a file

I got a file that has a line in the file like this: check=('78905905f5a4ed82160c327f3fd34cba') I'd like to be able to move this line to follow a line that looks like this: files=('somefile.txt') The array though at times that can span multiple lines, for example: files=('somefile.txt' 'file2.png' 'another.txt' ...

How do you start off with implementing a thread library ?

How to write kernel code in C ? Where can we look forward to learn more of writing kernel code ? I want to know writing programs in C that can be used to modify my kernel. How do i do that ? What resources can i look upto ? ...

npapi plugin: how do I install a gecko plugin?

I've compile the basic plugin found here but I can't figure out how to install it on my Ubuntu machine. ...

Duplicate file descriptor with its own file offset

How can one create a new file descriptor from an existing file descriptor such that the new descriptor does not share the same internal file structure/entry in the file table? Specifically attributes such as file offset (and preferably permissions, sharing and modes) should not be shared between the new and old file descriptors. Under b...

Regex match a string with spaces (use quotes?) in an if statement

How would I do a regex match as shown below but with quotes around the ("^This") as in the real world "This" will be a string that can have spaces in it. #!/bin/bash text="This is just a test string" if [[ "$text" =~ ^This ]]; then echo "matched" else echo "not matched" fi I want to do something like if [[ "$text" =~ "^This ...

Simplest method to get the dictionary definitions of a list of words in a text file

File1: hello world I don't know the best method to extract a list of words from a text file, find their definitions and paste them into an output textfile. I've been thinking of using WordNet - but don't know how to automate the process. Does anyone have any ideas (perhaps google/APIs/linux applications) that one could use to find th...

Create and build pure "ActionScript project" with Flex SDK under Linux

Before all: excuse my english :) Ok, here we go - im developing mostly java things, so my IDE - Intellij IDEA. For a few last weeks im playing with Flex and AS3. So, im using Flex SDK 3 with IDEA plugin. Everything was just fine, but now i want to create pure actionscript project without any flex things (it dramatically increases size ...

(13)Permission denied: access to /cgi-bin/test.cgi denied

Hi, I am tryning out CGI-scripts for the first time but without success. I have read many tutorials and followed may threads in different forums but I can not make it work. I am using a appache web server on a Fedora 10 machine. I always have problem with [Wed Oct 21 20:47:36 2009] [notice] SELinux policy enabled; httpd running as con...

Running multiple sites on a LAMP with secure isolation

Hi everybody, I have been administering a few LAMP servers with 2-5 sites on each of them. These are basically owned by the same user/client so there are no security issues except from attacks through vulnerable deamons or scripts. I am builing my own server and would like to start hosting multiple sites. My first concern is... ISOLATION...

jstat and ksysguard

Is there any way that I can get the output of jstat (in particular the -gcutil output) into ksysguard so that I can keep track of how a collection of java processes are doing from a garbage collection perspective? I know that jconsole has similar visualisations but I would prefer it if I could get the data into ksysguard ...

code porting from 32bit to 64bit

I am trying to port 32bit code to 64bit linux machine. Are there any compiler flags for 64bit posrting warning on Linux. There are +w2 -m64 flags for SUN. Could anyone give me information for flags similar to this one? Thank you in advance, ...

linux based submission script for CS student source code

I'm in the late stages of developing a Linux based computing lab for CS students at my university. In my undergraduate days I remember being able to submit my homework assignments with a command like: submit [classname] [projectname] [source files] which would then copy all my files to a directory students couldn't access but the inst...

Is ubuntu 9.04 good choice for embedded linux application development ?

Hi Friends, I want to change linux distro my Development(Host) Machine which I use for embedded development. I cross-compile applications for many different processors. It is required for me to download different different libraries to evaluate their functionality/Performance/Stability on different devices , as well as on PC. So Is ub...

Corrupt image file after uploading it using ftp command from linux, with type ASCII

I have try to transfer a image file using ftp command in linux, from linux platform to windows platform, doing like this: ftp cs.unitbv.ro ascii get test.jpg After this, when I open the image it says that the file is corrupted. If somebody know how to repair the image file let me know. Thanks ...

Mutex lock on write only

I have a multithreaded C++ application which holds a complex data structure in memory (cached data). Everything is great while I just read the data. I can have as many threads as I want access the data. However the cached structure is not static. If the requested data item is not available it will be read from database and is then in...

RSync: How do I synchronize in both directions?

Hello! I want to use rsync to synchronize two directories in both directions. I refer to synchronization in classical sense (not how it is meant in rsync manuals): I want to update the directories in both directions, depending on which of them is newer. Can this be done by rsync (preferable in a Linux-way)? If not, what other solution...