linux

How can I prevent tons of apache processes spawning when I start apache and proceeding to kill my machine?

I have a highly trafficked application on one debian machine and apache has started acting strange. Every time I start apache, tons of apache processes are spawned, the app doesn't load at all, and very quickly the whole machine freezes and must be powercycled to reboot. Here is what I get for top immediately after starting apache: ...

How to recursively list all files and directories.

Using the tcsh shell on Free BSD, is there a way to recursively list all files and directories including the owner, group and relative path to the file? ls -alR comes close, but it does not show the relative path in front of every file, it shows the path at the top of a grouping i.e. owner% ls -alR total 0 drwxr-xr-x 3 owner group ...

What are some good resources for learning network programming?

I recently started attending two classes in school that focus on networking, one regarding distributed systems and another regarding computer networks in general. After completing the first labs for the two classes, I now have a pretty good understand of network protocol and socket concepts with both C and Java. Now I'm trying to move b...

Code Highlighting for Subversion/Apache Server

I have beeen looking around for a way to add code highlighting to my Subversion and Apache installation that hosts my local subversion projects. It runs on Fedora Core 10 installed in a VM. I would like to use syntaxhighlighter but I have not idea how i can get Apache to automatically insert the required javascript into my source code fi...

Too many open files error on Ubuntu 8.04

mysqldump: Couldn't execute 'show fields from `tablename`': Out of resources when opening file './databasename/tablename#P#p125.MYD' (Errcode: 24) (23) on checking the error 24 on the shell it says >>perror 24 OS error code 24: Too many open files how do I solve this? ...

Linux: Fastest way to draw

I need to draw an 2d-array of color triplets on the screen, what is the fastest way of doing that? The target language is C/C++ and the program has only to work on Linux, but platform independant solutions are preferred obviously. I run Xorg, XVideo and OpenGL are available. How many FPS can I expect on 1024x768 on an Intel Core 2 Duo ...

timer class in linux

I need a timer to execute callbacks with relatively low resolution. What's the best way to implement such C++ timer class in Linux? Are there any libraries I could use? ...

How to know what the errno means ?

When calling execl(...) I get an errno=2. What does it mean ? How can I know the meaning of this errno ? ...

Text Editor with Scripting...for Linux

For a while now, I have been using UltraEdit on my Windows box. The ability to write scripts with a familiar language (JavaScript) has proved to be extremely useful. The only problem is that I cannot use it on my Linux box at work. Is there a comparable text editor that runs on Linux and has an integrated scripting engine? Not breaki...

reading / writing fram using I2C on Linux

I'm trying to read/write to a FM24CL64-GTR FRAM chip that is connected over a I2C bus on address 0b 1010 011. When I'm trying to write 3 bytes (data address 2 bytes, + data one byte), I get a kernel message ([12406.360000] i2c-adapter i2c-0: sendbytes: NAK bailout.), as well as the write returns != 3. See code below: #include <linux/i...

In Ubuntu Intrepid, what keypress will take me to tty13?

Trying out Ubuntu Intrepid, I have discovered that RightAlt+F1 doesn't take me to tty13. I've exhaustively tried every option presented to me in "dpkg-reconfigure console-setup", the best I've been able to manage thus far has been to have both Alt keys behave the same (LeftAlt+F1 and RightAlt+F1 both going to tty1). Please note that usi...

Binary data over serial terminal

My only way of communication with my embedded device is a serial port. By default, embedded Linux uses this port as a terminal. How do I disable this terminal and use the serial link to transfer binary data? I heard of commands like rx and tx but i cannot find them. I think I can just read() from and write() stuff to /dev/tty but I want...

Connect to MS SQL Server from PHP on Linux?

I need to connect to an MS SQL Server database from a PHP script running on a Linux server. I'm looking at using FreeTDS as there is no official MS SQL Server driver for Linux. Is this my best option? Is it ok in a production environment? Are there other options, perhaps ODBC? ...

Free code coverage tools

Are there any free code coverage tools for native (not managed) code? For either Windows or Linux platforms? ...

unix shell nightmares

What are the worst/best unix shell nightmares? My favourites are: rm -rf / tmp/foo (deletes everything if you are root; typo :-( ) rm -rf .* (deletes everything if you are root; not just all hidden files) Files in * that are used as parameters, e.g. after touch -- -rf, rm * eventually evaluates to rm -rf foo bar cat foo | sed 's/foo/ba...

Problems linking static Intel IPP libraries on Linux with g++

I've been trying to move a project over from Xcode to Linux (Ubuntu x86 for now, but hopefully the statically-linked executable will run on an x86 CentOS machine? I hope I hope?). I have the whole project compiling but it fails at the linking stage-- it's giving me undefined references for all functions defined by IPP. This is probably...

How many threads to create and when?

I have a networking Linux application which receives RTP streams from multiple destinations, does very simple packet modification and then forwards the streams to the final destination. How do I decide how many threads I should have to process the data? I suppose, I cannot open a thread for each RTP stream as there could be thousands. S...

Shortening large CSV on debian

I have a very large CSV file and I need to write an app that will parse it but using the >6GB file to test against is painful, is there a simple way to extract the first hundred or two lines without having to load the entire file into memory? The file resides on a Debian server. ...

Monitor Directory for Changes

Much like a similar SO question, I am trying to monitor a directory on a Linux box for the addition of new files and would like to immediately process these new files when they arrive. Any ideas on the best way to implement this? ...

bash: get list of commands starting with a given string

Is it possible to get, using Bash, a list of commands starting with a certain string? I would like to get what is printed hitting <tab> twice after typing the start of the command and, for example, store it inside a variable. ...