linux

i18n/gettext : setlocale configuration in web applications

So I started messing around with gettext but I'm still puzzled about certain things, would be great if anyone could help me out and fill in the gaps for me. Usually most of the implementations just invoke setlocale based on a language parameter. Is there any case in which I need to use putenv, perhaps for edge cases on Windows setups? ...

Simulate a faulty block device with read errors?

I'm looking for an easier way to test my application against faulty block devices that generate i/o read errors when certain blocks are read. Trying to use a physical hard drive with known bad blocks is a pain and I would like to find a software solution if one exists. I did find the Linux Disk Failure Simulation Driver which allows cr...

is it possible to have a C/C++ GUI application in linux bare-bone server?

I am very disappointed with my school linux server when doing the homework on it. The reason is: my homework requires to make GUI application. All the tool that I have is: - ssh from my local machine to school machine - gcc/g++ in my school machine I have been thinking and tried out different solutions for a week. I still can't be ...

How to debug FUSE filesystem crash in Linux

Currently I am developing an application using FUSE filesystem module in Linux (2.6 Kernel) in C language. Due to some programming error, the application crashes after mounting the filesystem. Since I am a novice developer in Linux/C environment. Could you please let me tell me possible options to debug such programs? ...

How can I know where the segment of memory is all Zero

I mean, I malloc a segment of memory, maybe 1k maybe 20bytes.. assume the pointer is pMem How can I know the content pMem refered is all Zero or \0 . I know memcmp but the second parameter should another memory address... thanx ...

java process is frozen(?) on linux

Hi, all. This is my first question on S.O. I have a very odd problem. Below is my problem... I write very simple method that write some text to a file. Of course it works well my machine(XP, 4CPU, jdk1.5.0_17[SUN]) But it somtimes freezes on operating server (Linux Accounting240 2.4.20-8smp, 4CPU, jdk1.5.0_22[SUN]). kill -3 doesn'...

Does Solaris have a problem with popen?

Please have a look on this code: #include <unistd.h> #include <stdlib.h> #include <stdio.h> int main() { FILE *process_fp = popen("make -f -", "w"); if (process_fp == NULL) { printf("[ERR] make not found!\n"); } else { char txt[1024] = "all:\n\t@echo Hello World!\n"; fwrite(txt, sizeof(char), strl...

Filtering UDP loopback on Linux in C

Hi, I have an application bound to eth0, sending UDP packets on port A to 255.255.255.255. At the same time, I have a UDP server bound to eth0, 0.0.0.0 and port A. What I want to do is to make sure that the server won't receive messages generated by the application (handled purely in software by the kernel) but it will receive messages ...

Performance profiling on Linux

What are the best tools for profiling C/C++ applications on *nix? (I'm hoping to profile a server that is a mix of (blocking) file IO, epoll for network and fork()/execv() for some heavy lifting; but general help and more general tools are all also appreciated.) Can you get the big system picture of RAM, CPU, network and disk all in on...

Creating customized .dmg files upon download

I want to distribute a cross-platform application for which the executable file is slightly different, depending on the user who downloaded it. This is done by having a placeholder string somewhere in the executable that is replaced with something user-specific upon download. The webserver that has to do these string replacements is a L...

Command line CSV viewer?

Anyone know of a command-line CSV viewer for Linux/OS X? I'm thinking of something like less but that spaces out the columns in a more readable way. (I'd be fine with opening it with OpenOffice Calc or Excel, but that's way too overpowered for just looking at the data like I need to.) Having horizontal and vertical scrolling would be ...

Excecute iwconfig from a java application

Is it possible to execute iwconfig (or any other shell based program) from a java application and then parse the output somehow? If yes, how? ...

Can POSIX message queues be used cross user on Linux?

Hi all, I have implemented a POSIX message queue. On the listener side, I am opening the queue like this: mqdes = mq_open(s_mailbox_name.c_str(), O_RDONLY | O_CREAT, S_IRWXU | S_IRWXG | S_IRWXO, NULL); On the sender side, I am opening the queue like this: mqdes = mq_open(m_s_mailbox_name.c_str(), O_WRONLY); The string is the same o...

why can't I find my.cnf?

I did updatedb. I did locate my.cnf But I cannot find it? Nothing. (I installed MYSQL using aptitude install mysql-server, and mysql does work right now.) ...

Postgres Error (Getting PLJava set up)

I have been struggling with a problem trying to get PLJava to work on PostgreSQL on RHEL. Here is what I have (based off of this: PL/Java README) .cshrc setenv JAVA_HOME /opt/jdk1.6.0_17/ setenv LD_LIBRARY_PATH ${JAVA_HOME}/jre/lib/i386 setenv LD_LIBRARY_PATH ${LD_LIBRARY_PATH}:${JAVA_HOME}/jre/lib/i386/client setenv LD_LIBRARY_PATH ...

What does "$$" means in shell script?

I came across "$$" expression in shell script, something like this TFILE=$$ Can anyone tell me its meaning? ...

How do I access a SQL Server database from a Perl script in Linux?

I have a Perl script on a Linux (Ubuntu 8.10) machine and I need to write data to a SQL Server Database. I've been trying to use the DBD::ODBC module but I can't get it to connect. Where can I get a free/open source driver to use to use for the ODBC connection or is there another way to do this from Perl on Linux? ...

difference between -h <name> and -o <outputfile> options in cc (C++)

I am building .so library and was wondering - what is the difference b/w -h and -o cc complier option (using the Sun Studio C++) ? Aren't they are referring to the same thing - the name of the output file? ...

web developer tools linux

I started using Linux for PHP web development. What is a helpful toolset to use for web development (mostly PHP) available for the Linux platform. My Current IDE is netbeans and I am happy with it. ...

Why does this linux shell command halt the system?

Warning: malicious code. Do not try this. It appears here for educational purposes only. If you type this shell snippet in your shell, your system seems stopped, do you know why? :() { :|:& }; : # the only thing you can do is reboot your system.. Can you gimme some explanation ...