linux

Linux file installer for a file that runs on start up.

My goal is to use a script that will install an executable file on Linux (Busybox variant). The target file should run when the computer starts, so in the rc.sysinit file, I'll have a line like the following: /usr/bin/foo & Now, when I run the install script, that line may or may not already be present (depending if the file had been ...

Trying to statically link Boost

I am working in Linux, Eclipse CDT, g++, with Boost library. Having existing program which uses Boost thread, I try to link it statically instead of dynamically. /usr/local/lib directory contains the following files: libbost_thread.a libbost_thread.so libbost_thread.1.41.0 Dynamic linking works: g++ -o"MyProgram" ./main.o -lboost...

html2text library

There is utility html2text in linux. How can i use its or similar library in my c++ code? For example to convert html which was retrieved from any site to a readable text. ...

How to match any whitespace in body of mail in procmail?

I tried to use such rule: :0 B * Something[[:space:]]+whatever but it doesn't work. When I change [[:space:]] to literal space character: :0 B * Something +whatever it works. It also works in case of: :0 B * Something[ ]+whatever I must be doing something wrong, but can't really find it. Any hints? ...

the difference between the program in C++ developed under windows and linux

I would like to know what's the difference between the program developed in C++ under windows and linux. Can anybody tell me why the program developed under Windows in C++ can't be used under linux? ...

Error with threads opening files

I'm using C and pthread on a Linux machine, and I'm having trouble parallelizing a program. I'm basically trying to take in a folder of data files, divide them into groups, each group handled by a thread, and run a function on each of the data file. The way I'm doing this is I have a global char **filename variable, where filename[i] ...

Maximum number of concurrent connections on a single port (socket) of Server

Hi, What could be the maximum number of concurrent Clients(using different port number) that could communicate to a Server on the same port (Single socket) ? What are the factors that could influence this count ? I am looking for this information w.r.t telnet in linux environment. Thx in advans, Karthik Balaguru ...

developer tools for os' other than windows

I currently use visual studio 2008 for creating projects that can run on windows. Can you recommend me of other tools that can be used to develop applications for other operating systems?(Linux, Mac, Solaris) The most prominent programming languages will do(C++, C#, F#) And scripting languages(PHP, Perl, etc) ...

Uploading photos to linux server via php - what is the max number of files a folder can have?

I'm creating an site which allows users to upload photos. It's a linux server. I was wondering what would be the best directory structure to to save these images? And is there a limit of number of files a folder can have? Would it be better to save every photo uploaded by every user to one single folder and have a reference of each i...

Recommendations for cross-platform C/C++ JSON library ?

I'm looking for recommendations for a reliable and functional cross-platform JSON library that can be called from either C or C++ and which can be used with Linux, Mac OS X and WIN32. Ideally it should support both generating JSON output as well as parsing JSON input. I've looked at a lot of the open source options but it's hard to tell...

length of captured packets more than MTU

Hi, I m running iperf between two machines (linux) and I can observe the mtu of both the interfaces connected is 1500. I ran tcpdump to capture packets and I observed some packets have "length as 2962"....how come this is possible with mtu as only 1500? Please clarify. Thanks! Note: flags field is set as DF. and proto is TCP ...

Closed-Source applications for linux

I am working on a closed source application that should run on Windows, Mac OS X and major Linux distributions (maybe open-source at a later stage). The program will link against some libraries: boost, Lua, StormLib and zlib. From what I understood there shouldn't be any issues regarding the licenses. It's a C++ command line applicati...

Socket shutdown and rebind - How to avoid long wait?

I'm working with socket in python, and being in development stage I need to kill and restart my program frequently. The issue is that once killed my python script, I've to wait long time to be able to rebind the listen socket. Here's a snippet to reproduce the problem: #!/usr/bin/env python3 ...

dynamic_cast fails when used with dlopen/dlsym

Intro Let me apologise upfront for the long question. It is as short as I could make it, which is, unfortunately, not very short. Setup I have defined two interfaces, A and B: class A // An interface { public: virtual ~A() {} virtual void whatever_A()=0; }; class B // Another interface { public: virtual ~B() {} virtual voi...

Why does PortAudio not play nicely with other audio programs or how can I get it to?

I am trying to write an audio application using PortAudio, but if any other audio programs (usually Firefox) are running at the time which I try to run my program, I get the following error: PaHost_OpenStream: could not open /dev/dsp for O_WRONLY PaHost_OpenStream: ERROR - result = -10000 An error occured while using the portaudio strea...

a.out replaced by ELF file format ?

I have a few questions: Why was a.out replaced by ELF? What were the major flaws in the a.out format that led to the raise of ELF file format? Earlier core dumps were based on a.out, but now they are based on ELF. What are the various advantages provided by ELF? ...

How to get extension of a file in shell script

Hi all, I am trying to get file extension for a file in shell script. But without any luck. The command I am using is file_ext=${filename##*.} and file_ext = $filename |awk -F . '{if (NF>1) {print $NF}}' But both of the commands failed to put value in variable file_ext. But when i try echo $filename |awk -F . '{if (NF>1) {print...

how to manipulate array in shell script

Hi I want my script to define an empty array. array values should be added if predefined condition gets true. for this what i have done is declare -a FILES file_count=0 if [ "$file_ext" != "$SUPPORTED_FILE_TYPE" ] ; then echo "$file_ext is not supported for this task." else $FILES[$file_count] = $filename file_c...

Inode Data Structure Differences Between 128-byte Ext2 and 256-byte Ext3

Curious as to the inode data structure differences between 128-byte ext2 and 256-byte ext3 file-systems. I have been using this reference for ext2, 128-byte inodes: http://www.nongnu.org/ext2-doc/ext2.html#INODE-TABLE. I have been unable to find a similar resource for ext3, 256-byte inodes. I have cursorily checked /usr/include/linux/...

Anybody know how to toggle caps lock on/off in Python?

Hi, I'm trying to toggle caps lock on/off when the two shift buttons are held down for a second. I've tried using the virtkey module, but it's not working. That module does work for other keys though, so I don't think I'm using the module incorrectly. Does anybody have a way for doing this? Just to be clear, I want to actually toggle ...