I am trying to integrate a non-Java executable into a Java webapp on the server-side (Linux).
Some details about the executable:
Written in C++. The executable takes some input either from stdin or file and generates an output file. The executable is not designed to be a long running process i.e it generates an output and then dies out...
I am trying to port/re-write GUI made using Nucleus Grafix to QT on Linux.In Nucleus code there is a control class which is the base class for the rest of the controls like Button,Editbox, radiobutton etc.This base class uses Nucleus API's and control structs to maximum.My question is whether to port/re-write the base class or make the c...
Hello
I'm writing a bash script which fills cf cards with an image. Since only specified cards are allowed, I'd like to check if the right type of cf card is plugged in the USB cf card writer.
I know that it is possible to read out vendor id and firmware version of the cf card somehow (I saw it on an embedded system), but I don't know ...
How could I find directories with the name of specific length?
For example, I have bunch of directories which have length of the name equal to 33 chars ('a92e8cc611fdebcca3cf2fc8dc02c918', 'c442fb3f46d6c8bd17d27245290a9512' and so on).
Does find utility accepts condition in form of the 'wc -c'? Or maybe some other utilities should be pi...
Hi,
I'm trying to write a web frontend for Crontab in Ruby using the excellent CronEdit gem. I went through Dillon Cron's crontab source code and found that it updates a particular file so that the daemon will refresh the cron list during the next sweep.
In man crontab for VixieCron, it says:
Additionally, cron checks each minute to ...
The solution in
http://stackoverflow.com/questions/1272357/how-to-compile-a-32-bit-binary-on-a-64-bit-linux-machine-with-gcc-cmake
is not possible because i use 3rd party software and other stuff which is using the CFLAGS variable already. And patching their makefiles is not allowed - says my boss.
So i have to find another way to enf...
Some commands like svn log, for example will only take one input from the command line, so I can't say grep 'pattern' | svn log. It will only return the information for the first file, so I need to execute svn log against each one independently.
I can do this with find using it's exec option: find -name '*.jsp' -exec svn log {} \;. Ho...
What's the easiest way to access an ext3 file system at the block level? I don't care for the files, or raw bytes, I just have to read the FS one block at a time. Is there a simple way to do this (in C)? Or maybe a simple app whose source I could look into for inspiration? I found no usable tutorials on the net, and I'm a bit scared to d...
I'm running on RHEL 5.1 64 bit platfrom using gcc 4.1.2.
I have a utility function:
void str_concat(char *buff, int buffSize, ...);
which concats char * passed in variadic list(...), while last argument should be NULL, to designate end of the arguments. On 64 bit system NULL is 8 bytes.
Now to the problem. My application includes di...
Hi,
My user-space application sometimes blocks after receiving an EINTR-Signal, somehow.
What I recorded with strace:
time(NULL) = 1257343042
time(NULL) = 1257343042
rt_sigreturn(0xbff07be4) = -1 EINTR (Interrupted system call)
--- SIGALRM (Alarm clock) @ 0 (0...
Does linux support a replacement of its username/password collection UI in x-windows. To specify, I have a windows authentication method that uses gina/credential providers to display an alternative to the usual username and password. I wish to port this to linux.
I realise that text-mode runlevels will not support this, and only x-wi...
I'd like to obtain memory usage information for both per process and system wide. In Windows, it's pretty easy. GetProcessMemoryInfo and GlobalMemoryStatusEx do these jobs greatly and very easily. For example, GetProcessMemoryInfo gives "PeakWorkingSetSize" of the given process. GlobalMemoryStatusEx returns system wide available memory.
...
I'm running a java program on many computers that interact between them. After several hours (2-5 hours) computers start failing (threads start getting into deadlocks, messages start getting lost - peculiar stuff if you take into account that in the first hour or so things were running great).
I have a suspicion that it's because I'm us...
I have a file "FileList.txt" with this text:
/home/myusername/file1.txt
~/file2.txt
${HOME}/file3.txt
All 3 files exist in my home directory. I want to process each file in the list from a bash script. Here is a simplified example:
LIST=`cat FileList.txt`
for file in $LIST
do
echo $file
ls $file
done
When I run the script, I ...
I am writing small debugging program for multithread apps. My idea is to run the target, that is being debuged for for example 100 nanosecs, then pause and examine its memory. However this ( just pseudocode )
nanosleep(100); //sleep debuger for 100 nanosec and let a program run
kill(target_app_pid, SIGSTOP); //stop target ap...
How to add libraries in Eclipse project in C in Linux?
...
In VMs OS-provided real-time scheduling tends not to be reliable. For my application I'd like to be able to detect whether I am running on a VM or not (Linux-only).
So I am looking for a nice way to detect (in C) whether I am in a virtualized environment. Depending on the VM used there seem to be various DMI and CPUID strings in use. I...
.section .data
msgI:
.ascii "x = y\n"
msgI_end:
msgM:
.ascii "x > y\n"
msgM_end:
msgL:
.ascii "x < y\n"
msgL_end:
.section .text
.globl main
main:
movl $5, %eax #x = 5
movl $5, %ebx #y = 10
cmp %ebx, %eax
je IGUAL
jg MAYOR
jl MENOR
IGUAL: #Esta seccion de cogido se ...
So, I'm coding some packet structures (Ethernet, IP, etc) and noticed that some of them are followed by attribute((packed)) which prevents the gcc compiler from attempting to add padding to them. This makes sense, because these structures are supposed to go onto the wire.
But then, I counted the words:
struct ether_header
{
u_int8_t...
I'm writing a tool that allows someone to connect to a web page and generate files for download on the fly.
To write these files, I can use PHP functions like fopen or fwrite, or I could create a script that can be called as a system call to generate the output such as:
php downloadGen.php > filetocreate.xml
The fwrite version of the ...