I have to log into Linux servers from different customers and use there essential tools like SVN, etc. Most of the times I get no root access, and usually the administrator is on holidays 🙂 so I have to get the way to use this tools there. Sometimes this is very straightforward process, just compile the code.…
Tag: linux
Facing an error “*** glibc detected *** free(): invalid next size (fast)”
Please see MSO question A long list of possible duplicates — C memory allocation and overrunning bounds for information about closely related questions. Developer environment: CentOS 4.7, Kdevelop 3.1.1, gcc 3.4.6 I run a Java test client that loads a C++ shared library using JNI. There are three components i…
Capturing high-quality(300dpi) screenshots of QT-based app in Linux
I need to make a screenshot of my form created in QT designer. There are numerous approaches to do screenshots(gimp, import, etc..) but alt of them deal with same dpi as on my monitor(about 100dpi). This is quite enough to publish on web site, but 300dpi images are required for paper publications. Are there a…
Code Signing for Linux
Are there any providers offering code signing certificates for (Red Hat Enterprise) Linux? I see a lot of buzz for Microsoft-land, but not much for Linux. I know how to generate my own certificates and embed a public certificate into my executable. I’m specifically looking for ways to get the certificat…
Get IP address of an interface on Linux
How can I get the IPv4 address of an interface on Linux from C code? For example, I’d like to get the IP address (if any) assigned to eth0. Answer Try this: The code sample is taken from here.
Get notified about network interface change on Linux
I need a way to notify my user space app when a network interface is enabled or disabled. I’m hoping to do this without resorting to polling. Does the kernel offer some sort of hook for triggering callback functions when network-related events occur? Answer I believe the netlink (man 7 netlink) facility…
Postgres pg_dump dumps database in a different order every time
I am writing a PHP script (which also uses linux bash commands) which will run through test cases by doing the following: I am using a PostgreSQL database (8.4.2)… 1.) Create a DB 2.) Modify the DB 3.) Store a database dump of the DB (pg_dump) 4.) Do regression testing by doing steps 1.) and 2.), and th…
How can I have a post-commit hook that is only called when commits are made to TRUNK?
I have a repository that has the following directories: branches tags trunk The trunk directory contains the main line of development. I have created a post-commit hook script for the repository that updates a working copy (of trunk) when a user commits back to repository. It looks something like this: I̵…
Limiting syscall access for a Linux application
Assume a Linux binary foobar which has two different modes of operation: Mode A: A well-behaved mode in which syscalls a, b and c are used. Mode B: A things-gone-wrong mode in which syscalls a, b, c and d are used. Syscalls a, b and c are harmless, whereas syscall d is potentially dangerous and could cause in…
getting a program to return immediately at the command line so it’s not tied to the shell that launched it
Some programs return immediately when launched from the command line, Firefox for example. Most utilities (and all the programs I’ve written) are tied to the shell that created them. If you control-c the command line, the program’s dead. What do you have to add to a program or a shell script to ge…