linux

SELinux, Fedora, and Trusted Applet crashing?

For some reason, if I run Firefox 3.5.x under Fedora 11 with SELinux enabled, my browser crashes when I attempt to embed the applet dynamically. Under Windows, Ubuntu, and Mac, the user is prompted to trust the signer and then trust the executing java applet, but under Fedora, I never see this prompt. If I disable SELinux, I get NO promp...

siginterrupt() only works for the first signal? (Python)

For some reason, siginterrupt() only seems to set the behaviour for the first signal received. In this example program, the first SIGQUIT appears to do nothing, but the second sigquit prints "SIGQUIT Handler" and s.accept() throws an Interrupted system call exception. from signal import * from socket import * import sys def sigquitHan...

Do threads share the heap?

As far as I know each thread gets a distinct stack when the thread is created by the OS. I wonder if each thread has a heap distinct to itself also? ...

How to reduce compilation cost in GCC and make?

I am trying to build some big libraries, like Boost and OpenCV, from their source code via make and GCC under Ubuntu 8.10 on my laptop. Unfortunately the compilation of those big libraries seem to be big burden to my laptop (Acer Aspire 5000). Its fan makes higher and higher noises until out of a sudden my laptop shuts itself down withou...

Regular expression to match unique words in files

To prefix unique words with "UNIQUE:" inside a file I've tried to use a perl regex command like: perl -e 'undef $/;while($_=<>){s/^(((?!\b\3\b).)*)\b(\w+)\b(((?!\b\3\b).)*)$/\1UNIQUE:\3\4/gs;print $_;}' demo On a demo file containing: watermelon banana apple pear pineapple orange mango strawberry cherry kiwi pineapple lemon cranberry...

Can anyone tell me why Apache will not work, for my Django?

I get this problem when I visit my domain.com. I have compared this with my other website with the SAME set-up (just different username!!!) For some reason that website works and this one doesn't. Forbidden You don't have permission to access / on this server. Apache/2.2.3 (Red Hat) Server at www.mydomain.com Port 80 In terms of perm...

linux shell and java

Hi! I want to send a command to linux shell and get it's response with java.How can i do this? ...

Editing Windows registry, from Python, Under Linux

Hi All, I am looking for a Python API (or a C API as I am willing to bind) for editing Windows registries from XP to 7 from within a Linux system. The Windows target will be a mounted volume under Linux. I would be willing to code a library if none exists. Therefore, any docs or internals on the registry would be handy too. Any help,...

How to address an issue while sourcing an env file in bash ?

Some issue arise when sourcing one of your env file (a series of variable exporting) for instance: ... export MY_ROOT=/Soft/dev/blah/blah export MY_BIN=${MY_ROOT}/bin ... results in $. my_env.sh $echo $MY_BIN /bint/dev/blah/blah => "/bin" seems to overwrite the begining of the variable instead of suffixing it.. Any idea? By the...

debugging templates with GDB

Hi all. My gdb is GNU gdb Red Hat Linux (6.3.0.0-1.162.el4rh). And I can't debug templates. Can anybody help me? How can I debug templates with this debugger? Thanks. ...

Running a JAR file without directly calling `java`

I am deploying a command-line tool that is written in Java that accepts command-line arguments. I have it packaged as a JAR file because it is convenient to have a single file. The problem is that to run it you must first call java -jar (filename) (args) and that is quite annoying. The current way I have it is to have a simple bash sc...

Problem with mmap/munmap - getting a bus error after the 783rd iteration?!?

Okay, here's the setup: I work in HPC, and we're preparing for the need to scale up to tens of thousands of nodes. To deal with this, I've implemented a local process that caches information on each node to reduce the amount of network traffic. It then exposes this information via shared-memory. The basic logic is that there is one well-...

Is it possible to have a PHP script authenticate users with their Linux user info?

I'm currently trying to expand my PHP driven intranet site for my company. It essentially functions as a bunch of miscellaneous reports and utilities that I've thrown together and linked to on the internal webserver. Whenever people keep wanting the same task done, I script it if at all possible and throw it up on the intranet page so pe...

Can likely/unlikely macros be used in user-space code?

I came across these 2 macros in Linux kernel code. I know they are instructions to compiler (gcc) for optimizations in case of branching. My question is, can we use these macros in user space code? Will it give any optimization? Any example will be very helpful. ...

Confusion about System.Data.SQLite.dll

The site, http://sqlite.phxsoftware.com/, talks about a mixed-mode assembly and a managed-only version of the provider. Are they both named System.Data.SQLite.dll? I installed the managed-only version in windows and it is working. Which, as I understand it, means that I must also have the native sqlite3.dll file somewhere on my machin...

Why does MPI give run time Error.

After i typed sudo apt-get install mpich2 The mpich was installed but the first problem is that I dont know where the files were installed. On the other hand when I wrote mpirun -np 3 ./hello.o it gives me: mpiexec_hani-laptop: cannot connect to local mpd (/tmp/mpd2.console_hani); possible causes: 1. no mpd is running on this ho...

How can I control inputs on Shell Script?

Hi I am getting parameters from user ./inputControl.sh param1 param2 ... I want users can only enter numbers. can not enter any words, etc. if they enter word i will show them error. thanks for answers ...

Is there a way to drive a today's computer NIC with no underlying OS?

Hi, I would like to write an IO intensive application with no underlying OS, running on x86 architecture and driving any modern network interface controller. By having a look to Linux's drivers source code, I know that thousands lines of codes are required to drive, as an example, an Intel e1000e Gigabit controller. I think that such c...

android can not find a target

i am using eclipse with android plugin and sdk, but i can not create a virtual device due to there is no target, and when I execute this: $ ./android list targets Available Android targets: what should i do? and.............. when i try to install the available packages in eclipse avd manage it comes to: Downloading SDK Platf...

Security or other gotcahs in Apache-CGI-Bash application?

I've taken over supporting a time- and expense-entry system. Apache's CGI. CGI programs are written in bash :) I'm going to add some features into it and exposing it out to many more users, but prior to that wanted to get some thoughts on what else needs to be looked-at first in terms of security, holes, CGI gotchas, &c. Not a lot of...