linux

Setting file permission for Files and Directories

I need to below permission policy to my files under www folder 664 to all files www recursively 755 to all directories under www recursively I tried find . -type f -exec chmod 644 {} ; find . -type d -exec chmod 755 {} ; But always getting error find: missing argument to `-exec' What is the solution? ...

Linux shell bug?

How come FILE_FOUND is 0 at the end of this bugger : FILE_FOUND=0 touch /tmp/$$.txt ls -1 /tmp/$$.* 2>/dev/null | while read item; do FILE_FOUND=1 echo "FILE_FOUND = $FILE_FOUND" done echo "FILE_FOUND = $FILE_FOUND" rm -f /tmp/$$.txt 2>/dev/null ??!! On Unix FILE_FOUND stays at 1 (as it should), but on Linux (RedHat, Cygw...

asynchronous memcpy in linux ?

Is there any asynchronous memcpy function in linux? I want it to work with DMA and notify me when it gets completed. ...

Unix wizardry to get the binary content of a file as text?

I'm looking for an easy way to convert a simple binary file into a text-representation of its binary, where encoding doesn't matter. I know that the programmatic solution is straightforward, but I feel that there must be some arcane string of unix commands to accomplish this. Am I off base? Is there a simpler solution than the programma...

Any open source, fast H263 decoder library for ARM9 than ffmpeg?

Is there Any open source, fast H263 decoder library for ARM9 than ffmpeg? ...

How to access physical memory in linux from userspace ?

Hi, I have a physical memory address, which driver provide me through ioctl. How can I access it in my application in linux. ...

How to check if a file is a DLL?

Given a file, I want to check if this is a DLL, or a shared object (Linux) or a dylib (Mac OS X), or something different. My main interest is differentiating executable and DLL on Linux and Mac OS X. For windows, the extension should be enough for my problem. I already checked that the magic number technique doesn't work for Linux as ex...

/proc/sys/fs/aio-nr is never higher than 1024 (AIO on linux)

I'm trying to use async io on linux. As far as i know there're 3 options: kernel calls (io_submit and friends) libRT - uses threads in user space libRTKAIO - wrapper of kernel calls which does not use threads I'm using the last option, and i see, that in my unit test that runs a lot of async io requests in multiple threads, /proc/sy...

linux clipboard read/write in C

I done lots of googling but I am still unsure on how to proceed. What's the most common way of reading/write to the clipboard under Linux? I want both support for Gnome & KDE desktops. Updated: do I take there isn't an easy solution and one must "aggregate" together multiple sources (gnome, kde) in order to craft a solution? ...

Cannot stop java service in Linux using start-stop-daemon

I have a process that is running as a java daemon on Ubuntu Linux. I cannot stop it using start-stop-daemon command in d_stop() below. The process id should be written to file $PIDFILE during the start process, but that is not working. Here is my script: #! /bin/sh # # # # Version: @(#)daemon 1.0 # set -e PATH=/usr/local/sbin...

possible to force, a script to use certain amount of CPU and memory ?

is it possible to force a ruby script to use up to certain amount of CPU and memory. i dont want the script to be killed when it exceeds this specified amount. i just want it to run within the given constraints. EDIT: yes its an endless recursive loop that seems to use lot of CPU. i noticed that doing return at the end of each recurs...

GREP: How to search for a value but at the same time exclude some matches

I need a way to simplify this command: grep 'SEARCHTERM' server.log | grep -v 'PHHIABFFH' | grep -v 'Stats' It should find all the lines including SEARCHTERM but exclude if one of the SEARCHTERM lines includes PHHIABFFH or Stats. ...

GTK/Qt On PLT Scheme

Hello, When you compile something written in PLT Scheme on Linux that have a GUI the final will be in a grey(default) theme of Linux, but I want to know If it's possible to integrate PLT Scheme with GTK or Qt? How to do this? Example of grey(default) theme: Thanks. ...

Why linux sort is not giving me desired results?

I have a file a.csv with contents similar to below a,b,c a ,aa, a a b, c, f a , b, c a b a b a,a,a a,a,a a aa ,a , t I am trying to sort it by using sort -k1 -t, a.csv But it is giving following results a,a,a a ,aa, a a aa ,a , t a b a b a,a,a a , b, c a,b,c a b, c, f Which is not the actual sort on 1st column. What am I doin...

Initial state of program registers and stack on Linux ARM

I'm currently playing with ARM assembly on Linux as a learning exercise. I'm using 'bare' assembly, i.e. no libcrt or libgcc. Can anybody point me to information about what state the stack-pointer and other registers will at the start of the program before the first instruction is called? Obviously pc/r15 points at _start, and the res...

Fast Graphics with XServer

I am working on embedded linux platform with limited system resources. I want to do fullscreen slideshow with simple transistions (like slide in-out, fade in-out ). I tried PyGtk+GTK+Cairo but its very slow, when I animate GTK image controls I get just two or three frames per second. But smplayer is playing video at good speed! I did ...

modify sql file on using command line on unix

I have a .sql file that needs a little tweaking, speficially: [xx_blah] any pattern like the above needs to be changed to: [Blah] i.e. remove the xx_prefix and upper case the next character. any tips? ...

Can I run out of virtual memory on linux?

My application similar to hypotetical program: for(;;) { for (i=0; i<1000; i++) { p[i] = malloc(random_number_between_1000_and_100000()); p[i][0]=0; // update } for (i=0; i<1000; i++) { free(p[i]); } } Has no memory leaks but on my system, the consumption of memory (top, column VSS) grows without limits (such as ...

Kdump to nfs - kdump service canot find my bridged network device

Since migrating to Fedora 12 from 11, i've been getting daily kernel panics. I think it might be related to virtualization, but i just cannot tell. I've been trying to set up kdump in order to get the info i need but when i try to start the kdump service, i get: ls: cannot access /sys/class/net/br0/device: No such file or directory th...

[C#] Get and set enviroment variables on mono and possible alternative

I got a little c# dll that implements a message queue service and on windows it runs perfectly. To locate all the queues i use an enviroment variable stored in Machine during the installation. System.Environment.SetEnvironmentVariable("PHMQ", install_dir , EnvironmentVariableTarget.Machine); Now i just tryed to run it on Mono, and when...