linux

Linux: how to set up a timezone of a process?

Hi I'd need to set timezones of individual processes started on a linux box. I tried setting TZ variable (in the local context), but it didn't work. Is there a way of running an app from a command line with a different system date to the system one? It might sound stupid, but I need a kind of a sandbox where the system date would be cha...

dynamically loading static library?

Can a static libary *.a in Linux be dynamically loaded at runtime? I've read here that ...both static and shared libraries can be used as dynamically loaded libraries. How to dynamically load static library? ...

how to delete the policy in linux?

Hi, I am working on setkey command in linux, I am able to delete the all the policies by using setkey -FP option.But i want to delete only one policy at a time .. please tell me any one Regards, ven ...

Linux (Ubuntu 9.04) permissions - how do I remove rws?

I have a directory that has rwxrwsr-x as its permissions and I need to set group to rwx. How can I do this on the command-line? I have root access. ...

why after setting LD-LIBRARY_PATH and ld.so.cache properly, there are still library-finding problems?

I have a certain shared object library in a special directory which I make sure special directory is in $LD_LIBRARY_PATH make sure this directory has read and execute permisions for all make sure appropriate library directory is in ld.so.conf and that root has done a ldconfig (verify by checking for library using ldconfig -p as normal...

Questions about the GNU linker editor "ld" ?

I have 2 obj files assembled with GNU as, they are: a.o : my major program b.o : some utility functions a.o doesn't have an entry point. The final linked file will be loaded into memory and the execution will jump to its very beginning loaded address, where is the first instrucion of a.o. Now I want to link them together with GNU ld...

Conditional move problem

Code fragment from Assembly exercise (GNU Assembler, Linux 32 bit) .data more: .asciz "more\n" .text ... movl $more, %eax # this is compiled cmova more, %eax # this is compiled cmova $more, %eax # this is not compiled Error: suffix or operands invalid for `cmova' I can place string address to %eax using movl...

Cannot create a program which will invert string

I am using Linux. I am trying to write a program in c that will print a string backward. Here is my code: #include <stdio.h> #include <string.h> #include <stdlib.h> int main (){ char string[100]; printf ("Enter string:\n"); gets (string); int length = strlen (string)-1; for (length = length; length>=0; length--){ ...

Writing a SOAP service on Linux - tools, help needed

I need to write a SOAP service for Linux (CentOS). I need to do this using Lazarus/FreePascal. The service needs to be a binary (daemon) that runs in the background. Questions: 1. Is this possible (as a standalone executable)? 2. If not, what are the alternatives? 3. How do I start? 4. What additional tools/libraries do I need? ...

Replacement for <conio.h> in Linux

I need to transfer a windows C++ project to linux, however I am currently using MS <conio.h> which is not linux or standards compatible. What header do you recommend to replace it for use in Linux? I would prefer the answer is cross platform too. ...

remove item from python path

I have added a path to the system pythonpath on linux and now i've broken it. How may i remove it ? [EDIT] Finally i solved it removing the script that added that path + installing something to rebuild the path. ...

Porting a shared memory JNI app from Linux to Windows for use with NTP

I have a small JNI program that uses shared memory to update NTP on a Linux server. The C portion of the code has three functions: attach the shared memory, set the time stored in the shared memory, and detach the shared memory. I would like to be able to run this program in Windows, while keeping the C code at least somewhat portable....

Specific web page started to occasionally result in 500 internal error

Hi, I've come across an issue today where a specific page on my site is sometimes causing a 500 internal error. The page normally can take fairly long to load due to some database queries on large datasets, but only today has the apache 500 internal error started to happen. Obviously I will try to optimise the db queries as much as possi...

Working with block special files/devices to implement a filesystem

I've implemented a basic filesystem using FUSE, with all foreseeable POSIX functionality implemented [naturally I haven't even profiled yet ;)]. Currently I'm able to run the filesystem on a regularly file, but the next step in development is to host it on an actual block device. Running my code as is, immediately fails on reading st_siz...

Are ioctl driver functions executed from an atomic context under linux 2.6?

I am tracking down a "scheduling while atomic" error in one of our drivers, and am wondering if ioctl's are an atomic context. Also if any one has anything to share on how to get into and out of atomic contexts, and common places they occur, it would be helpful. ...

Abort a program after a certain time

I'm trying to develop a test case for a program, and would like to fail the test case if it runs over 4 seconds. How can this be done on linux? (I'm using Ubuntu) I know I can time the execution and fail it time > 4, but that's just a bad approach. Thanks! ...

Anyone successfully using Visual Studio/IIS/SQL Server on a Windows 7 VM on Linux host for work?

I'm getting sick of various annoyances about Windows 7 like permissions and crap like that, but I need to run it for development. Any one run Windows 7 VM with development environment for .NET and a local SQL DB (as well as IIS) on top of an Ubuntu host as their work station? If so what have you found to be the best Virtualization softwa...

system modal dialog in GTK

Hi Experts, I am trying to create GtkDialog with system wide Modal property i.e. when the dialog is opened no other window should get focus. There is an option for making it modal using GtkDialogFlag but that is not system wide modal. Please I need your help urgently. Kind Regards, -Durgesh O Mishra ...

How to read input from the stdout of another command (pipe) in linux shell script?

My objective (read Homework) is to find the process that is consuming the most CPU and RAM by writing a script. I've managed to extract the info from TOP command however I'm having trouble parsing the output. The following command top -b -n 1 | tail -n +8 | head -n 1 will output something similar to this single line 915 root ...

Can perf display raw sample counts?

I'd like perf to output raw sample counts rather than percentages. This is useful for determining whether I've sped up a function I'm trying to optimize. To be clear, I'd like to do something like perf record ./a.out perf report and see how many times perf sampled each function in a.out. Shark can do this on Mac, as can (I believe)...