linux

PHPMailer and SMTP: Mail never shows up when sent from remote server, works fine on local machine.

I have a script that uses PHPMailer to send out an email. The email is sent with a direct SMTP connection to a remote mail server. The problem is that while everything seems to be okay when I run the script on my local machine, when the script is run on our live site using the same remote SMTP server the email never gets through. What...

How can you identify the chipset of a usb device in Linux?

I'd like to be able to identify the chipset a particular USB device is using. I know about lsusb (and now /proc/bus/usb/devices), but they don't provide as much information as lspci. Here is an example of how I use lsusb: (laptop:/proc/bus/usb) # lsusb -v -d 050d:805c Bus 001 Device 008: ID 050d:805c Belkin Components Device Descrip...

Stripping single and double quotes in a string using bash / standard Linux commands only

Hello Stack Overflow :-) I'm looking for something that will translate a string as follows, using only bash / standard Linux commands: Single-quotes surrounding a string should be removed Double-quotes surrounding a string should be removed Unquoted strings should remain the same Strings with unmatched surrounding quotes should remain...

Setting environment variables remotely?

How can I set Linux environment variables remotely from a Windows application? ...

MFC like easy to use tool for Linux

When I used to write test tools in Windows, I use MFC for creating the front-end GUI. This made development of GUI development very fast, and I always used to concentrate on the back-end. Recently I moved to the console based Linux-world. Where most of the things are just console based. My question: Is there any easy to use equivalent o...

Ruby on Rails: How can I specify runner script environment

I am using a shell script to run some runner scripts in my Ruby on Rails app. I need to run it on the production database, but the following: #!/bin/bash /usr/bin/ruby RAILS_ENV=production ../script/runner ../lib/tasks.rb gives an error: /usr/bin/ruby: No such file or directory -- RAILS_ENV=production (LoadError) I have tried to f...

How to write relative unix path in xml

hi all, when i run a process in unix the path points to /abc/1/2/3 I am setting a property in an xml for a process which run in path. One property i have < property name="log.path" value="/abc/4/5"/ > Problem is that i cannot give absolute path("/abc/1/2/3") as above. i have to give something like "../../../4/5". < property name=...

Running more than one instance of Evince

Hi everyone! I have a wxPython application and I'm using Evince to display the reports it generates. Since I'd like to delete every report after the user has closed the corresponding Evince instance, my application uses a thread that does a subprocess.call() to invoke Evince, and then removes the report when the subprocess terminates. T...

python ctypes and sysctl

I have following code import sys from ctypes import * from ctypes.util import find_library libc = cdll.LoadLibrary(find_library("c")) CTL_KERN = 1 KERN_SHMMAX = 34 sysctl_names = { 'memory_shared_buffers' : (CTL_KERN, KERN_SHMMAX), } def posix_sysctl_long(name): _mem = c_uint64(0) _arr = c_int * 2 _name = _arr() ...

Is there a limit on number of tcp/ip connections between machines on linux?

I have a very simple program written in 5 min that opens a sever socket and loops through the request and prints to the screen the bytes sent to it. I then tried to benchmark how many connections I can hammer it with to try to find out how many concurrent users I can support with this program. On another machine (where the network bet...

getting a long list from grep -l -- is it possible?

I'm performing this grep: grep -l "Validation failed" *.dbg This returns a file listing. However, I'm most interested in the times modified of these files. What would the proper command be? Edit: the argument in the title was wrong. ...

Is Redhat Linux server free?

Hi, I will maintain a C program which I was told it should only work on Redhat Linux. I want to setup a development environment for it but I'm wondering if Redhat Linux server is free? If it's not free, is there any other free Linux distros can relpace Redhat for me? ...

Good use of threads?

I have a set of operations that are very expensive but are all pretty much self-contained. Some of them rely on some "global" states or data, but all very much read-only. The operations themselves, I'm fairly certain, can all be done in parallel, but all the operations need to complete before the program progresses past a certain point. ...

How to create a lot (I mean a lot) of sockets in Linux?

I have tried to create a simple program in different languages (C#, Java, C++, PHP) to connect to a server and all behaved in the same way. So I believe this problem is more of a OS level thing. Basically I want the program to connect to the server with a TCP socket and send 1 byte and then close the socket. This needs to done thousands...

Which subversion server type is best?

Subversion has multiple server types: svnserve daemon svnserve via xinetd svn over ssh http-based server direct access via file:/// URLs Which one of these is best for a small Linux system (one to two users)? ...

how we can ensure caching to reduce file-system write cycle for SQLite databases

Hello, I would like to know how we can implement cashing in sqlite database.My primary objective is write data to ram and after when cache is filled i want to flush all the data to disk database.Whether it is possible? if yes Can i get any sample codes? Thanks Aneesh ...

Is there something like AppVerifier or Driver Verifier for Linux?

I am hoping that someone can point me toward Linux software similar to the Microsoft tools Application Verifier and Driver Verifier. (They are stress testers for Windows applications and drivers, respectively.) Do such things exist for Linux? ...

How to interact through vim?

I am writing an editor which has lot of parameters that could be easily interacted with through text. I find it inconvenient to implement a separate text-editor or lots of UI code for every little parameter. Usual buttons, boxes and gadgets would be burdensome and clumsy. I'd much rather let user interact with those parameters through vi...

System-wide continuous linux library profiling

Let's say I want to profile usage of a single library which is used in many apps in the system. I'm ok with only statistical profile, not an accurate one (but that one would be nice too). What I do not want to do is to recompile every running program with profiling support. I'd like the profiling information to be dumped either periodic...

Determing exit point of application. C++/Linux

I'm working on a big app (ns2) and somewhere someone put an exit(1) in there without any debug or print statements and it is being executed. I don't want to have to manually check every file that calls exit to figure out why the program is exiting. Is is possible to determine where the program exited? This is running on Linux and coded i...