linux

Web Server for testing on Linux.

I am looking for a simple easy to use lightweight Web server ( linux/Ubuntu Koala ) for testing some web apps. On Windows I used Web Savant ( which was rather easy, just enter the html directory and the bin directory and press start ) to give some people an idea of what I'm looking for. Update: My apologies. I didn't realise that this...

Why are my processes in MySQL disappearing for some reason?

When I do: show processlist I see all my 20 servers connected to it. But, after a while, they drop off one by one. I know it's not the script problem. My script does Not terminate. Could it be that it time-out if it doesn't make a query within a certain time? How do I change that setting? Edit: The python script selects and inserts ...

safe way to use dprintf

Linux has this nice function dprintf: The functions dprintf() and vdprintf() (as found in the glibc2 library) are exact analogues of fprintf() and vfprintf(), except that they output to a file descriptor fd instead of to a given stream. however as that same source points out: These functions are GNU extensions, not in C or POS...

Symbolic link to latest file in a folder

Hello, I have a program which requires the path to various files. The files live in different folders and are constantly updated, at irregular intervals. When the files are updated, they change name, so, for instance, in the folder dir1 I have fv01 and fv02. Later on the day someone adds fv02_v1; the day after someone adds fv03 and so...

extracting jar files

how do we extract jar files in ubuntu???? ...

gdb without gcc

Is it possible to run GDB with a program assembled with as and linked with ld? With gcc adding the flag -g allows for debugging but I get the error No symbol table is loaded. Use the "file" command when I try to add breakpoints to a loaded program. Thanks! EDIT Maybe I should make it clear that I'm learning and programming in assembly...

Get current date and time in seconds

time_t rawtime; struct tm *mytm; time_t result; time(&rawtime); mytm=localtime(&rawtime); mytm->tm_mon=month-1; mytm->tm_mday=day; mytm->tm_year=year-1900; mytm->tm_sec=0; mytm->tm_min=0; mytm->tm_hour=0; result = mktime(mytm); Above code snippet,I'm expecting result to display the no.of seconds lapsed since 1970,jan-1st for th...

Building and using shared libraries with bjam

Hello! Using bjam on ubuntu, I am building a c++ shared library and trying to use it in an executable. I have to build as shared since it wont link as static (lots of undefined references arise). Thats fine. Two related problems: 1) Using a heirarchy of Jamfiles, my exe project (testServerHub) has a dependency on the shared library (p...

SVN Error: Can't convert string from native encoding to 'UTF-8'

I've got a post-commit hook script that performs a SVN update of a working copy when commits are made to the repository. When users commit to the repository from their Windows machines using TortoiseSVN they get the following error: post-commit hook failed (exit code 1) with output: svn: Error converting entry in directory '/home/websi...

How to change colors programmatically in Konsole based on current directory?

I currently use a color scheme based on which directory that I'm working in. I manually open up a Konsole shell and then cd into a directory and got to Settings and change the color scheme. What I would like to do is have Konsole automatically set its foreground and background colors based on which directory I'm in. Basically if I'm i...

yum install php-pear* on centos

Hi, I'm trying to install pear on my centos. I've used "yum install php-pear*" to install pear and it seemed to install with success. No errors. I restart my server. However when I check out phpinfo(). I see that my php is still built using "--without-pear". Isn't yum supposed to rebuild my php with pear? What would be possibly going...

[com.ctc.wstx.exc.WstxIOException: Socket closed Exception with WebLogic WebService interop with .NET WCF

We have an application that accepts an uploaded file, but intermittently throws a Socket closed exception. Client is .NET using WCF to connect to a WebService in WebLogic 10.3 using the JAX-WS annotations to create the web service. Intermittently, while uploading large files, we receive Socket closed exceptions and are having trouble d...

pthread_exit() and initial thread

When I use pthread_exit() in the initial thread, the initial thread switches in the terminated state. But I did not understand about the process. Can exist a running process with the initial thread in the termitated state? ...

svn problem. I can't add it because it's already in another SVN.

svn add guess_language/ svn: warning: 'guess_language' is already under version control Why is this? When I downloaded it, it was under SVN. (I downloaded it from SVN) How do I release that svn...so that I can turn it into a regular directory? ...

How do I get per-cpu stats (system, idle, nice, ...) like the "top" command does?

On linux, I'd like to know what "C" API to call to get the per-cpu stats. I know about and could read /proc/loadavg from within my app, but this is the system-wide load avarages, not the per-cpu information. I want to tell the individual CPUs or cores apart. As an example of an application that does this, When I run top and press "1",...

open() fails to open files

For some reason I can't get open() to open a file. Here's my code. static int context_ctor(X86Context *ctx) { char file[512]; memset(ctx, 0, sizeof(X86Context)); sprintf(file, "%s.%d", "test", getpid()); ctx->fp = open(file, O_RDWR); if(ctx->fp < 0) { printf("errno %d %s\n", errno, file); return VI...

sc_trans metadataPattern

metadataPattern The pattern used to extract metadata from a file name if metadata does not exist or useMetadata == 0. default is /%N. for unix and \%N. for windows %N = song name %G = genre %A = album %R = artist %Y = four digit year %# = sequence of digits %% = % character [] = brackets option...

way to send strings to stdout AND socket in 1 line

I want to write this to only 1 line: fprintf(stdout, "RCPT TO: <%s>\r\n", argv[argc-1]); fprintf(sockfd, "RCPT TO: <%s>\r\n", argv[argc-1]); so i want to send the same string to stdout and to my open socket. How can I do this? ...

Python / Linux/ Daemon process trying to show gtk.messagedialog

Hi, on Ubuntu 8/9, i'm trying to write a daemon in python, that monitors a certain network condition and informs the user using a gtk.messagedialog. I installed this script using rc-update. The daemon starts at boot, but doesn't show the dialog even after I login. I assume because init.d starts my daemon at tty1 and no gnome is availabl...

switching to open source solutions

I'm a ASP.NET MVC Visual Studio, SQL Server web developer. I would like to switch to equivalent open source solutions. Please help me out. ...