linux

Plesk 9.01/Centos - how do I create a directory I can upload to via PHP?

How do I create a directory I can upload to via PHP in Plesk, considering all my PHP.INI file is correctly setup to allow uploads? Step by step instructions would be appreciated. ...

How to use file protocol to access a directory on local system?

like /usr/local? I tried file:///usr/local but failed [root@www2 robot]# cd file:///usr/local -bash: cd: file:///usr/local: No such file or directory ...

How to detect USB device disconnect under Linux/Qt/C++

I'm writing a system (X-Platform Windows/Linux) that talks to a custom device using an FTDI USB chip. I use their D2XX driver for device open/close/read/write. So far, so good. I need to know when the device is disconnected so the program can respond gracefully. At present, under Windows the application receives a sudden unexpected...

what's the option for cp to create a directory if not exists?

Here is what I tried but failed: [root@file nutch-0.9]# cp -f urls-resume /nosuchdirectory/hi.txt cp: cannot create regular file `/nosuchdirectory/hi.txt': No such file or directory [root@file nutch-0.9]# besides,any way to make ">" work that way,say to create a directory when need? [root@file nutch-0.9]# echo test > /nosuchtest/hi.t...

Linux command to list all available commands and aliases

Is there a Linux command that will list all available commands and aliases for this terminal session? As if you typed 'a' and pressed tab, but for every letter of the alphabet. Or running 'alias' but also returning commands. Why? I'd like to run the following and see if a command is available: ListAllCommands | grep searchstr ...

RecvFrom() returns packet larger than sender NIC MTU

I have proprietary application sending out multicast packet to the network. It is running on the linux with NIC MTU 1500. And then I write a simple java program to using MulticastSocket class to receive message. I found it is DatagramPacket size is ~7900. The receiver program is running on the linux with NIC MTU 1500. I rewrite the pro...

Limit availableProcessors

I had a problem a while ago whilst using Solaris that I wanted to limit the number of CPUs that Java could see (that was returned by Runtime.getRuntime().availableProcessors(). I thought I had it and I was given some info for Linux and took it on faith. I was told that using taskset would limit the number of CPUs that java would use (whi...

Creating dynamically loaded Linux libraries using Eclipse

I am writing a program in C++ using Eclipse. I want to compile it as a library for Linux, somthing like a DLL in Windows. How I can do this? Do you know any tutorials on how libraries are created? I just want to understand that is the analog of a DLL for Linux and how to create it. I will be thankful for a small example. ...

How to run C# project under Linux

Hi all! Do you know any ways to run a C# project under Linux. Are there any framewoks or libraries for this? Regards. ...

C++ math functions problem (under Linux)

I'm having problem regarding max and sqrt If I include math.h it coudn't find sqrt. So I view the cmath header file and inside it includes math.h, but when I try to open math.h it says that file is not found. SO ithink my math.h is missing in Linux. ...

Killing process in Shell Script

Hi I have a very simple problem: When I run a shell script I start a program which runs in an infinite loop. After a while I wanna stop then this program before I can it again with different parameters. The question is now how do I find out the pid of the program when I execute it? Basically, I wanna do something like that: echo "Execu...

How to remove duplicate words from a plain text file using linux command

I have a plain text file with words, which are separated by comma, for example: word1, word2, word3, word2, word4, word5, word 3, word6, word7, word3 i want to delete the duplicates and to become: word1, word2, word3, word4, word5, word6, word7 Any Ideas? I think, egrep can help me, but i'm not sure, how to use it exactly.... ...

How do I make a window move to the top of other windows in Gnome when that window already has the focus?

I have an application that sends the focus to other windows but those windows then don't automatically display themselves in the foreground, i.e. on top of all the other windows. Where can I configure the preferences of my window manager so that this is the default behaviour? In particular I'm using the Ctrl-0 and Ctrl-Shft-0 shortcuts ...

Using "ar" to combine .o and .a files (Linux)

I'm trying to create a single static library which contains object files and existing static libraries which have all been compiled earlier in the build process. Is there an easy way to do this using "ar", or will I need to unpack (ar x library_name) each library and add its object files to my unified library? Thanks! ...

Images have a fubar color palette when generated under Xvfb instead of normal X.

When generating a png image file in Mathematica on a linux box running X, there's no problem. Doing the same on a linux machine without X but instead Xvfb the png generates fine but the colors are all screwed up. We tried changing the pixel depth from the default of 8, to no avail. Any other tweaks that might make Xvfb mimic normal X ...

Change file time (touch)

I would like to be able to change a file's modification date for use in a web application. For the time being I am testing this directly on the command line. Works fine on my mac, but when I do this on a linux server get error. Command: /bin/touch -m -t 200906041200 /foo/bar/file.whatever Error: /bin/touch: setting times of `/foo/bar/f...

Is it possible to put java 1.4 on 64 bit Ubuntu?

I need to set up a legacy app that uses Tomcat 4 and runs using the 1.4 JDK. I tried to install the linux JDK 1.4 from the sun download site on Ubuntu 9.04 but it wouldnt install. Is it possible to install JDK 1.4 on the 64 bit version of Ubuntu? When I try and install the j2sdk-1_4_2_19-linux-ia64.bin version i get the following erro...

How to make a programme continue to run after log out from ssh?

Possible Duplicate: Linux: Prevent a background process from being stopped after closing SSH client I have a program that takes a lot of time to finish. It is running as root over ssh. I want it to continue to run after I logout,is this possible and how would I achieve this? ...

Sending keycode to Xorg + wine with bash script

How do I send keycode to currently running application in linux which is running under wine? I would like the it to be under bash for simplicity. ...

Flash Programming on Linux

Does anybody knows good IDE that will allow me to develop flash application on Linux? ...