linux

Currently selected database in MSSQL

I am currently tasked with porting our website code onto a linux server (from Win2003). The websites run on a MS SQL database. The original dev created a wrapper to contain all interaction with the database including selecting the correct database (the application spans multiple databases) The problem code is as follows... if (strcmp($t...

How can I send html mail using a shell script?

As the question title says, how can I send html mail using a shell script? ...

writing a C/C++ daemon (Linux)

I want to write a generic (C/C++) library that I will use to develop daemons in the Linux environment. Rather than reinventing the wheel, I thought I'd come in here to find out if there are any well known libraries in use. The library could be either C or C++ - although I would prefer C++ (maybe something that was part of, or based on t...

font is not the same in Linux FF and in Windows FF

Hi, Please check this screenshot! This is the same page in Linux FF (on the left) and Windows FF (on the right, also it's displayed in the same way in IEs). I love how it looks in Linux FF and want to have the same look in Windows. However after playing with all CSS properties I know of, I didn't manage to change its look in Windows....

packing binary string in NodeJS under 32 bit produces incorrect results

I am using the following "pack" function provided by the excellent php.js project. http://github.com/kvz/phpjs/blob/master/functions/misc/pack.js Running this in Mozilla's JavaScript shell it works fine, but running it in Node produces incorrect strings. example, packing the number 2 as a Double with: pack('d',2); JS Shell produces: ...

generate image (e.g. jpg) of a web page?

I want to create an image what a web page looks like, e.g. create a small thumbnail of the html + images. it does not have to be perfect (e.g. flash /javascript rendering). I will call use the code on linux, ideally would be some java library, but a command line tool would be cool as well. any ideas? ...

How else might a PHP CLI script determine its memory limit?

I need to run a PHP CLI script and give it a LOT of memory (it's an automatic documentation generator that needs to cover a large code base). I have a powerful machine and have allocated 5GB to php, both in php.ini and in an inline ini_set('memory_limit','5120M') declaration in the script file. If I add these lines to top of the script...

Problems building GCC for Embedded PowerPC

I have an Embedded linux PowerPC project based on a powerpc-e300c3 core for which I have a board support package that included a GCC set up for a --host=i686-pc-linux-gnu and --target=powerpc-e300c3-linux-gnu. This happily creates executables from a host machine for execution on the embedded machine. For development I have the PowerPC's...

j9 vm crash on windows, not on linux

Hi all, An eclipse plugin for IBM RSM launches a java process to make some computations (realized in C/C++ via JNI). The problem here is when the process is started, it crashes...but only on windows. Moreover, if the process is started using Oracle/Sun jvm, it works fine. Under linux, java -version gives java version "1.6.0" Java(TM) S...

How to check programmatically the OS of remote host?

I need to check if remote host is Windows or Unix/Linux. I can't assume that it has web server configured. All I can do is to try to connect to several TCP or UDP services. Which TCP services (TCP port numbers) usually will be opened on Windows and not on Unix/Linux and vise versa? The other way is to try to ssh to it, and if it fails...

Why Does GCC Throw Errors About Unspecified Options?

When I run the following command from a makefile on 64-bit Red Hat Enterprise Linux 5.0 using GCC 4.2.3: gcc -c -ansi -pedantic -O0 -fPIC -I. -I.. -Iheader_files/include "source_file.c" I get the following error: cc1: error: unrecognized command line option "-lang-c" Superficially, the problem is that "-lang-c" is no longer a valid...

How can i match each /proc/net/tcp entry to each opened socket?

I salute you, StackOverflow gurus ;) I'm trying to parse socket info from /proc/net/tcp and while I can identify some fields, such as memory addresses or send queue use, I can't find how each entry is bound to its socket descriptor. E.g., with this data: 1: 5922140A:E459 D5C43B45:0050 01 00000000:00000000 00:00000000 00000000 1000 ...

the child process exited normally even if I sent a SIGABRT to it

I was trying some process operations like fork()ing and exec()ing I tried this Example which in it the parent wait()s his child to return and test if his child ended normally (by exit()ing or return to his caller) or abnormally (receiving Signal like SIGABRT) #include<stdio.h> #include<stdlib.h> #include<sys/types.h> #include<unistd.h> ...

How to implement two periodical processes in C++ under Linux?

Hello, I am doing real time programming in C++, under Linux. I have two process, let me say A and B. A process is being started periodically, every 5ms. B process is being started every 10ms. The process A is doing some change of data. The process B is reading that data and displays it. I am confused about how to run periodically pro...

What's the difference between hard and soft floating point numbers?

When I compile C code with my cross toolchain, the linker prints pages of warnings saying that my executable uses hard floats but my libc uses soft floats. What's the difference? ...

My memcache is timing out. Does anyone know why?

I am using memcached and python-memcache. On my cache server, iptables is set perfectly, and it's allowed: ACCEPT all -- dev anywhere The process is this: /usr/local/bin/memcached -d -u root -m 3900 -p 11211 I do this in Django but it's not working. It times out at cache.set. cache.set("test","laa",333) prin...

Is this method of file locking acceptable?

We have 10 Linux boxes that must run 100 different tasks each week. These computers work at these tasks mostly at night when we are at home. One of my coworkers is working on a project to optimize run time by automating the starting of the tasks with Python. His program is going to read a list of tasks, grab an open task, mark that ta...

Find/Replace htmlentities using the standard linux toolchain?

Is there a way I can do something like the following using the standard linux toolchain? Let's say the source at example.com/index.php is: Hello, &amp; world! &quot; How can I do something like this... curl -s http://example.com/index.php | htmlentities ...that would print the following: Hello, & world! " Using only the standar...

How to sort files numerically from linux command line

Okay, now this is more a rant about Linux than a question, but maybe someone knows how to do what I want. I know this can be achieved using the sort command, but I want a better solution because getting that to work is about as easy as writing a C program to do the same thing. I have files, for arguments sake, lets say I have these file...

sed command line

Hi I need to run 'sed' command on file1.txt and have it extract all names that are in between StringA and StringB... ex: "Nickname":"bad_name", extract bad_name and then save all results too Output.txt. is this even possible or should I be looking at another command? ...