linux

how can I Limit mysql to single cpu, to allow hardware benchmarking

I have a web application that seems to like to make mysql work hard (cpu wise), as a result i want to establish how the performance of our application scales as we transition to more modern hardware, the current system has 2 cpu, and we could move it onto a grid system, but to find out if this is worthwhile i want to benchmark our applic...

My app mem usage is growing using pthread.

Hi, I am using C language and Linux as my programming platform. In my user-space application. I used pthread to create a thread. int main() { pthread_t thread1, thread2; pthread_create( &thread1, NULL, fthread1, NULL ); pthread_create( &thread2, NULL, fthread2, NULL ); return 0; } void *fthread1( void *ptr ) { /* do s...

How To Sort Tab Format File Based on Length of Column K

I have a space delimited tabular file that looks like this: >NODE 28 length 23 cov 11.043478 ACATCCCGTTACGGTGAGCCGAAAGACCTTATGTATTTTGTGG >NODE 32 length 21 cov 13.857142 ACAGATGTCATGAAGAGGGCATAGGCGTTATCCTTGACTGG >NODE 33 length 28 cov 14.035714 TAGGCGTTATCCTTGACTGGGTTCCTGCCCACTTCCCGAAGGACGCAC How can I use Unix sort to sort it by leng...

pthread_create memory leak

Hi, I am using C language and Linux as my programming platform. In my app, I call pthread_create. Then I check the memory usage of my app using ps commandline tool and it adds 4 in the VSZ column. But the problem is when the pthread_create function handler exits, the 4 that was added in the memory was not release. Then when the app ca...

How to make AWK use the variable created in Bash Script

I have script that looks like this #!/bin/bash #exampel inputfile is "myfile.txt" inputfile=$1 basen=`basename $inputfile .txt` # create basename cat $inputfile | awk '{print $basen "\t" $3} # this doesn't print "myfile" but the whole content of it. What I want to do above is to print out in AWK the variable called 'basen' created...

ACL and symbolic link problem

I am setting up a nginx server. I create a user nginx for running the server. And I have some data in the home of another user, victor. I try to set the ACL to let the nginx read those data; here is what I did. The location of data: /home/victor/web/folder/folder2/folder3/data I want to let nginx read those files, so that I create...

Why can't I use Unix Nohup with Bash For-loop?

For example this line fails: $ nohup for i in mydir/*.fasta; do ./myscript.sh "$i"; done > output.txt& -bash: syntax error near unexpected token `do What's the right way to do it? ...

Is there anyway to access the general purpose registers of ARM with C?

I have installed linux 2.6. I wanted to know if there are any drivers to access the GPR port pins. ...

How to set class path for servlet-api.jar file in linux

Hi I want to compile the servlet in the Linux System. For that I need to set the classpath for servlet-api.jar. How to do that? Thanks ...

setlocale return value

Call to the function setlocale(LC_MESSAGES , NULL) returns ""(empty string) not Null or any locale. why do i get this return value ? is it because this feature is not implemented in the platform ? ...

How to read procfs file?

Hi, I tried to read the /proc/modules using standard c functions: FILE *pfile; int sz; pfile = fopen( "/proc/modules", "r" ); fseek( pfile, 0, SEEK_END ); sz = ftell( pfile ); rewind( ftell ); But my problem is ftell give me 0 value. So I can't read the contents of the file since I have a zero length. Is there another way that I can ...

response file mechanism for RPMs

I'm migrating my Sun Solaris packages to rpm redhat. During the installation of a Solaris package it's possible to specify a so-called response file, which allows to set variables during the installation of the package. The Solaris pkgadd command looks e.g. like that one pkgadd -r myresponse.txt -d mypackage.pkg Is there a similar mec...

open source regression suite

Hi, I have a program, let's name it a.out, that reads input from a file and writes some output to stdout. For example a file contains the line 2,2 and my program "./a.out file" writes 4 at the screen. Now in order to be sure that a.out works well after the patch, I am looking for a good regression suite for Linux. I want for every fil...

process's virtual memory size on different machines

Does virtual memory of process can have different size on different machines (CPU, memory)? The process does the same job on both machines. The platform is RHEL 5.3 (kernel 2.6.18) and the process is C++ compiled by gcc (4.1.2). ...

Boost::Interprocess Shared Memory Bus Error

Hi, I'm using CentOS 5.4 x86_64 and Boost 1.42.0 on a cluster that uses Open-MPI 1.3.3. I'm writing a shared library that uses shared memory to store large amounts of data for multiple processes to use. There's also a loader application that will read in the data from the files and load them into the shared memory. When I run the l...

Iframe virus, need to be removed from all phps and html file on linux server

The following line has been added to almost all the php files and some of the html files on my linux server WHat is the command to remove this without damaging anything else? iframe qoluu='V5pEXGSm' src='http://getrelax4you.com/in.cgi?7 ' width='98' height='407' style='display:none'> The beginning and end of the above line has < > and...

Boost Asio On Linux Not Using Epoll

I was under the impression that boost::asio would use an epoll setup by default instead of a select implementation, but after running some tests it looks like my setup is using select. OS: RHEL 4 Kernel:2.6 GCC:3.4.6 I wrote a little test program to verify which reactor header was being used, and it looks like its using the select reac...

How to call sp_help [table] for SQL Server when using Oracle SQL Developer as my client

I am using Oracle SQL Developer in a linux environment to connect to an SQL Server 2005. I don't seem to be able to make a sp_help [table_name] call. Previously, I found it quite useful when I was on a Windows environment using SQL Server management, and could make that call. Is there any way to do this? [edit] error message returned ...

Removing Parts of String With Sed

I have lines of data that looks like this: sp_A0A342_ATPB_COFAR_6_+_contigs_full.fasta sp_A0A342_ATPB_COFAR_9_-_contigs_full.fasta sp_A0A373_RK16_COFAR_10_-_contigs_full.fasta sp_A0A373_RK16_COFAR_8_+_contigs_full.fasta sp_A0A4W3_SPEA_GEOSL_15_-_contigs_full.fasta How can I use sed to delete parts of string after 4th column (_ separat...

psql import file

In postgresql and bash(linux), are there ways to directly import a file from the filesystem like [execute.sh] pgsql .... -f insert.txt [insert.txt] insert into table(id,file) values(1,import('/path/to/file')) There seems to be no import function, bytea_import as well, lo_import would save int and i dont know how to get the file bac...