linux

%preun is passed with value 0 to $1 during upgrade

I have a rpm package which is already installed in the system. I want to replace the old package with the new package with a different package name. The "rpm -Uvh [package name]" should be enough to replace the old package with the new one. After doing some research in the net I found that "Obsoletes" is used to obsolete an old package ...

How are sbrk/brk implemented in Linux?

I was thinking about how the Linux kernel implements system calls and I was wondering if someone could give me a high level view of how sbrk/brk work? I've reviewed the kernel code, but there is just so much of it and I don't understand it. I was hoping for a summary from someone? ...

Is it possible to disable stderr in C++?

I wrote a program for linux using libxml2 for html parsing. Although it does its job, the html parser writes lots of various errors to stderr. Is it possible to disable stderr at all (or redirect it to /dev/null while not having to run it with a redirecting shell script)? I can live with having to write my own errors to stdout, I just wa...

Function interposition in Linux without dlsym

I'm currently working on a project where I need to track the usage of several system calls and low-level functions like mmap, brk, sbrk. So far, I've been doing this using function interposition: I write a wrapper function with the same name as the function I'm replacing (mmap for example), and I load it in a program by setting the LD_P...

problem with the GNU "time" command to measure memory usage

Hello, I've been trying to use the time command /usr/bin/time to measure the peak memory consumption of a program on a linux system. Independently of what executable I experiment with, I get the correct answer for what regards running time, but memory usage figures are always 0. the typical output from time is something like: 8.68use...

meaning of tilde in linux bash (not home directory)

Hi all, First off, I know that ~/ is the home directory. CDing to ~ or ~/ takes me to the home directory. However, cd ~X takes me to a special place, where X seems to be anything. In bash, if I hit "cd ~" and hit tab, it shows a bunch of possible ~X options like ~mail and ~postgres and ~ssh. Going to those folders and doing a pwd sh...

Cross Compiling Linux Kernels and Debugging via VMware

I'm considering doing some Linux kernel and device driver development under a vmware VM for testing ( Ubuntu 9.04 as a guest under vmware server 2.0 ) while doing the compiles on the Ubuntu 8.04 host. I don't want to take the performance hit of doing the compiles under the VM. I know that the kernel obviously doesn't link to anything o...

Turn off buffering in pipe

I have a script which calls two commands: long_running_command | print_progress The long_running_command prints a progress but I'm unhappy with it. I'm using print_progress to make it more nice (namely, I print the progress in a single line). The problem: The pipe activates a 4K buffer, to the nice print program gets nothing ... noth...

reuse vim instance from linux terminal

By making use of the remote feature in vim, is it possible to reuse an instance of vim to load up multiple files as needed. It will be nice to have that facility from within the same terminal instance. I am more keen to have a tab based interface, which available in vim 7+ The scenario should be Open terminal vim file1.cpp Edit - Sav...

What is the best free SQL GUI for Linux (MSSQL, MySQL, Oracle, Etc...)

Hello All, As I make the full switch from Windows to Linux (CentOS 5) I'm in search of the best free GUI SQL Client tool for MSSQL, MySQL, Oracle, etc... any suggestions? I've tried DBVisualizer (The best bet so far but still limited by the free version, not all functionality is there), MySQL GUI Tools (Good but only for MySQL, need oth...

How To Reversibly Store Password With Python On Linux?

First, my question is not about password hashing, but password encryption. I'm building a desktop application that needs to authentificate the user to a third party service. To speed up the login process, I want to give the user the option to save his credentials. Since I need the password to authentificate him to the service, it can't b...

how does a process know when it's been backgrounded?

When I scp a file, I can stop it with ^Z and put it in the background. When it's in the background it stops printing its progress but the copying continues. If I foreground it again, it resumes printing. How does it know? SIGTTOU? does that happen on a standard ptty? ...

Non-blocking version of system()

I want to launch a process from within my c program, but I don't want to wait for that program to finish. I can launch that process OK using system() but that always waits. Does anyone know of a 'non-blocking' version that will return as soon as the process has been started? [Edit - Additional Requirement] When the original process has ...

Experience building and using Qt Embedded

I am currently trying to compile and build QT for Embedded Linux on an Ubuntu box for ARM architecture. So far, I have run into MANY errors while trying to MAKE. The biggest one being a 2000 line C++ function which caused a compiler error. What are other peoples experiences with this and how did you fix it? ...

Is there any MSDN equivalent for Mac OS and Linux?

Hi, I'm familiar to code in Windows environment. For some of our products, users are continuously asking for porting to Linux and Mac. To begin, I need a collection of documentation on the system APIs, how to use them, when to use them etc. documentation. So, is there Is there any MSDN equivalent for Mac OS and Linux? Preferably in a do...

Complete C++ i18n gettext() "hello world" example.

I am looking for a complete i18n gettext() hello world example. I have started a script based upon A tutorial on Native Language Support using GNU gettext by G. Mohanty. I am using Linux and G++. Code: cat >hellogt.cxx <<EOF // hellogt.cxx #include <libintl.h> #include <locale.h> #include <iostream> #include <cstdlib> int main (){ ...

Java / Ada Big Endian to Linux Little Endian problems.

I am an intern who has inherited a problem with a testing program at the place where I am working. After searching around on a little bit I can across a person with my exact same problem. After asking around a little bit here, i found out that the guy who posted this does actually still work here, and I am getting his help with this too,...

Bash: how to traverse directory structure and execute commands?

I have split a large text file into a number of sets of smaller ones for performance testing that i'm doing. There are a number of directories like this: /home/brianly/output-02 (contains 2 files myfile.chunk.00 and myfile.chunk.01) /home/brianly/output-04 (contains 4 files...) /home/brianly/output-06 (contains 6 files...) It's import...

Unix permissions from Windows

Hi all, I have a D-Link DNS-323 NAS, running some sort of Linux as its OS. I map a volume as a share in Windows Vista (Ultimate SP2). There are some directories and files on that share that I cannot change/delete - no matter what I try. Trying all of Windows security/permissions dialogs don't work, as the files owner is "Unix/root" and a...

Exceptions on Linux from a shared object (.so)

I have a test program called ftest. It loads .so files that contain tests and runs the tests that it finds in there. One of these tests loads and runs a .so that contains a Postgres database driver for our O/RM. When the Postgres driver throws an exception which is defined in that .so file (or one that it links to, but ftest does not li...