Skip to content

High performance reading – linux/pthreads

I have moderately large binary file consisting of independent blocks like this: header1 data1 header2 data2 header3 data3 … The number of blocks, the size of each block and the total size of the file vary quite a lot, but typical numbers are ~1000 blocks and average blocksize 100kb. The files are genera…

How to make GREP select only numeric values?

I use the df command in a bash script: This script returns: But I need only numbers (to make the next comparison). If I use the grep regex without the dot: I receive nothing. How to fix? Answer If you try: It returns: Here’s the details on the -o (or –only-matching flag) works from the grep manual…

Increasing the caching capability of MySQL

My mysql only caters read requests. I thought, it will be a good idea to make use of the cache completely. I am running MySQL in a VM and that is the only application running inside the VM. I am allocating 2GB memory for that VM. I am using a 64 bit centos on the VM. If you think already