linux

Linux programming - getting started, how?

I've taken the plunge and installed Linux (Linux Mint 9 if that's important) on one of the boxes - and I'd like to start some small-time programming... but where to start. My background: Mostly LOB-applications in C#/WPF Some XAL-basic A wee bit of VB/VBA and SilverLight I would like to turn to a new programming language - but still...

setting-up oracle-xe

Hi, I installed oracle-xe into my virtual box that running with Fedora 13 successfully. Although I can ping my virtual machine, I can not connect the database from outside the box. Do I have to make some changes on tnsnames.ora or can I use another connection type for this situation? I would be greatly appreciated if someone be able to ...

Detect system load with emphasis on "swap thrashing" in Linux

I crafted a Bash prompt that, When the working directory is a Git repository, displays the name of the current repository. Besides, it contains the current ongoing task and the time spent doing it (from a homebrew timekeeping tool). This, of course, means that just displaying the prompt means running two processes. This has the drawback...

so file does not work sometimes

Hi Everyone? My Question is not resolved. A.so depends on B.so. B.so depends on C.so. The method in A.so is called many times in my application. On Ubuntu 9.10, the method works properly. But on Ubuntu 8.04, the method does not work properly. Sometimes it works. Sometimes it does not work. I don't know why... I checked A.so using ...

How to compile (build) my Qt application to run on many linux distributions?

Hi, I have created a Qt GUI application and I want to provide a linux executable that runs on as many distributions as possible. Is this possible or do I have to provide a separate executable for each distribution? Thanks for your help ...

Qt + XCompositeRender problem

I want to render the contents of the window in to QWidget ( or QPixmap ) using XComposite and XRender. The Issue I'm facing is that I can't get the picture be rendered in the QWidget. The code below has been written using the following tutorial: http://ktown.kde.org/~fredrik/composite_howto.html The window ID is hardcoded, so there can b...

How to get USB vendor and product info programmatically on Linux?

Using udev I have been able to get this information for a certain USB device: idVendor: 13b1 idProduct: 0018 manufacturer: product: USB 2.0 Network Adapter ver.2 serial: 00FFFF Now I want to get the full strings that are associated with the vendor and product ids. I found that the file /usr/share/misc/usb.ids contains the informati...

InetAddress.getLocalHost() throws unknownHostException in linux

InetAddress.getLocalHost() throws unknownHostException in linux until I manually add entry in /etc/hosts. Is there any way to get InetAddress object without add an entry in /etc/host file.. Note : The IP is static ...

How to allow certain threads to have priority in locking a mutex use PTHREADS

Hi, Assume that the following code is being executed by 10 threads. pthread_mutex_lock(&lock) Some trivial code pthread_mutex_unlock(&lock) For purpose of explanations lets say the threads are T1, T2, T3.....T10. My requirement is that as long as T1 or T2 or T3( i.e any of T1, T2 or T3) is waiting for acquiring a lock, the other thre...

awk shell script help

Hi i have the output of cat /proc/loadavg and /proc/meminfo MemFree: 1191220 kB i need a to know who will i get a script to get then added in a logfile every 5 mins. eg: CPU; Mem; 10.0; 1191220 and so on so the next entry will be below that eg: CPU; Mem 10.0; 1191220 5.0; 2229882 Thanks in advance ...

What OSes can I use if I want to use Intel Atom based board as an embedded system?

Hey guys Im planning to use Intel atom on a board for an embedded system. The embedded system will be running programs written in C for image processing. Since its an embedded system footprint is obviously a concern. I was thinking about using a modified version of the linux kernel. Any other options?? ...

terminate script of another user

On a linux box I've got a python script that's always started from predefined user. It may take a while for it to finish so I want to allow other users to stop it from the web. Using kill fails with Operation not permitted. Can I somehow modify my long running python script so that it'll recive a signal from another user? Obviously, t...

Closing all TCP sockets on interface Down

Hi there, I need to close all ongoing Linux TCP sockets as soon as the Ethernet interface drops (ie cable is disconnected, interface is down'ed and so on). Hacking into /proc seems not to do the trick. Not found any valuable ioctl's. Doint it by hand at application level is not what I want, I'm really looking for a brutal and global wa...

Why does svn:executable work for one script and not the other?

I have a bash script (.sh file) and a Python script (.py) file in the same directory. Both have the svn:executable permission. However when I do an 'svn update', only the Bash script gets executable permission set. Any ideas why? (If I manually set the permission on the Python script it runs fine.) DOH! Turns out I had a typo. It had t...

Fast way to find the number of files in one directory on Linux

I am looking for a fast way to find the number of files in a directory on Linux. Any solution that takes linear time in the number of files in the directory is NOT acceptable (e.g. "ls | wc -l" and similar things) because it would take a prohibitively long amount of time (there are tens or maybe hundreds of millions of files in the dire...

.NET on linux, ~/folder is wrong?

In .NET i am writing Directory.CreateDirectory(textBox4.Text); textBox4.Text is ~/myfolder. What i get is a folder in the current working directory called ~ with myfolder in it. How do i have CreateDirectory create myfolder at the user's home? ...

Is it possible to override hashbang/shebang path behavior

I have a bunch of scripts (which can't be modified) written on Windows. Windows allows relative paths in its #! commands. We are trying to run these scripts on Unix but Bash only seems to respect absolute paths in its #! directives. I've looked around but haven't been able to locate an option in Bash or a program designed to replace and ...

Java ProcessBuilder: Resultant Process Hangs

I've been trying to use Java's ProcessBuilder to launch an application in Linux that should run "long-term". The way this program runs is to launch a command (in this case, I am launching a media playback application), allow it to run, and check to ensure that it hasn't crashed. For instance, check to see if the PID is still active, an...

Profiling embedded application

I have an application that runs on an embedded processor (ARM), and I'd like to profile the application to get an idea of where it's using system resources, like CPU, memory, IO, etc. The application is running on top of Linux, so I'm assuming there's a number of profiling applications available. Does anyone have any suggestions? Than...

Translate & to %20%26%20

I know I can translate upper to lower case letters by echo 'linux' | tr "a-z" "A-Z" who would I translate or replace an occurrence of & with %20%26%20. Maybe something like this echo '&' | tr "&" "%20%26%20" ...