linux

Best Linux programming related forums?

What forums do you find most useful in Linux-related issues? These can be either general discussion forums (web forums, mail lists..) or speciality forums (tools, distributions etc). There are tons of forums but it would be nice to know which ones generally have the best responses. SO of course helps to a point but obviously you sometim...

Authenticate linux based user in java

Hi all, I have a username and password for a particular user in Linux i need to verify that if the user is valid or not using java? Abdul Khaliq ...

Comprehending 'top' CPU usage

What does it exactly mean to have a 350% cpu usage (by a process) on a 4-CPU box? The process is a 'mysqld' which is currently being 'bombarded' by a simulated OLTP scenario. Any pointers appreciated. ...

Set the language for a single program execution.

Complete C++ i18n gettext() “hello world” example. sets the LANG environment variable using export before executing the program (Linux): export LANG=es_MX.utf8 ./hellogt Is there a way to set the language just while executing hellogt, like a command line argument? This would be handy for testing programs. ...

Redirect 301 www.www.example.com

I'm using LAMP server, and I need to redirect requests like: www.www.example.com to www.example.com and other variations like (wwww.example.com, etc) I know I can do it in .htaccess, but I don't know the regular expression that I should use to represent all these possibilities. Or there is any diferent approach, comming from the vhost...

How can I detect hung processes in Linux using C?

Duplicate: Linux API to list running processes? How can I detect hung processes in Linux using C? ...

Set up svn repository from my Linux desktop with apache

I want to set up an svn repository on my Ubuntu desktop that may be accessed from the outside (over the internet). Any recommended tutorials? I have looked around but get stuck with most of them... ...

How do I use the bash time function from python?

I would like to use python to make system calls to programs and time them. From the Linux command line if you type: $ time prog args You get something along the lines of: real 0m0.110s user 0m0.060s sys 0m0.024s if you do a 'man time', it states that you can type: $ time -f "%E" prog args in order to format to get only...

C++ hdr image i/o library (linux and windows)

I need to find/create a library that can load hdr images in many formats for use in opengl. I have been using SDL_image, but it doesn't support hdr. I don't want to use many different image libraries, so if there is one that supports a large amount (bmp, png, jpg, tiff, tga, hdr are the most important). If there is none, I don't mind ...

Getting the pid of my children using linux system calls in C++

I have a process that interfaces with a library that launches another process. Occasionally this process gets stuck and my program blocks in a call to the library. I would like to detect when this has happened (which I am doing currently), and send a kill signal to all these hung processes that are a child of me. I know the commands t...

Seeking and reading large files in a Linux C++ application

I am running into integer overflow using the standard ftell and fseek options inside of G++, but I guess I was mistaken because it seems that ftell64 and fseek64 are not available. I have been searching and many websites seem to reference using lseek with the off64_t datatype, but I have not found any examples referencing something equal...

Console_init Causes Kernel paniC

System Details: OS: Debian/5.0 kernel 2.6.26-2 i686 SMP Hardware: IBM Thinkpad T40 Type 2373 Pentium M 1.5GHz, 512MB RAM Sources: sudo apt-get install linux-source-2.6.18 linux-patch-debian-2.6.18 linux-support-2.6.18-5 Toolchain: arm-linux-gcc3.4.cs-uclibc0.9.27 as installed by scratchbox arm-linuc-uclibc-gcc/-g++ -v: Reading ...

What is the equivalent to $? in Windows?

Does anybody know what is the equivalent to $? in Windows command line? Is there any? EDIT: $? is the UNIX variable which holds the exit code of the last process ...

Best way to make Linux Web Services?

Hello. I have a server that is running Ubuntu Linux Server Edition. I once had a Windows Server and it is easy to create web services using ASP.net on Windows. Linux on the other hand does support ASP.net using Mono, but is isn't as full featured as Windows. So what would be the best way to create xml web services on a linux server box? ...

Programmatically set custom folder/directory icon in Linux

In Linux, can one set a custom icon for a folder/directory as it appears in a desktop/file manager? For example for Windows Explorer one can set a custom icon in the folder's desktop.ini file? If so, is there a common mechanism or API function to do this (that is perhaps common among distros/desktops/file managers)? I would like to do...

linux: where's the "real" segmentation fault handler ?

If I read/write/jump to an ummapped address ie. .text .global _start _start: movl $1,%edx jmp *%edx this causes a segmentation fault. I wonder, what's the actual part of the system (kernel) that intercepts reads/writes to unmapped addresses (how ?) and throws the "user mode" signal ? ...

Unix Sort with Tab Delimiter

I have a data with the following format: foo<tab>1.00<space>1.33<space>2.00<tab>3 Now I tried to sort the file based on the last field decreasingly. I tried the following commands but it wasn't sorted as we expected. $ sort -k3nr file.txt # apparently this sort by space as delimiter $ sort -t"\t" -k3nr file.txt sort: multi-charac...

Prefered terminal scripting language

What language do you prefer writing scripts for common tasks (backup, sync, etc.) and why? I'm not talking about programing web pages or applications. I've got this question when thinking why bash is still popular. For example python looks more comfortable for me. Do you use just because you know it or for some special reasons? ...

Open port in linux with java application

Hi, i've a java application that create a socketserver in a port. I test my application in a windows machine, and run correctly, but when i test it in a linux machine, the port is not listening. Is there any way to open port specifically in a linux machine? I run 'netstat' command, and the port i use in my application doesn't appear. i...

Shell programming: Executing two applications at the same time

Hi I have two applications, lets call them APP1 and APP2. I would like that those two execute on parallel on my machine. It is not necessary, that they start at EXACTLY the same time but the should start at roughly the same time. An intial thought was to have a shell script that looks as follows: ./APP1 & ./APP2 Does this the trick ...