linux

Simulating "faster time" in linux

I have a Java app that runs on linux that has a lots of events and business logic that revolve around times and dates. For testing, is it possible to tweak something into time going faster. Let's say, make a whole computer-year finish in one hour wall time? ...

Linux: Which process is causing "device busy" when doing umount?

Linux: Which process is causing "device busy" when doing umount? ...

Linux tool: convert

The system I'm using uses the linux utility convert to convert pdfs to jpgs. My box gives me the following error. >$ convert Badge-1114044091.pdf Badge-1114044091.jpg convert: Postscript delegate failed `Badge-1114044091.pdf'. convert: missing an image filename `Badge-1114044091.jpg'. But the production machine does not. According to ...

Passing a pointer to process spawned with exec()

I would like to pass a pointer (I am putting a file with data in memory with mmap) to processes spawned using fork + exec, but I am stuck on how to pass a pointer to the exec() spawned process? UPDATE1: Thanks for your inputs, I do use shared memory creating it with mmap with MAP_INHERIT flag: Each mapped file and shared memory region...

Finding which process was killed by Linux OOM killer

When Linux runs out of memory (OOM), the OOM killer chooses a process to kill based on some heuristics (it's an interesting read: http://lwn.net/Articles/317814/). How do I find out which processes were recently killed by the OOM killer? ...

Transparent Proxy for IPv6 traffic under Linux

When maintaining networks, it is often an expedient thing to do to run a transparent proxy. By transparent proxy I mean a proxy that 'hijacks' outgoing connections and runs them through a local service. Specifically I run a linux firewall with squid configured so that all tcp/ip connections fowarded on port 80 are proxied by squid. This...

What would be the simplest system to send sms from linux server?

What would be the simplest system to send sms from linux server? It`s a Debian system. There would be not much SMSes. What hardware and software to use? Maybe use some SMS sending service? ...

How do I put an already running process under nohup

I have a process that is already running for a long time and don't want to end it. How do I put it under nohup (i.e. how do I cause it to continue running even if I close the terminal?) ...

blocking access to network services to a user in linux

is it possible to give a user an account on a linux machine while blocking his access to network services (say, don't let him open tcp connections to port 80 on the internet). I know a firewall can do this, but I would like something in the unix philosohpy (everything is a file). perhaps there is somewhere a file that represents port 80...

Is Java Reflection on Inherited Methods Different in Windows and Linux?

While setting up Hudson for continous integration testing (on a JeOS server), I've come across some strange behaviour I'm hoping the fine people at SO can explain to me. Our unit tests depend heavily on the use of domain objects, with lots of properties that must be set (due to null constraints in the database). In order to keep our tes...

Applying AWK on Set of Files with Same Extension

I want to apply the following "awk" command on files with extension "*.txt" awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' But why this command doesn't work: for i in *.txt do echo awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' $i; done Normally, awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' file1.txt would work. ...

linux kernel module linker warnings: "*** Warning: <function> [<module>] undefined!" - any way to get rid of them?

While compiling Linux kernel modules that depend on each other, linker gives undefined symbol warnings like Building modules, stage 2. MODPOST *** Warning: "function_name1" [module_name] undefined! *** Warning: "function_name2" [module_name] undefined! *** Warning: "function_name3" [module_name] undefined! The unresolved symbols ar...

how do I get a process to reload itself in linux?

I have a service, say foo, written in C++, that runs as root. There is the usual scrip, /etc/init.d/foo start|stop|restart. At certain times, foo needs to reload itself. Normally after an upgrade has finished. But doing things like: system("/etc/init.d/foo restart") doesn't work since as soon as restart kills foo, the system() cal...

Does any Unix-like system ascribe meaning to the SUID bit on a directory?

As the title says, does any Unix-like system ascribe a meaning to the SUID bit on a directory, and if so, what does it mean? The SVTX (saved text, or sticky) bit has a meaning - thou shalt not delete a file from this directory unless you can write to the file. It is used on /tmp, for example. The SGID (set GID) bit has a meaning - fil...

Moving All Files From Directories One Step Up

Dear all, I have a directories that look like this fool@brat:/mydir/ucsc_mm8> tar -xvf *.tar 1/chr1.fa.masked 1/chr1_random.fa.masked 2/chr2.fa.masked 3/chr3.fa.masked 4/chr4.fa.masked 5/chr5.fa.masked 5/chr5_random.fa.masked 19/chr19.fa.masked Un/chrUn_random.fa.masked What I want to do is to move out all the "*.masked" files in th...

UNIX command to list folders with file counts

I want to get a list of folders at the current level (not including their subfolders) and simply print the folder name and a count of the number of files in the folder (preferably filtering to *.jpg if possible). Is this possible in the standard bash shell? ls -l prints about everything but the file count :) ...

Problems with IRQs when connecting two digium card in and asterisk box

I have two Digium Wildcard TDM800P with 8 FXO ports each. When I connect both at the same time IRQ misses start showing up making my computer unresponsive and unusable. One card works fine but I need all 16 FXO ports to work to receive calls from my Telco. Is there a way for the cards to communicate with each other so they don't genera...

Privilege Escalation in Web Environment for File Access

I have a situation where I would like to elevate the permissions I have in a web environment so that I can access a serial device. The specific case is where I have a web interface for configuring a modem that comes up on /dev/ttyUSB[0-9]. Zero or more modems will be plugged in by an end user. I am writing some software that is capab...

How can a Perl script know its own memory footprint?

I have a long running Perl script and I'd like to let it know (and report) how much memory it is using. I'd like to have this information both on Linux and Windows and if possible on Mac OS X as well. ...

Source code for Linux or Windows for access to the SIM Access Profile the mobile phone

I tried to find many times but cannot find. Can somebody help me? Thank you in advance ...