linux

Javascript on different platforms

I've got a simple js script that scrolls image horizontaly. the strange thing is, it loads CPU up to 100% on windows, while on linux the CPU load rarely reaches 20% on the same computer. I've tested this in firefox, chrome and opera on both platforms — results are practically the same. Can someone explain what's going on? <script> v...

How to detect a USB connection in linux/Qt

hi all, i am extremely new to both qt and linux , can u please tell me a way how to detect a usb device connection and disconnection using qt in linux platform . any help , doccuments, urls/sites where i can get the basic information (in detail would be even better) is appriciated. please help thanks in advance, SAMBEET KUMAR...

How to fetch cpu utilization of a particular process in linux

I have used following command to fetch the CPU utilization of a process. It is giving result, but it is not coming out. I have used following command. top | grep <processname> I just want to put this in a loop and I will insert sleep in the code so that I can fetch the value in regular intervals ...

Opening an existing process

I am using Eclipse in Linux through a remote connection (xrdp). My internet got disconnected, so I got disconnected from the server while eclipse was running. Now I logged in again, and I do the "top" command I can see that eclipse is running and still under my user name. Is there some way I can bring that process back into my vie...

Shell Script - Linux

Hey, I want to write a very simple script , which takes a process name , and return the tail of the last file name which contains the process name. I wrote something like that : #!/bin/sh tail $(ls -t *"$1"*| head -1) -f My question: Do I need the first line? Why isn't ls -t *"$1"*| head -1 | tail -f working? Is there a better wa...

Most stable Linux Distribution for Drupal?

I have a VPS that is running Fedora Core 6, with yum somehow removed (Why do you do that Network Solutions?). I don't have an overwhelming amount of experience with any distribution of Linux, so I set up my own server running FC12. However, when I transferred over my Drupal site, I had some errors that I had trouble fixing. Granted, the ...

Using Linux and .NET

I want to use Ubuntu Linux, but I cant because I need to programming in .NET What can you advise me to do? ...

How do I configure nginx to have a Rails app at a domain and WordPress at /blog/ ?

I've got a Rails app deployed via nginx/passenger. It will have multiple domains pointing to it. I'm wondering if it's possible to configure nginx so that any URL that matches [somedomain.com]/blog/ will be servered by PHP/WordPress located in a different directory. So, for example: domain1.com, domain2.com, & domain2.com/some-resou...

Directory printing tool?

I have a very complex web app project I want to re-structure. Naturally, it consists of a considerable number of folders and sub-folders. I have a huge piece of paper ready to sketch a new structure on. Now, I need paper printouts of the projects. Some directories I need in full detail including their files - the /library directory for ...

An efficient way to detect corrupted png files?

I've written a program to process a bunch of png files that are generated by a seperate process. The capture mostly works, however there are times when the process dies and is restarting which leaves a corrupted image. I have no way to detect when the process dies or which file it dies one (there are ~3000 png files). Is there a good wa...

How to profile program on Linux platform without rebuilding ?

I've used two profiling tools (VTune on windows and dbx (within sunstudio) on Solaris) which can profile program without rebuild them, and during profiling, the program just run at the same speed as normal. Both of these 2 features saved me a lot of time. Now I want to know if there is some free tools available on Linux platform can do ...

How to flush cache of hard-disk and flash-disk (or filesystem) from command line?

I'm writing a backup script which Copies the data to backup disk. Flushes the backup disk. Performs a hash integrity check. Before I used to do sleep(60) for waiting a minute so that data is automatically flushed by the kernel. Which I guess is overkill so now I'm trying sudo hdparm -F --verbose /dev/disk but it reports error - HDIO...

Crontab job does not start... ideas?

Hey folks, thanks for helping me setting my cron jobs, crontab has really been a gold mine for me. Unfortunately I have a problem, and have no idea what so ever what it might be... basically a job does not start while the neighbour jobs do. I'll explain This is my crontabs job list: */10 * * * * python /webapps/foo/manage.py fe...

Better way to script USB device mount in Linux

Hi. I'm writing a python module for a device that interacts with a user supplied USB memory stick. The user can insert a USB memory stick in the device USB slot, and the device will dump data onto the memory stick without user intervention. If the device is running when the user inserts the USB stick, I have hooked into D-Bus and have an...

Double UDP socket binding in Linux

In C++, when I run (red alert! pseudo-code) bind(s1, <local address:port1234>) bind(s2, <local address:port1234>) on two different UDP sockets (s1 and s2 each created with a call to socket()) I get problems. In Linux (Ubuntu), the double binding seems to be fine. In Windows, however, the double binding fails, and the call to bind() th...

Program configuration data in Unix/Linux

What is recommended way to keep a user configuration data in Unix/Linux? My programming language is C++. Configuration data will be kept in XML/text/binary format, I have no problem with handling such files. I want to know where can I keep them. For example, in the Windows OS configuration data may be kept in the Registry (old way) or in...

how do i conbvert a gstreamer program to stream video via udp into Qt?

please help me convert this into a qt program. this is a gstreamer program to stream video via udp source. i need to implement this in Qt......the program i'm using is shown below.......... #include #include #include GstElement *pipeline, *source, *decoder, *video_s...

How to block all connection in squid

How do I block all connections from clients to any website? I have had the client computers to use my linux machine with squid installed as a proxy server. I am new to squid and I have installed it in my linux box. I wanted to see if it is really working. How should I configure squid.conf to block all client request to the proxy. If I c...

Serial port : Read data problem, not reading complete data

Hi I have an application where I am sending data via serial port from PC1 (Java App) and reading that data in PC2 (C++ App). The problem that I am facing is that my PC2 (C++ App) is not able to read complete data sent by PC1 i.e. from my PC1 I am sending 190 bytes but PC2 is able to read close to 140 bytes though I am trying to read in ...

python-pam & pam_time module -- possible to check a user without password?

I've looked at the example script of python-pam and linux pam pages, but it's a bit confusing, at least for a beginner in PAM (that I am): http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/Linux-PAM_ADG.html http://packages.ubuntu.com/python-pam Is it possible to check if a user has or does not have access to login, without enteri...