linux

Can I SSH to MySQL with the GUI tools?

I have a ubuntu server which I've locked down to only HTTP, HTTPS and SSH (port 30000). On this box I have a MySQL server which 99.9% of the time is only used locally. Every now and then I want to connect to the MySQL instance with the GUI tools, but without touching the firewall. Therefore, it is possible to set things up so that I c...

Learning OpenGL in Ubuntu

I'm trying to learn OpenGL and improve my C++ skills by going through the Nehe guides, but all of the examples are for Windows and I'm currently on Linux. I don't really have any idea how to get things to work under Linux, and the code on the site that has been ported for Linux has way more code in it that's not explained (so far, the o...

A Python equivilent to Java Robot

Hi, does anyone know of a Python class similar to Java Robot? Specifically I would like the perform a screen grab in Ubuntu, and eventually track mouse clicks and keyboard presses (although that's a slightly different question) Thanks, Stuart ...

How to detect ftp connection

Hi I'm using vsftpd and I want to write a shell script that will detect a connection to my server and send me an email with information who and when has logged in. I don't know where to start. Can someone point me in the right direction. Thanx ...

Number of bytes read from a pipe

When reading from a pipe in Linux (C, fread/similar), when EOF is reached, how can it be known how many bytes were read? If I read blocks at a time, fread() only returns the number of full blocks read in, and I can't read one byte at a time because that is too slow. Of course, ftell() returns -1. ...

Encrypted filesystems and the Linux buffer cache

I currently use Berkeley DBs fronted by a Java server for a high-performance disk-backed cache. Provided you warm it up before allowing it to face live traffic, your update rate is low, and your working set fits in memory, the Linux buffer cache does an excellent job. It's measurably faster than memcache, in part because you don't need t...

Tracking actively used memory in Linux programs

I'd like to track how much memory various programs touch while in specific states. For instance, say I have a graphical program. It might use substantially less memory when it's minimized, since it won't redraw the window, which requires reading images and fonts and executing a large number of library functions. These objects are still a...

Is python automagically parallelizing IO- and CPU- or memory-bound sections?

This is a follow-up questions on a previous one. Consider this code, which is less toyish than the one in the previous question (but still much simpler than my real one) import sys data=[] for line in open(sys.argv[1]): data.append(line[-1]) print data[-1] Now, I was expecting a longer run time (my benchmark file is 65150224 li...

email host marked as spam mule by site with a rooster

Recently I was configuring sendmail on a new linux server install and there was a configuration problem. I was given a link to a website that had the image of a rooster on it and told to consult them for configuration problems. I cant remember the url of the site, but it's apparently a well-known one. Can someone here remind me of wha...

File system testing tools

Hello, We are developing file system filters and we need to automate the testing on all platforms we are targeting (Windows, OS X, Linux). What tools would you recommend that will check if a particular mounted file system behaves properly. Here the word "properly" probably needs some clarification: Since we are developing filters (not ...

Delete all files/directories except two specific directories

So, there seems to be a few questions asking about removing files/directories matching certain cases, but I'm looking for the exact opposite: Delete EVERYTHING in a folder that DOESN'T match my provided examples. For example, here is an example directory tree: . |-- coke | |-- diet | |-- regular | `-- vanilla |-- icecream | |-...

.NET CLR that does not require an operating system?

In the world of Java, BEA (now Oracle) has created LiquidVM which doesn't require an OS. Likewise, there are a variety of open source projects including SANOS, JNODE OS, Project Guest VM, JavaOS, etc. Is there an equivalent being created for .NET? ...

Running Ruby without a traditional operating system?

In the world of Java, BEA (now Oracle) has created LiquidVM which doesn't require an OS. Likewise, there are a variety of open source projects including SANOS, JNODE OS, Project Guest VM, JavaOS, etc. Is there an equivalent being created for Ruby? ...

Who can give me the latest netlink programming samples?

Hi, I'm writing a Linux driver using netlink to communicate between user space and kernel space. But I can't find some useful materials, because the netlink has changed from Linux kernel >=2.6.24. Who can give me some suggestions about how to create a netlink socket. Thanks in advance! ...

Does the OS (POSIX) flush a memory-mapped file if the process is SIGKILLed?

If a process is killed with SIGKILL, will the changes it has made to a memory-mapped file be flushed to disk? I assume that if the OS ensures a memory-mapped file is flushed to disk when the process is killed via SIGKILL, then it will also do so with other terminating signals (SIGABRT, SIGSEGV, etc...). ...

On mysqlimport, line breaks, and character encoding (I think)

First, some disclosure: I am not a Linux admin, and my Linux admin is not a programmer. That said, we have a cronjob that runs a mysqlimport command to import a text file that's generated daily. I have no control or involvement in how this file is created. Through trial and error, we discovered that the text file is generated on a Wi...

Running Excel Macros Automatically under Linux.

Part of the software I work on uses an Excel sheet to store the user error messages & their translations. We run a macro which generates a set of internationalized text files & matching header files that are then copied into our version control system (the spreadsheet is also in Version Control) and used as part of our build. I'd like ...

Are some allocators lazy?

Hello, I wrote a C program in Linux that mallocs memory, ran it in a loop, and TOP didn't show any memory consumption. then I've done something with that memory, and TOP did show memory consumption. When I malloc, do I really "get memory", or is there a "lazy" memory management, that only gives me the memory if/when I use it? (There...

Find out how much time a process is blocked waiting for I/O on Linux

Is there a vmstat type command that works per-process that allows you to see how much time a process is blocked waiting for I/O, time in kernel and user code? ...

Monitoring certain system calls done by a process

I would like to be able to monitor certain system calls made by a process, primarily file I/O calls. On Linux I can probably get away using strace with suitable parameters, but how can I do this on Windows? I'm primarily interested in running a process and figuring out which files it has read and written. EDIT: I want to do this progra...