linux

How to create a user in linux using python

How do I create a user in Linux using Python? I mean, I know about the subprocess module and thought about calling 'adduser' and passing all the parameters at once, but the 'adduser' command asks some questions like password, full name, phone and stuff. How would I answer this questions using subprocess? I've seen module called pexpe...

How to display my current time in Linux (server shows date in GMT but my time should be GMT+8)?

Hi all, when I use the 'date' command, our server gives the GMT time. But my current time should be GMT+8. How do I display my current time as GMT+8? Thanks in advance. ...

Shared Library file format not recognised

Hi, I am using a shared library. Which I am using it to cross compile my executable. During the linking stage linker throws the error file format not recognised. When I run ld on it libcclass.so: file not recognized: File format not recognized When I run file libcclass.so: it gives libcclass.so: ELF 64-bit LSB shared object, x86-64, v...

creating a reference for script

I want to make the following kind of reference: "ls" command, for example, is universally available in most *nix environments. User can type in from anywhere to execute the scripts. So, I write script "x". I want to make sure that from wherever the user type in x, the actual script "x" is referenced. Thus, if I have script "x" stored...

what are shell built-in commands in linux?

Hi, I have just started using Linux and I am curious how are shell built-in commands such as "cd" defined. Also, if someone could please explain how it is implemented and executed? Thanks, Manjari ...

cp command failing in Linux

Hi, I am facing a copy command problem while executing shell script in RHEL 5. executed command is cp -fp /fir1/dir2/*/bin/file1 `find . -name file1 -print` error is cp: Target ./6e0476aec9667638c87da1b17b6ccf46/file1 must be a directory Would you please throw some ideas why it would be failing? Thanks Robert. ...

Specifying non-standard baud rate for FTDI virtual serial port under Linux

I have a USB device I'm trying to communicate with over a virtual serial port provided by the ftdi_sio kernel module. However, I'm having some trouble setting the baud rate of the port to 14400: termios.h doesn't specify a constant for 14400, so I can't use cfsetispeed and cfsetospeed. In the source for the ftdi_sio kernel module, baud...

C++ RHEL53 Memory Fault Invalid read of size

I'm porting some old C++ project on Linux (RHEL 5.3) and, therefore need to obtain all the binaries on RHEL 5.3. The result should be in the end several libraries + the executable. I have some dependencies from several 3rd parties. My project libraries have dependencies as some of the 3rd party libraries. My library MyLib depends My3rd...

sync 2 MediaWiki weekly?

hello, we have to mediawiki (like wikipedia) installation one is public and one is internal we do the normal work with the internal adding/changing/deleting text articales and pictures we want to sunc and update the external one on weekly bases, what is the best approach? note: we are using 2 windows servers (but willing to change to...

What permissions does a file written with fstream have?

Suppose I create a file for writing like this: std::ofstream my_file("filename", std::ios_base::out | std::ios_base::trunc); How are the permissions of this file determined? I've had a program running overnight generating files about once a minute - some are 0644 but others are 0660, and there's nothing in my code that should make it ...

C/C++ Dynamic loading of functions with unknown prototype

Hi, I'm in the process of writing a kind of runtime system/interpreter, and one of things that I need to be able to do is call c/c++ functions located in external libraries. On linux I'm using the dlfcn.h functions to open a library, and call a function located within. The problem is that, when using dlsysm() the function pointer retur...

How to create a pop window using pygtk?

HI I have created a simple software. Now Iam trying to give a GUI to it . Since I have coded in python Iam using pygtk . I have made main window and now I want to add a pop up window ,which will become active as I press open button(already created) in main window . I have no previous experience with pygtk .............. ...

How join 2 variable in shell script ?

INPUT=10 OUTPUT_IN=20 KEYWORD="IN" echo $OUTPUT_"$KEYWORD" It should display 20 Mainly I am looking to generate the variable name OUTPUT_IN How to resolve this? ...

Trouble Creating SSL Certificate

I'm trying to create a self-signed certificate for a test web server running Sun Webserver 6.1 using certutil. I am open to using keytool or openssl if someone has better instructions which work with Sun Webserver. Here are the commands that I use: certutil -S -P "https-myWebapp-" -d . -n myCA -s "CN=myWebserver.com CA,OU=myCompany,C=U...

3D Graph plotting for C++

Hi, I need to plot my simulation (which I do in a C++ application) for use in a Latex document (so I would prefer some vector output like EPS). My function is of 2 arguments, so I am after a 3D plot, ideally with colouring indicating the function value (similar to what Mathematica does). Could anyone recommend any library? ...

Lazy deletion of table rows

is there any software that does "lazy" deletion of the rows from the table. I would like to do maintenance of my tables when my server is idle, and ideally i should be able to define what "idle" is (num of database connections/system load/ requests per second). Is there anything remotely similar to this? ...

Where is BSD socket functions defined on Linux?

What is the library file name where BSD's socket(), recv(), send(), etc defined on Linux OS? (I'm using RedHat). Is the file located in /usr/lib? ...

Collecting information about thread scheduling on Linux

I want to collect information about when my threads are scheduled (and descheduled), and on which CPUs, on Linux. I'm happy to collect the information and store it in a file for offline analysis later, since I'll need to merge the scheduling information with other event sources generated by my code. Ideally the information would be col...

C threading in linux?

Does someone have a simple example of threading in c? I want to build a small console app that will read a txt file file line by line and then use threads to process the entire txt. How should I do this? splitting the txt into X where X=N of threads, is the first thing that comes to my mind, is there a better way? ...

Eclipse 3.6 (CDT for linux) and Valgrind - Arguments not working in Profile configuration

Has anyone else had this problem? I just downloaded 3.6 (the CDT for linux flavor), and this isn't working. In the Profile Configurations --> Valgrind --> "Arguments" tab, it doesn't seem to be passing the arguments into the executable. When I debug the same code, it works perfectly. I am not that familiar with Valgrind or the plugin...