linux

C++ Access to SQL Server from Linux

I need to write some data to SQL Server database from Linux in C++. I found this sqlapi.com But I think, at first ODBC driver has to be installed and has to work. I folowed this adminlife.net/allgemein/mssql-zugriff-unter-debian-etch-mit-unixodbc-und-freetds/ or this http://b.gil.megiteam.pl/2009/11/linux-odbc-to-mssql/ But it didn't...

Restoring/Restarting a java daemon from crash

Hello, I am running a java app as daemon on a linux machine using a customized shell script. Since I am new to java and linux, I want to know is it possible that the app itself resurrects itself(just like restart) and recovers from cases like app crashing, unhandled exceptions or out of memory etc. thanks in advance Ashish Sharma ...

Play a wave file in linux

What is the most portable way to play a wave file in Linux? I'd like this to succeed even if the user doesn't have particularly nice sound libraries installed (assume libc is installed and the user has sound configured, but nothing else). Preferably, the method I use to blocks until the sound finishes playing and also avoids the overhe...

How can I translate Linux keycodes from /dev/input/event* to ASCII in Perl?

I'm writing a Perl script that reads data from the infamous /dev/input/event* and I didn't find a way to translate the key codes generated by the kernel into ASCII. I'm talking about the linux key codes in this table here and I can't seem to find something that would help me translate them without hardcoding an array into the script. ...

Flush kernel's TCP buffer for `MSG_MORE`-flagged packets

send()'s man page reveals the MSG_MORE flag which is asserted to act like TCP_CORK. I have a wrapper function around send(): int SocketConnection_Write(SocketConnection *this, void *buf, int len) { errno = 0; int sent = send(this->fd, buf, len, MSG_NOSIGNAL); if (errno == EPIPE || errno == ENOTCONN) { throw(exc, &S...

How to find the filename of a script being run when it is executed from a symlink on linux

Hi, If I have a python script that is executed via a symlink, is there a way that I can find the path to the script rather than the symlink? I've tried using the methods suggested in this question, but they always return the path to the symlink, not the script. For example, when this is saved as my "/usr/home/philboltt/scripts/test.p...

Interpreting segfault messages

What is the correct interpretation of the following segfault messages? segfault at 10 ip 00007f9bebcca90d sp 00007fffb62705f0 error 4 in libQtWebKit.so.4.5.2[7f9beb83a000+f6f000] segfault at 10 ip 00007fa44d78890d sp 00007fff43f6b720 error 4 in libQtWebKit.so.4.5.2[7fa44d2f8000+f6f000] segfault at 11 ip 00007f2b0022acee sp 00007fff368ea...

Installing jdk without sudo?

Currently, I have a machine on which I am working in Eclipse, it says that the JRE System Library version is sun-jdk-1.5.0.11 but on my active development machine, it is java-6-sun-1.6.0.16. Is there any way I can make the first machine to use the same "java-6-sun-1.6.0.16" version without having sudo permissions on the machine? ...

Java: Use jar library's from package manager in Linux.

I'm trying to find the best way to use Java libraries that were installed by the package manager instead of just putting a copy into ${project.root}/lib My distro, Gentoo, has a package for Java libraries like jdbc-postgresql. It's installed to /usr/share/jdbc-postgresql/lib/jdbc-postgresql.jar I assume that this path may be different ...

Setting LD_LIBRARY_PATH in Apache PassEnv/SetEnv still cant find library

I am trying to test the Cybersource 3d party implementation. I was able to get the test files running fine from the command line, which requires that on Linux I export the path to the payment libraries to LD_LIBRARY_PATH. to try to test this on my server I have created the apache config below <VirtualHost 127.0.0.1:12345> AddHandler ...

Simulate Network Presence in dbus

Is there a way using Python to simulate the presence of an active network connection using dbus? If I call getstate() on the dbus, I'm able to get the current network state. I want to set the current state to 4 (Connection Present). This is because Network Manager is not able to connect using my modem and I use other tools to connect. Pi...

How should I protect against hard link attacks?

I want to append data to a file in /tmp. If the file doesn't exist I want to create it I don't care if someone else owns the file. The data is not secret. I do not want someone to be able to race-condition this into writing somewhere else, or to another file. What is the best way to do this? Here's my thought: fd = open("/tmp/some-b...

Getting environment from .profile while executing a command through ssh

Hi, I am new to the linux/unix world. I would like to trigger a make on a remote machine. For this purpose i created a little script on the remote machine which i want to execute via ssh. The script looks something like this: echo "loading .profile" . ~/.profile echo "profile loaded" echo "starting gmake" cd ~/helloWorld/ gmake all ...

Application Settings with Mono under Linux

Hello guys! To store application settings, I am using the Settings tab in the project properties. In the code, I write Settings.Default.FontSize = size; and then Settings.Default.Save(); When I close the application and run it again the new value of the setting should be there. And yes, it is working properly on Windows, with Mono 2.4 o...

Perl: Edit hyperlinks in nested tags that aren't on separate lines

I have an interesting problem. I wrote the following perl script to recursively loop through a directory and in all html files for img/script/a tags do the following: Convert the entire url to lowercase Replace spaces and %20 with underscores The script works great except when an image tag in wrapped with an anchor tag. Is there a wa...

Finding missing symbols in libstdc++ on Debian/squeeze

I'm trying to use a pre-compiled library provided as a .so file. This file is dynamically linked against a few librairies : $ ldd /usr/local/test/lib/libtest.so linux-gate.so.1 => (0xb770d000) libstdc++-libc6.1-1.so.2 => not found libm.so.6 => /lib/i686/cmov/libm.so.6 (0xb75e1000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7499000) /l...

Can shared memory be read and validated without mutexes?

On Linux I'm using shmget and shmat to setup a shared memory segment that one process will write to and one or more processes will read from. The data that is being shared is a few megabytes in size and when updated is completely rewritten; it's never partially updated. I have my shared memory segment laid out as follows: -------...

Shell script to name videos on device

I have a .sh script that automounts any usb device that is plugged in. I need it to also find if there are videos in a certain location on the device that is plugged in then write them to a videos.txt file. Here's what I have and its not working. Also I need it to put the mountpoint in the videos.txt file. ${MOUNTPOINT}$count is the path...

Differences between template class implemenations in C++ on Linux and MSVC Win32

I'm trying to port some old Linux code to run on Windows and am running into a whole bunch of compiler errors that seem to be stemming from the considerable use of template classes. Are there really any significant differences between how templates must be implemented for linux vs MSVC? If so, could someone give an overview of what's a...

Development packages for X11 for CentOS

Hello, Some one know what are development packages for X11 for CentOS 3? Thank you for ahead ...