I commonly work with text files of ~20 Gb size and I find myself counting the number of lines in a given file very often. The way I do it now it’s just cat fname | wc -l, and it takes very long. Is there any solution that’d be much faster? I work in a high performance cluster with Hadoop
PHP run linux “less” command via exec – binary file warning
I have to convert some PDF files to TXT. I end up with “less” command, because for example pdftotext has some problems with tables in PDF. The problem is that when I ran the command from exec function (or shell_exec/system), less just showing me information, that selected PDF is binary file and result file is just TXT with PDF data
Better bash script to create directory structure
I want to create folders with plain text with a structure like: I thought about using a base command like mkdir and found that post : Bash script that creates a directory structure, but it still needs to write structure like : So I would need to change the regex used in : What bash command could I use to
perl byte code generation with too many file.pl
How to make perl bytecode if sub is there in another file.pl so that I can get all perl script in to binary to give for usage but I am getting codedump warning. Here is the example how I have done! File: add.pl File: util.pl Then when I run: I get I also tried but it says Note: If both
Is there a way to improve performance of linux pipes?
I’m trying to pipe extremely high speed data from one application to another using 64-bit CentOS6. I have done the following benchmarks using dd to discover that the pipes are holding me back and not the algorithm in my program. My goal is to achieve somewhere around 1.5 GB/s. First, without pipes: Next, a pipe between two dd processes: Are
Maven Multiple platform dependent Packages
I have written an application in Java that can be used on both Linux and Windows. Currently by running mvn package, my maven build system will generate a .msi using WiX. Is there a way of creating two package ‘tasks’ so I can say either mvn package-windows ormvn package-linux` Answer If you want to package both versions (Linux and Windows),
Linux Mint trigger slowly query on mysql on system booting
My debian-based is booting so slow after I installed MySQL and imported some databases on it. Looking for some statement, I found this one during boot: Here the statement that causing trouble: I have +-10 databases totaling over 8gb of data. Is there any configuration to disable this query on system booting ? If yes, why run it during boot
Linux Kernel Memory Management Paging Levels
I’m reading through the book “Understanding Linux Kernel” by Bovet and Cesati. In the second chapter, under “Paging in Linux” the author mentions how Page Middle and Upper Directories are eliminated with 32 architectures not having PAE enabled. I’m having trouble following what the author means. They have been loose in their treatment and does not make a whole lot
How can I replace special character in a string with underscores using a Perl script?
I have a script taking mythtv recorded shows and encoding them in h264 using handbrake. the script is written in Perl. My questions is how do I replace spaces and special characters with and underscore using perl? The strings look something like this when output “Parks and Recreation – S05E01 – Ms. Knope Goes to Washington” I would like it
Eclipse CDT: Symbol ‘cout’, ‘map’, ‘vector’, ‘size_t’, etc could not be resolved
There is a lot of posts about that and I have already tried to apply solutions that have worked for others, but still not for me. First, everything was fine with a c++ project I am working on under Linux, with Eclipse Indigo, gcc-4.7.1, cx11 activated, and Gentoo Linux. My project uses a home built static library. I made some