linux

Where the Ubuntu’s source can be gotten?

Where can I get Ubuntu's source code? Actually I want It's kernel's code. I know I can get the kernel from kernel.org but as I found out that Ubuntu does some patching on the kernel I want to know what are those patches. And yes I know Ubuntu's kernel code can be found in an installed Ubuntu in the file system but thats just the code! I ...

The CPU idle is set to 99 while using vmstat, what does this mean?

I am confused with the CPU idle time is set to 99. Does this mean the CPU is idle not doing anything for 99% of the time? #vmstate procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 2336 18512 263972 1048992 0 0 ...

How to rewrite python script output in terminal?

I have a python script and I want to make it display a increasing number from 0 to 100% in the terminal, I know how to print the numbers on the terminal but how can I "rewrite" them so 0 turns into 1, 1 into 2, and so on until 100? ...

web develop + usb notification

In a local area network is lamp-server, on which the site is located. On the client computers (winXP, Ubuntu) network running opera / firefox (mode kioskmode). Opera-kioskmode local_site.ru.dev Is it possible to doing what any script / code local_site.ru.dev - access usb devices (flash drive, SD card and other drives) connected to ...

remove certain tag in files under linux?

Hi, I found out that someone spyware on my server and the spyware infected all the files. Infected files have tag at the bottom of the file. is there a way to loop all the files and remove only certain tag under linux? ...

Is there an OS command I can run to determine if running inside a Xen based virtual machine

Hi, Is there an OS command I can run from within a Xen based virtual machine to tell me that it is a virtual box rather than a physical box - I heard that the kernel had some self awareness smarts about it. e.g. like an extra column in "ps" output or something? [I know vmstat provides the "st" column but I have seen this on physical hos...

Is Apple's iCal Server any good on this LAMPe environment?

We have a web-based calender App, which was written long before I was hired by our company. It uses a proprietary system (our own) to store and work with them. I was told it wasn't that bad of an App back in the day, but with the inception of web calendars (notably Google Calendars), it just seems outdated and unusable. Our boss wants u...

Incrementing the value of POSIX semaphores by more than 1

I have this requirement wherein I have to increment the value of a POSIX semaphore by more than 1. Apparently, there is no way in POSIX specification to do this. There is no sem_setvalue() similar to sem_getvalue(). I do not want to go back to System V semaphores just because of this constraint. Is there any alternative way to acco...

Calling python script on MAC/Linux from Command line - passing arguments

Consider this setup and folder structure: c:\foo \bin\foo.bat \lib\foo.py I have foo.bat path added to my environment PATH, so I can call it from anywhere passing in some arguments: c:/>foo.bat -v foo.bat contains this code: @ECHO OFF "c:\foo\lib\foo.py" %1 %2 %3 %4 %5 %6 %7 %8 %9 This works fine in Windows. Now I ...

Server IPC design issue

Hi, i have a design issue regarding sending user data from a mobile phone app to a server (Debian 5 LAMP). I need to send various details such as username , date of birth, customer order no. etc. These will be passed onto a C code app (always on process)running on the server. I am currently using named pipes for IPC between my external ...

thread in multi core processor

I have programm writting with C, and I want just only function in oher processor. Does anyone know how to be thread-distribution for multi-core processors work? Can a current thread running on the times one, sometimes on the other core, depending on how busy the nuclei are straight? Add Reply ...

Get PID of javaws jnlp applet under linux

I'm trying to run a java (jnlp) applet from bash and get the PID of the created process. Using this command : javaws myapplet.jnlp > /dev/null & echo $! This returns a pid of the first instance of java that loads the jnlp; i guess, but has nothing to do with the final java process running. Any clues ? Found out the original javaws...

cleaning the files in directory in linux

I want to clean all files in a directory on Linux (not deleteing them, only clear their content) I need to do it in C. ...

parsing the value in between two XML tags

I know this one has been asked before, however I can't seem to find a suitable solution, so I 'll state the problem: I have a string of characters that is similar to an XML file. It's not an XML string, but it has opening and closing tags. All the information resides in one single line, for example: <user>username</username>random data...

Linux: How to map a blockdevice to a USB-device?

Hi, if I plugin a USB memory stick, I see a new folder in /sys/bus/usb/devices ... thus a new USB-device. Also I see a new folder in /sys/block ... thus a new block-device. My question is: How can I get a waterproof mapping between those two devices? Means: If I get a new device in /sys/bus/usb/devices, how can I programatically (f.i...

Creating a shorter version of a bash command

i am novice to the Linux shell and had to recently start using it for work...i have now got used to the basic commands in bash to find my way around...however there are a lot of commands i find myself typing over and over again and its kind of a hassle to type them every time...so can anyone tell me how can i shorten the command syntax f...

What is the best way to share cruisecontrol configurations on a Linux server?

I have a team that will be using CruiseControl for continuous integration, and CC will be running on a Linux server. More than one team member may need to access the CC configuration itself: changing how tests are run, changing notification rules, etc. What is the best practice for this? My first thought was to set up a cc-users group,...

extract sub expression with sed

Hi, I have a list of directories starting from /root. Eg random text /root/dir1/files random end delete me /root/dir1/files/2dir I am waste /root/examples/source alalalala /root/example/header some other text I want to use sed to take from every line the directory and remove everything else. My final output must be /root/dir1/f...

Debian Start QT GUI application with no desktop

I have Debian 2.6 running on a SBC that I plan on using in an embedded setup. What I need to do is configure it so that linux will start up and run just my QT GUI application. Do I need a window manager to do this or can I just do it with X11. Also because its going to be for an embedded system I do not want to load any desktop manager. ...

extend the size of already existing ext2 image

Is there a possibility to extend the size of already existing ext2 image? This image is a ramdisk based root file system. I already have an image. but I want to extend the size of this image. Is it possible to extend the size of this image. ...