linux

How can I start a python subprocess command on linux shell from within Django web app?

Hi, I have a web app which reads and displays log files generated by python test files. Currently I can launch the python files from cli and it works fine. However I would like to be able to launch python tests from within the application. At the minute I have a "Launch test" button which calls a function in the views.py file def lau...

starting FedoOne server problem

Hello I have followed the installation instructions as shown here to install the FedOne server,I am using openfire as the xmpp server and I have managed to run the server and the client as supposed. After a while I thought of deploying an agent and wanted to start the FedOne server again but the run-server.sh fails complaining `2010-...

ioctl and execution time

Hi, I have a program running two threads - they communicate using message queues. In one thread, I call ioctl() to access the hardware decryptor. The code goes like: void Decrypt { ... .. ... if(<condition 1>) {. ... ... retVal = ioctl(...); comesInHere1++; } if(<condition 2>) { ... ... retVal = ioctl(...); comesInHere2++; } come...

How would one store German text in an embedded system?

I've created a memory mapped 1 bit interface to an LCD in an embedded system, along with 4 or 5 bit mapped fonts for the 90+ printable ASCII characters. Writing to the screen is as simple as using an echo like statement (it's embedded Linux). Other than something strictly proprietory, what recommendations can people make for storing Ge...

How to detect two identical i2c slaves but with different chip select with one linux i2c driver

Hi, I have to communicate with 2 identical i2c slaves that have a different chip select each. I would like to use one driver for both. What is the best way to do that? ...

Threads: some questions

Hi, I have couple of questions on threads. Could you please clarify. Suppose process with one or multiple threads. If the process is prempted/suspended, does the threads also get preempted or does the threads continue to run? When the suspended process rescheduled, does the process threads also gets scheduled? If the process has proc...

Latex Dollar Sign \\ How do I signify Linux Environment Variables in latex?

Hi. I am aware to output dollar signs you escape it with \ such that: \$ % prints '$' However, I can't print something like \$ JAVA_HOME % prints '$ JAVA_HOME' The space in between the $ and JAVA_HOME is what's annoying. How can I make it so it's one word? ...

qmake: How to avoid having version numbers in .so file name

Hello, I'm trying to build a dynamic library on Linux using qmake. Here is my .pro file: TEMPLATE = lib TARGET = sqxUiBase QT += core gui CONFIG += dll INCLUDEPATH += ../../public/include DEPENDPATH += . UI_DIR += ../GeneratedFiles RCC_DIR += ../GeneratedFiles CONFIG(release, debug|release) { DESTDIR = ../lib/relea...

bash: complex test in find command

I would like to do something like: find . -type f -exec test $(file --brief --mime-type '{}' ) == 'text/html' \; -print but I can't figure out the correct way to quote or escape the args to test, especially the '$(' ... ')' . ...

Is there a way to get an installed RPM's signature Key ID programatically?

As displayed by rpm -qi package? I don't really want to parse the output of rpm -qi. I'd much rather use rpm -q --qf, of which I can control the format and is not subjected to a future version's aesthetic whims. But the only useful tag I can find in the man page is SIGPGP, which gets me the entire signature, not only the short key id. ...

Compile C++ file under linux

I am tring to compile and my C++ program on Linux using gcc command. I used gcc -lm MyOwn.c Main.c -o Out Myown.c is another file I should link to the main. The Out file is successfully created. The problem is Out does not run. When I tried to use gcc or cc to create exe file it gives me a lot of errors Can someone help me? ...

Getting back into C++ (tools, debuggers, environments, compilers)?

I'm going to be using a subset of C++ (working within some of the ideas in Elements of Programming), but I haven't used C++ in years. I'm going to be writing a highly parallel algorithm on a 100+ nodes system with shared memory. The nodes are Mac OS X, but I have access to *nix and windows machines, too. Do people have suggestions for e...

How do I tell cmake I want my project to link libraries statically?

I'm trying to build an OpenCV-based project using CMake, running on Linux. So far my CMakeLists.txt files looks something like FIND_PACKAGE (OpenCV REQUIRED) ... TARGET_LINK_LIBRARIES (my-executable ${OpenCV_LIBS}) but this results in dynamically linked libraries. How do I link with static libraries? Update: The default build for Ope...

Reusing a port number in a UDP

In ASIO, s it possible to create another socket that has the same source port as another socket? My UDP server application is calling receive_from using port 3000. It passes the packet off to a worker thread which will send the response (currently using a dynamic source port). The socket in the other thread is created like this: udp:...

Trying to use my subnet address in python code

Hello, I'm trying to get my ip subnet address (192.168.1.xxx) into my python code. I'm running linux/osx. How do I do this/ What is the best way to do this? Thanks in advanced for your help. ...

Controlling the cursor while displaying the output of a C program in Linux.

I am writing a C program which is to be executed on the Linux terminal. The program goes into an infinite loop and prints five lines over and over again. How do I get the cursor back to the previous lines? E.g. I want to print the alphabets and replace them every 15 seconds. So, at T=0, output is sh>./a.out AA BB CC DD EE At T=15, ou...

linux environmental variable diff

I have two Linux xterms with "almost" the same setup. One setup works and the other doesn't for my application. Is there a tool that can help me figure out which particular environment variable is causing the failure? (A visual diff) Currently - I do env > a1 env > a2 in the 2 xterms and do a diff on them. But would like to know if...

Why is my Linux prio based tc not improving network latency?

Hi - I am building a real-time embedded linux application that has a variety of network traffic. Of the set of traffic, two connections are time critical. One is the input data and the other for output data. My application needs this traffic to have priority over the other, non-time-critical traffic. I care about two things: Min...

Getting the current time in milliseconds

How do I get the current time on Linux in milliseconds? This is for the purpose of testing. label1 ..... label2. ...

Recompiling / Running Dynamic Shared Objects (DSO) on Windows

Hi, I don't have much in the way of Unix/Linux experience but are wondering if it is possible in any way to run DSOs on Windows? Can these be recompiled so they will execute? Thanks in advance for any pointers you can give me. Dave. ...