linux

Server running in linux kernel. Should listen happen in a thread or not?

I am writing a client/server in linux kernel (Yes. Inside the kernel. Its design decision taken and finalised. Its not going to change) The server reads incoming packets from a raw socket. The transport protocol for these packets (on which the raw socket is listening) is custom and UDP like. In short I do not have to listen for incoming...

PHP hostname bindings

If I write a PHP script to connect to an SMTP server (in my case, this is Postfix installed locally) and send an email, the first "received" header in the e-mail turns out as: Received: from [SERVER_IP] (SERVER_HOSTNAME [127.0.0.1]) by SERVER_HOSTNAME (Postfix) with ESMTP id D682A34381 for <TO_EMAIL>; Thu, 5 Mar 2009 17:25:18 +0000 (GM...

Can someone give me a Regular Expression to identify an encoded URL?

Hello, I am currently looking to detect whether an URL is encoded or not. Here are some specific examples: http://www.linxology.com/browse.php?u=Oi8vZXNwbnN0YXIuY29tL21lZGlhLXBsYXllci8%3D&amp;b=13 http://www.linxology.com/browse.php?u=Oi8vZXNwbnN0YXIuY29tL290aGVyX2ZpbGVzL2VzcG5zdGFyL25hdl9iZy1vZmYucG5n&amp;b=13 Can you please give me...

301 all 404s to homepage

Does anyone know the best way to do this? Apache, tomcat, linux ...

How do I catch system-level exceptions in Linux C++?

The following catch() is not called: void test(void) { int i=1,j=0,k; try { k = i/j; } catch(...) { ...handle it... } } Is there a way to catch this kind of exception? ...

Does using linux benefit you as a programmer?

Are there any clear reasons for why using linux may benefit you as a programmer? Such as tools that are only available on linux or anything else that could make you a better programmer or more efficient programmer? ...

Mono in linux & windows

Is there any difference in performance when running two executables with mono in linux, if: 1) the one executable has been compiled from c# source code previously in windows (e.g.VS). 2) the other executable has been compiled from the same source with gmcs in linux. ...

FFMPEG - zero file size when sound enabled

I'm having a few problems converting video files from the command line using FFMPEG. I'm using a CentOS server, but unfortunately I don't have shell access. When I suppress sound using the following command, everything works perfectly (except of course, there's no sound!) ffmpeg -i $infile -an test.flv However, when I try to enable s...

Egrep acts strange with -f option

Hi all, I've got a strangely acting egrep -f. Example: $ egrep -f ~/tmp/tmpgrep2 orig_20_L_A_20090228.txt | wc -l 3 $ for lines in `cat ~/tmp/tmpgrep2` ; do egrep $lines orig_20_L_A_20090228.txt ; done | wc -l 12 Could someone give me a hint what could be the problem? No, the files did not changed between executions. The expected ...

one week information of alertlofile

Hi I want to view the ORA errors in alertlogfile of past 7 (monday-sunday)days, by writting in shell scripts. Can anybody help me. Thanks ...

Scheduling in Linux: run a task when computer is idle (= no user input)

I want to run Folding@home client on my Ubuntu 8.10 box only when it's idle because of the program's heavy RAM consumption. By "idle" I mean the state when there's no user activity (keyboard, mouse or any other else). It's ok for other (probably heavy) processes to run at that time since F@H has the lowest CPU priority. The point is ju...

boost thread compiler error with GCC

Hello all, on linux, gcc 4.3, compiling a class with boost::thread implementation and mutexes / condition variables I get the following strange error, apparently due to type conflicts with the posix thread library: *Compiling: filter.cpp /usr/include/boost/thread/condition.hpp: In member function »void boost::condition::wait(L&) [with ...

High latency using brctl, eventual timeout.

When using brctl, my latency on the notebook that is doing the bridging becomes horribly slow. Eventually, I cannot get the notebook to connect to anything, even the routers admin panel, or pinging the router. The scenario is I have an 802.11b router upstairs, an 802.11b card in my notebook, and an eth port in my notebook. I am setting ...

Restricting OpenSSH to allow uploads only to certain directories.

I need to run backups from multiple servers to a single account on another server. If one of the public servers is compromised, I don't want the other server's files on the backup account compromised. What I need to do is only allow SCP to a specific directory, based on the ssh key of the incoming connections. I know that I can set the...

C++ development on linux - where do I start?

I decided to leave my windows install behind and am now running Debian as my default OS. I have always coded in Windows and specifically with Visual Studio. I am currently trying to get used to compiling my code under linux. Although I still have a lot of documentation to read, and don't expect you guys to make it too easy for me, it'd ...

How do I install mod-jk in linux?

I need to run tomcat behind apache - am running suse 10 ...

Find Non-UTF8 Filenames on Linux File System

Hi, O/S = Fedora Code 9. I have a number of files hiding in my LANG=en_US:UTF-8 filesystem that have been uploaded with unrecognisable characters in their filename. I need to search the filesystem and return all filenames that have at least one character that is not in the standard range (a-zA-Z0-9 and .-_ etc.) I have been trying t...

Do you know of a Java library to access the native linux api?

Do you know of a Java library to access the native linux api? I guess something like this must use JNI. So be it. ...

32 bit Linux clock() overflow

I need to measure, in C++ on Linux (and other Unix-like systems), the CPU (not wall clock) time taken by a long computation, so I'm using clock(). Problem: on 32 bit systems, this wraps around after about 2000 or 4000 seconds. What's the recommended workaround for this? ...

How frequently IP packets are fragmented at the source host?

I know that if IP payload > MTU then routers usually fragment the IP packet. Finally all the fragmented packets are assembled at the destination using the fields IP-ID, IP fragment offsets and fragmentation flags. Max length of IP payload is 64K. Thus its very plausible for L4 to hand over payload which is 64K. If the L2 protocol is Ethe...