linux

Quick unix command to display specific lines in the middle of a file?

Trying to debug an issue with a server and my only log file is a 20GB log file (with no timestamps even! Why do people use System.out.println() as logging? In production?!) Using grep, I've found an area of the file that I'd like to take a look at, line 347340107. Other than doing something like head -<$LINENUM + 10> filename | tail -...

SD card write performance

I am writing a little application, which is writing jpeg images at a constant rate on a SD card. I choose an EXT3 filesystem, but the same behaviour was observed with an EXT2 filesystem. My writing loop looks like this : get_image() fwrite() fsync() Or like this : get_image() fopen() fwrite() fsync() fclose() I also display some ...

Which Gantt chart/Project management tool would you recommend for linux?

I need a Project management tool that works in Linux, and has Gantt charts. It doesn't have to be free, just not expensive. I don't care how it stores the information I give it, as long as I can access it. I must be able to print the Gantt charts. Must work in Linux. With those requirements, what can you recommend? TheObserver asked...

Bash: How _best_ to include other scripts?

The way you would normally include a script is with "source" eg: main.sh: #!/bin/bash source incl.sh echo "The main script" incl.sh: echo "The included script" The output of executing "./main.sh" is: The included script The main script ... Now, if you attempt to execute that shell script from another location, it can't find ...

In the bash script how do I know the script file name?

How can I determine the name of the bash script file inside the script itself? Like if my script is in file runme.sh, than how would I make it to display "You are running runme.sh" message without hardcodding that? Thanks, ...

Good explanation/documentation on ftrace

I just read that the 2.6.27 kernel has a new module called ftrace which sounds a lot like suns dtrace utility. I'm having some trouble googling for documentation, I was wondering if anyone else had something. Is this something that is going to be implemented on the full programming stack like dtrace and we'll get a nice little scripting ...

Standalone Python applications in Linux

How can I distribute a standalone Python application in Linux? I think I can take for granted the presence of a recent Python interpreter in any modern distribution. The problem is dealing with those libraries that do not belong to the standard library, i.e. wxPython, scipy, python cryptographic toolkit, reportlab, and so on. Is there ...

Is Linux ruining my chance at a good software engineering career?

I'm a 21 year old University student studying Computer Science. I have been using Linux throughout the whole of my degree so far. Now that I'm nearing the end of my degree I've started looking at graduate software engineering/developer positions at various companies. I notice that the vast majority of companies I'm looking at are strict...

What's a good C decompiler?

I am searching for a decompiler for a C program. The binary is a 32-bit Linux executable. Objdump works fine, so basically I am searching for something which attempts to reconstruct the C source from the asm source. ...

Resources for Windows developer to switch to Linux

I'm looking for some help and it goes like this: I'm a fairly green software developer, and focus mainly on the web (python/PHP) but am pretty well experienced with Java applications and as an electrical engineering student, looking forward to dive into some c/c++. I've pretty much grown up on Windows machine, but hate .net with a passio...

How to paralleize search for a string in a file with a help of fork? (GNU Linux/g++)

This is how the situation looks: I got a text file with a couple of lines and I am looking for a string in this file. I need to pass following command line parameters to the program: - file path - the string I am looking for - maximum number of processes the program is allowed to "fork" in order to complete this task. How to such pr...

How can you efficiently check the VM mapping for an address?

I am writing a tracing tool which needs to deal with the output of a a JIT, so the stack can look pretty bizarre at times. I'd like to try to apply some heuristics to addresses to determine if they are code, data or garbage. (If I'm wrong some of the time, it's no big deal; however if the process crashes, not so much.) I can cat /proc...

How to copy a file to multiple directories using the gnu cp command

Is it possible to copy a single file to multiple directories using the cp command ? I tried the following , which did not work: cp file1 /foo/ /bar/ cp file1 {/foo/,/bar} I know it's possible using a for loop, or find. But is it possible using the gnu cp command? ...

Can require_once be used with symbolic links?

On a CentOS LAMP box, trying to get require_once to work inside a script in PHP5. If the file to be included is not a in symlinked directory, it works fine, but if the file to be required is in a directory found via a symbolic link, it fails to find it. Is this a limitation of require_once and symbolic links? EDIT - Thanks for the inpu...

shared library problems on linux

I'm trying to compile/link a very old piece of software on a linux system and I can't for some reason link with a shared library that's installed on my system. I get the following error from the linker: /usr/bin/ld: cannot find -lXaw However, the lib itself is installed. If I run ldconfig -v | grep libXaw I get (among other thing...

What's the best way to use memcache with a single-server app?

For a single-server LAMP site (which is usually under quite high load), what is best way to use memcache? Does it make sense to run the memcache daemon on the same server as the application, or is that just going to take valuable memory away from MySQL, giving a net performance loss. Does it even make sense to use memcache in this sce...

Spinlock Versus Semaphore!

What is the basic differences between Semaphores & Spinlock? & In what best situations or conditions, we can use these. ...

Programmatically send keystrokes to GLUT application

I have an OpenGL/GLUT program running on my linux machine that views a 3D model from various angles and can take screenshots, and everything is controlled from the keyboard. I want to write a script that moves around the model in a particular way, taking screenshots at every step. It seems there should be a simple way in Linux to send ...

Making money with Open Source as a developer?

I'm currently a student (Applied Information Technology) and we do most of our programming in C# and Java. I was wondering how can I as a developer, make money with open source. I know there is the story of give support, or provide services, but I'm not a sysadmin and I don't like sysadmin work. Actually I would love to get my hands on s...

Next step for System administrator?

I have been a system administrator for about 8 years. Have worked on various technologies including various linux/unix flavours as well as MS technologies. I have also dabbled in perl and bash programming purely for sysad jobs. I am planning to switch to programming. Is it advisable for a sysad to shift to programming. If no, why? If...