Grep and Pipe in Linux
I have a giant file where I want to find a term "model". I want to pipe the first 5 lines containing the word model to another file. How do I do that using Linux commands? ...
I have a giant file where I want to find a term "model". I want to pipe the first 5 lines containing the word model to another file. How do I do that using Linux commands? ...
Hello, I have to build up a system which listens for requests from a GPS device which is only capable of sending UDP requests. Then I am going to analyze requests hopefully by PHP if it is possible. I do not know where to start. What do I need? Can I make use of PHP? Would it be reliable to use PHP? Can I just adjust Apache for listen...
abc.dat file contains lines 1 2 3 code is tradeline="" for line in $(cat abc.dat) do tradeline="$line,$tradeline" done sample output am getting is 1,2,3, but i want the output as "1","2","3", can u help me plz ...
I'm looking for dialog widgets for the Linux Console (not X, but the "terminal" console) that would show a countdown in seconds next to a widget that might be a menu list or a textbox. Ideally this might be a standalone program, like dialog, that is supplied parameters to control its behaviour. When the countdown reaches 0, the selecte...
Hi all, I was writing a sample example involving multiple files. The detailed code is as follows. main.cpp #include <algorithm> #include <iomanip> #include <ios> #include <iostream> #include <stdexcept> #include <string> #include <vector> #include "grade.h" #include "Student_Info.h" using std::cin; using std::cout; using std::domain...
How can I determine the current CPU utilization from the shell in Linux? For example, I get the load average like so: cat /proc/loadavg Outputs: 0.18 0.48 0.46 4/234 30719 ...
Anyone has a demo available? Sendmail is said to be not scalable,but it's free,so I decided to use it first for now:) ...
Hi! I'm trying a Haxe-compiled solution called FAR (Flash Archiver) created by Edwin Van Rijkom (http://code.google.com/p/vanrijkom-flashlibs/) wich uses a command-line tool for creating compressed archives. When running the FAR tool locally on my ubuntu laptop, everything works fine. When running remotely (terminal as Root) on my Ubunt...
I have a problem running the below code , which invokes getutent() to count the total number of users currently logged in to the system. The timer will be invoked every 1sec and will set the boolean named "isSigAlrmOccured" to true and exit.The main function checks whether the timer signal is delivered by checking this boolen and monitor...
I know that I can use cmp, diff, etc to compare two files, but what I am looking for is a utility that gives me percentage difference between two files. if there is no such utility, any algorithm would do fine too. I have read about fuzzy programming, but I have not quite understand it. ...
I've got a video that's 30 minutes long. I want to make a speeded up version that's (say) 15 minutes long. I could do this by dropping every 2nd frame. How can I do this on linux? I'm playing with gstreamer and it looks cool. Is there a way to do this with gstreamer? What would be the gst-launch command line to do it? My source video i...
We are trying to port our code from HPX to AIX but getting core dump while running exe. its failing in some unknown function ptrgl_64._ptrgl. > ptrgl_64._ptrgl() at 0x900000084da0e48 > dfile_Proc(o_record = > 0x0000000400000004, fileType = > "^O\377\377\377\377\377TH^O\377\377\377\377\377TQ^O\377\377\377\377\377Ta^O\377\377\377\377\377...
I'm wondering if there's a way to determine which version of Linux I'm running (ie differentiate between RHEL4, RHEL5) from within the JVM. I'm just looking for a consistent way to differentiate between the operating systems and their versions. ...
I want to make a progress bar for my terminal application that would work something like: [XXXXXXX ] which would give a visual indication of how much time there is left before the process completes. I know I can do something like printing more and more X's by adding them to the string and then simply printf, but that would lo...
Hi all, I have a function which calls itself 10 times a second. I am using QTimer for repeat calls. void DisplayClass::UpdateGuiWithData() { //miscellaneous code which is validated SingletonObjectAsThread::instance()->UpdateFromGuiToExternalHardware(ClassOjbectArray,var1,var2); QTimer::singleShot(100,this,SLOT(UpdateGuiWithData())...
I am developing a cross-platform application in C++ in VS2005. I already know how to run a remote process on a windows box, attach it, and debug from my VS. Is there a way to do debug a running process on Linux for example? What about other *nix platforms such as Solaris or AIX? I can do emacs+gdb, but if this can be done from VS I'd pr...
How can i get the systems ioWait? This would be preferable by using info the /proc interface( i guess its written somewhere in there) so an app could detect this, but an external call to exec() from my app would be acceptable. ...
How to make Floating tool bar in Qt, just like the top floating panel of Microsoft Windows RDP client, any code example? Regards ...
Hello All , i want to make one script which will automatic telnet the system . I have to access from my system(Windows Xp) to my server(Linux) spawn telnet <machine ip> expect "login:" send "<username>\n" expect "Password:" send "<password>\n" Is the above script is correct? 1) If yes means, how can i access this script from my ...
My Rails application has a number of tasks which are offloaded into background processes, such as image resizing and uploading to S3. I'm using delayed_job to manage these processes. These processes, particularly thumbnailing PDFs (using Ghostscript) and resizing images (using ImageMagick), are CPU intensive and often consume 100% CPU ...