linux

barchart (o plot) 3D in python

I need to plot some data in various forms. Currently I'm using matplotlib and I'm fairly happy with the plots I'm able to produce. This question is on how to plot the last one. The data is similar to the "distance table", like this (just bigger, my table is 128x128 and still have 3 or more number per element) Now, my data is much bette...

What tools are recommended for creating Flash animations on Linux?

I want to make a fairly simple Flash application that will play a slideshow of still images while audio plays in synch with the images. The application will need to change slides according to the timing of the audio. It also would be nice if I could give the user a control to pause and resume. The catch is that I do my development on ...

Can I put something in in bashrc to hide text editor (~ extension) files?

I'd like to do ls without seeing all the ~ files generated by vim. Is it possible? ...

Gnome-Terminal, how to start in a different directory?

Hi, Whenever I start my console gnome-terminal in Ubuntu, it starts in the home directory. How can I make it start in a different directory say ~/myfolder? I tried to write cd ~/myfolder in ~/.profile but nothing happens. ...

How to get the device type associated with a fd

Hi, i get a valid "fd" object from a caller. How can i find out what is the fd type - whether it is referring to a File, Socket, Device, etc? Depending on the refered type, i need to execute specific functions, say if the fd is associated with a File, then i need to do a read. If it is associated with a socket, then i need to get the soc...

wc gzipped files?

I have a directory with both uncompressed and gzipped files and want to run wc -l on this directory. wc will provide a line count value for the compressed files which is not accurate (since it seems to count newlines in the gzipped version of the file). Is there a way to create a zwc script similar to zgrep that will detected the gzipped...

Multiple glibc libraries on a single host

Multiple glibc libraries on a single host My linux (SLES-8) server currently has glibc-2.2.5-235, but I have a program which won't work on this version and requires glibc-2.3.3. Is it possible to have multiple glibcs installed on the same host? This is the error I get when I run my program on the old glibc: ./myapp: /lib/i686/libc.so...

Anyone knows the algorithm for this kind of rubbery effect?

Hey guys, I'm doing some animations and I want to implement something like this on the web. I was thinking that the HTML canvas can do this kind of job. Because I can scale part of an image. I just need the algorithm to actually make it work. The effect is elastic, if the window is small, the greater the elasticity of the window when y...

How can I get the interface name/index associated with a TCP socket?

Hi, I'm writing a TCP server that needs to know which interface each connection arrived from. I cannot use the address/subnet to deduce which interface was used, since there might be interfaces with the same address/subnet values. It's Linux based, and there's no need for the code to be portable. All I could find were functions to get ...

IP KVMs / remote access to linux x11 session with no window-manager

Hello, can somebody recommend me good affordable IP KVM? Like Adder. Or some articles evaluating such KVMs? My project: Provide remote support to Linux (Fedora) based software that runs on X, but without any window-manager. I know that there is Gnome vino, but it is buggy and it does not meet my needs for other reasons. I would ...

Time Stamp counter (TSC) when switching between Kernel & User mode

Hi I am wondering if somebody knows some more details about the time stamp counter in Linux when a context switch occurs? Until now I had the opinion, that the TSC value is just increasing by 1 during each clock cycle, independent if in kernel or in user mode. I measured now the performance of an application using the TSC which yielded ...

Handling more than 1024 file descriptors, in C on Linux

I am working on a threaded network server using epoll (edge triggered) and threads and I'm using httperf to benchmark my server. So far, it's performing really well or almost exactly at the rate the requests are being sent. Until the 1024 barrier, where everything slows down to around 30 requests/second. Running on Ubuntu 9.04 64-bit. ...

Is it possible to speed-up python IO?

Consider this python program: import sys lc = 0 for line in open(sys.argv[1]): lc = lc + 1 print lc, sys.argv[1] Running it on my 6GB text file, it completes in ~ 2minutes. Question: is it possible to go faster? Note that the same time is required by: wc -l myfile.txt so, I suspect the anwer to my quesion is just a plain "n...

Why can't I get Openfire to start?

I am having trouble getting Openfire to work. I done the following: [root@jiaoyou logs]# which java /usr/bin/java and I've run this command: ln -s /usr/bin/java /opt/openfire/jre/bin/java but when starting Openfire, it still says: cannot run command `/opt/openfire/jre/bin/java': No such file or directory It seems like a permi...

How can one send a Ctrl-Break to a running Linux process?

I am debugging a memory leak in an application running on Sun's JDK 1.4.2_18. It appears that this version supports the command line param -XX:+HeapDumpOnCtrlBreak which supposedly causes the JVM to dump heap when it encounters a control-break. How does one send this to a background process on a Linux box? It appears that kill signals...

Large 2D array gives segmentation fault

I am writing some C++ code in Linux where I have declared a few 2D arrays like so: double x[5000][500], y[5000][500], z[5000][500]; During compilation there is no error. When I execute it says "segmentation fault". Wen I reduce the size of the array from 5000 to 50, the program runs fine. How can I protect myself against this proble...

how to use Linux lib such as timeval in windows

how to use Linux lib such as timeval in windows I have installed cygwin and dev c++ I don't like compliling in cygwin compliling under dev c++ always erro like `gettimeofday' undeclared (first use this function) unfortunately, I don't have enough harddisk space to install a linux or any vitual machine thanks a lot ...

Linux Programming Book

I'm looking for a good book on Linux system programming and wondered whether anybody could recommend an up-to-date appropriate book that covers the subject well. Things like: I/O and fileystems Thread and processes etc... Can anybody suggest an appropriate book that they've read/used, not just something that they've seen on Amazon ...

Format a device with parted into a specific pattern using parted

Hi, This is really a parted usage question, but other ideas about how to accomplish this are welcome. I need to create a boot device set up as follows: ( up to 4MB erase block size (EBS)): partitions aligned on 4MB blocks by using 32 sectors/track and 128 heads and using odd start numbers (counting from 1) MBR: s...

Free Server Monitoring Service or Software

Looking for a free service, or software to monitor 2 websites, one is hosted on a linux machine, and the other a windows machine (though, shouldn't really matter). Any suggestions? ...