linux

Bash string comparison syntax

I was looking through the /etc/bash_completion script found in some Debian packages. I was interested in using the code that looks through a specific directory (/etc/bash_completion.d/ by default) and sources every file in that directory. Unfortunately, trying to run the script causes errors under the Mac OS X version of bash. The line...

Linux command for removing all ~ files

What command can I use in linux to check if there is a file in a given directory (or its subdirectories) that contain a ~ at the end of the file's name? (Example if I am at a directory called t which contains many subdirectories, etc, I would like to remove any file that ends with a ~) ...

Standard Menu Item Location on Linux

Where should I put a .desktop file in order to ensure that most desktop environments find it? Is there such a location? In addition, is there any standard place to put it in the user's home directory so that only that user sees it? ...

How do i find out what all symbols are exported from a shared object?

I have a shared object(dll). How do i find out what all symbols are exported from that? ...

processes usage memory on linux

how to monitor the processe usage of memory on linux .. eactly want to know how much each process take from memory ...

Developing Windows applications on Linux?

My primary OS is Linux, but now I'm forced to write some C++ applications for Windows. I was thinking about developing on the Linux box with cross platform libraries like WxWidgets (and some care about other platform dependencies) and then cross compiling the result to mingw target. So the tools I'm thinking of using are g++ for compi...

libtool: What .la file is for?

Can somebody tell me what .la file is for? Also how it is used with shared object? ...

Memory usage when files are loaded via mmap()

Hi, Wanted to know what if there is a relationship between the maximum amount of memory that can be used to map a file through mmap() and the size of the RAM in a linux box. I tried to memory map some files , and I found that I am not able to map any more files when the "Mapped" usage comes close to the "MemTotal" ( viewed via cat /proc...

What environment should I use for 3d programming on Linux?

One thing I always shy away from is 3d graphics programming, so I've decided to take on a project working with 3d graphics for a learning experience. I would like to do this project in Linux. I want to write a simple 3d CAD type program. Something that will allow the user to manipulate objects in 3d space. What is the best environment ...

What is your favorite linux environment for Web Development especially in Java?

Which Linux distribution are you using? Which Linux tools are you using? (I know Eclipse is one of them.) ...

how can I create a file with file_put_contents that has group write permissions?

I am using file_put_contents to create a file. My php process is running in a group with permissions to write to the directory. When file_put_contents is called, however, the resulting file does not have group write permissions (it creates just fine the first time). This means that if I try to overwrite the file it fails because of a lac...

sprof "PLTREL not found error"

I'm trying to profile our shared library, but whenever I have the environmental variable LD_PROFILE set, I get "PLTREL not found in object ". What gives? Is there some sort of linker flag I'm missing or what? There seems to be no information about this on the internets. The man page for sprof is about 10 words long. ...

PdfSharp on Mono

Has anyone tried to port PdfSharp library to Mono? I just ran MoMA against PdfSharp.dll v1.2 beta and I am getting about 12 P/Invoke errors and 10 or so Mono TODOs. Just wondering if anyone has ported PdfSharp over to Linux and OSX, if so, how did it go? Trying to evaluate if PdfSharp is a good candidate for me. ...

Linux file craziness - strange behaviour getting last line of log file (with video)

I am trying to get the last line of a file. The file, ff.log, is getting new data every second while ffmpeg is working. The log file looks like this: frame= 20 fps= 0 q=7.7 size= 40kB time=1.24 bitrate= 266.1kbits/s frame= 30 fps= 28 q=6.6 size= 51kB time=1.90 bitrate= 218.4kbits/s frame= 40 fps= 24 q=6.6 size= ...

Linux diskless client nfs throughput

I have a gentoo diskless client that mounts using nfs and it seems like the throughput of nfs is slow. iperf show the network able to push 770 Mb/s and hdparm shows the sata disk on the server at 90 Mb/s, but doing a dd across the network only shows up as 10 Mb/s (is about 40 Mb/s when the same test is done on the server to a third mac...

total size of the contents of all the files in a directory

When I use ls or du I get the amount of disk space each file is occupying. I need the sum total of all the data in files and sub directories I would get if I opened each file and counted the bytes. Bonus points If i can get this with out opening each file and counting. ...

linux - running php script from command line when php is installed as apache module

Normally when I want to run a php script from the command line I just create a php page, add a shebang pointing to the php binary, then ./file.php to run it. Since I have php installed as an apache module, I'm not even sure what my shebang should look like. Any ideas? ...

Linux: Move 1 million files into prefix-based created Folders

I have a directory called "images" filled with about one million images. Yep. I want to write a shell command to rename all of those images into the following format: original: filename.jpg new: /f/i/l/filename.jpg Any suggestions? Thanks, Dan ...

two folders in sync - one is updated with the CVS

I have copied a folder say "folder" which is maintained in CVS as folder_backup. $cp -af folder folder_backup Frequently I cvs update "folder" and I want folder_backup to be in sync with folder. Is there a automatic way to sync both folder and folder_backup whenever folder is cvs updated. Both are in the same machine. ...

How can I figure out which tty file points to which USB-to-Serial device?

I have two legacy machines connected to a Linux box with USB using the ftdi_sio driver, to /dev/ttyUSB0 and /dev/ttyUSB1. The Linux box is relaying and analyzing the traffic between the machines. When the Linux box boots up, the machines are connected to the files pretty much randomly. The problem is to know which one is which. I could ...