linux

Getting MAC Address

I need a cross platform method of determining the MAC address of a computer at run time. For windows the 'wmi' module can be used and the only method under Linux I could find was to run ifconfig and run a regex across its output. I don't like using a package that only works on one OS, and parsing the output of another program doesn't s...

Pitch identification in Linux

Is there any free software tool or combination that allows me to identify the pitch of a recorded singing session? The idea is to display some kind of graph with the current pitch in a time line along with markers for the standard notes (C3, C#3, D, etc). I don't need pitch correction and I don't need it to be done in real time, either....

How can I create a temporary file for writing in C++ on a Linux platform?

In C++, on Linux, how can I write a function to return a temporary filename that I can then open for writing? The filename should be as unique as possible, so that another process using the same function won't get the same name. ...

should I free pointer returned by getpwuid() in Linux?

Hi, After I call getpwuid(uid), I have a reference to a pointer. Should I free that when I don't use it anymore? Reading the man pages, it says that it makes reference to some static area, that may be overwritten by subsequent calls to the same functions, so I'm sure sure if I should touch that memory area. Thanks. ...

How does a Perl socket resolve hostnames under Linux?

I have a (from what I can tell) perfectly working Linux setup (Ubuntu 8.04) where all tools (nslookup, curl, wget, firefox, etc) are able to resolve addresses. Yet, the following code fails: $s = new IO::Socket::INET( PeerAddr => 'stackoverflow.com', PeerPort => 80, Proto => 'tcp', ); die "Error: $!\n" unless $s; I verifi...

How can I kill a process by name instead of PID?

For example, sometimes when I try to start Firefox it says a Firefox process is already running. So I have to do this: jeremy@jeremy-desktop:~$ ps aux | grep firefox jeremy 7451 25.0 27.4 170536 65680 ? Sl 22:39 1:18 /usr/lib/firefox-3.0.1/firefox jeremy 7578 0.0 0.3 3004 768 pts/0 S+ 22:44 0:00 grep firefo...

Where is GDB documentation specific to the Cell Linux environment?

Where can documentation be found for the features of GDB, and the debugging process, specific to debugging of Cell Linux programs mixing PPU and SPU code? ...

Best Linux Distro for Web Development?

I want to start learning HTML and AJAX using a Linux distribution. Can anyone recommend a distribution that has these requirements: Local Host Admin interface (like PHPmyAdmin) IDE for Javascript... etc ...

Is it possible to unlisten on a socket ?

Is it possible to unlisten on a socket after you have called listen(fd, backlog)? Edit: My mistake for not making myself clear. I'd like to be able to temporarily unlisten on the socket. Calling close() will leave the socket in the M2LS state and prevent me from reopening it (or worse, some nefarious program could bind to that socket) ...

How to evict file from system cache on Linux?

When running performance tests file system cache hit or miss can significantly influence test results. Therefore generally before running such tests used files are evicted from system cache. How to do that on Linux? Clarification: If possible, the solution should not require root privileges. ...

Why is it that UTF-8 encoding is used when interacting with a UNIX/Linux environment?

I know it is customary, but why? Are there real technical reasons why any other way would be a really bad idea or is it just based on the history of encoding and backwards compatibility? In addition, what are the dangers of not using UTF-8, but some other encoding (most notably, UTF-16)? Edit : By interacting, I mostly mean the shell a...

Programmatically launching standalone Adobe flashplayer on Linux/X11

The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full screen without any hum...

How can I setup the permissions in Linux so that two users can update the same SVN working copy on the server?

My server has both Subversion and Apache installed, and the Apache web directory is also a Subversion working copy. The reason for this is that the simple command "svn update /server/staging" will deploy the latest source to the staging server. Apache public web directory: /server/staging — (This is an SVN working copy.) I have two use...

linux: getting umask of an already running process?

How can I check the umask of a program which is currently running? [update: another process, not the current process.] ...

Apache configuration help -- Why are different processes "in" different time zones?

I have Apache 2 running on a VPS server (running Debian). I recently changed the timezone on the server (using dpkg-reconfigure tzdata) from America/New_York to America/Los_Angeles to match my move across country. I have also rebooted the virtual machine since making the change. However, the Apache processes seem to flitter between ti...

What deployment directories do you use for Rails applications (deploying to a debian box)?

I wonder what's the best deployment directory for Rails apps? Some developers use directories such as /u/apps/#{appname}. Are there any advantages when using /u/apps/#{appname} instead of /var/www/#{appname} or other OS default directories? Obviously I want to pick the directory with the best security properties and the least friction f...

Best Linux distribution for running Mono

I'm a .Net developer and would like to investigate building and running our framework on Mono. If the initial project is successful I will happily invest in an OS learning curve, but right now I want to focus on getting things up and running and seeing the code working. What would be the best distribution to start with, assuming that...

How to know if there is a (compiled in/kernel module) device driver controlling a device on a running linux?

How can I know if a device is supported on a running linux and if so, which device driver controls it? For instance, lspci on a server(PowerEdge 2900) gives: 00:00.0 Host bridge: Intel Corporation 5000X Chipset Memory Controller Hub (rev 12) 00:02.0 PCI bridge: Intel Corporation 5000 Series Chipset PCI Express x4 Port 2 (rev 12) 00:03.0...

Linux - Using ldconfig

Let's say I 've added a library foo.so.1.1.1 to a path that is included in /etc/ld.so.conf When I run ldconfig on the system I get the links foo.so.1.1 and foo.so.1 to foo.so.1.1.1 How can I change the behavior to also get the foo.so link to foo.so.1.1.1? ...

Is there a function to invoke a stack dump in C?

Can someone please provide an implementation of a C function that gets invoked to dump the current stack? It's for a x86 linux system. It can be invoked in 2 ways: explicitly by another function, or after a crash (probably as a trap/int handler). The output can be either to the screen or to a file, as indicated by a parameter (handle)....