linux

Something wrong with my sh script dont know why?!?!?!...

I wrote this sh script here. What it suppose to be doing is it prompts the user to type in the old password, then checks the password with the password in the "PASSWORD.txt" file if not it would exit, else if it matches then it would ask the user to type in the new password twice. Then it checks if the two new passwords are the same if n...

Files reading differently in linux? C++

I'm a fairly new programmer, but I consider my google-fu quite competent and I've spent several hours searching. I've got a simple SDL application that reads from a binary file (2 bytes as a magic number, then 5 bytes per "tile") it then displays each tile in the buffer, the bytes decide the x,y,id,passability and such. So it's just lev...

Linux - killing some processes owned by apache safely

Hi all. I have a bunch of processes owned by apache that are running for days because they are stuck. apache 11173 0.1 0.0 228248 27744 ? Ss Sep27 3:58 php /var/www/html/myproj/symfony cron:aggregation --env=prod apache 12609 0.1 0.0 228244 27744 ? Ss Sep18 19:30 php /var/www/html/myproj/symfony cron:aggr...

Compling C++ on remote Linux machine - "clock skew detected" warning

I'm connected to my Universities small Linux cluster via PuTTY and WinSCP, transferring files using the latter and compiling and running them with the former. My work so far as all been in the Uni labs and today I've been doing some work at home and hit an interesting warning. I uploaded an entire folder of stuff and upon running make i...

Home server auto control

I've got home server used to store files. PC 1 (Windows) gets internet directly from HS(Home server - Ubuntu Server) PC 2 (Windows) and PC 3 (Windows and Linux) need access to HS files. I'd like to create software or scripts which would allow to: When PC 1 turns off turn off HS but only when PC 2 and PC 3 are turned off. When PC 2 t...

Has anyone an example for wrapping a function in C++?

I have searched online a lot but I couldn't find an example that works with g++, all examples work with gcc. The error I keep getting is wrap_malloc.o: In function `__wrap_malloc(unsigned int)': wrap_malloc.cc:(.text+0x20): undefined reference to `__real_malloc(unsigned int)' wrap_malloc.o: In function `main': wrap_malloc.cc:(.text+0x37...

Generating Vector of Random Number (of Size M) from -K to K in C++

Is there a fast way to do that? ...

How to use cscope?

I am using cscope to get familiar with all the keywords used in socket programming. I went to the directory with c files. I used cscope. and then I searched for AF_INET. I got this : #define AF_FILE PF_FILE #define AF_INET PF_INET #define AF_AX25 PF_AX25 This was a full page. I only published part of it. Now I ...

how to speed up jobs which take up a lot of CPU time in LSF?

I am giving a job (EDA tool run) to LSF. It is taking a lot of time to finish. I am giving it to a large queue and reserving 20 GB memory. Are there any recommendations to speed this up? Appreciate any help. ...

Linux: What happens to active threads hooked into system monitors when a process is killed?

I've written a tool that uses inotify watches to monitor directory changes. It starts a separate thread per watched directory, each using inotify to setup the watch. What happens to these threads/watches if the parent process is terminated with kill? ...

Run web testing framework watir on firefox / linux

Hello, I'm developing a website on fedora linux. I want to run test. So I choose watir & ruby development to test. So I wan to install watir on my system but I have errors : I ran this script cat << EOF > /etc/yum.repos.d/ruby.repo [ruby] name=ruby for Fedora \$releasever - \$basearch - Base baseurl=http://mirror.nl.ergo-project.org/re...

How to convert specific no. of pages from a .pdf file to .png image using imagemagick

Hello i am using Imagemagick for converting my .pdf file to .png images but when i issue the command $convert sample.pdf image.png then it will convert all the pages of sample.pdf file to .png images but exactly i want to convert a specific no. of pages(e.g. first 10 pages or page no.22 or 12 etc.) then pleases suggest me a way ...

Standard error not getting redirected from this java command in bash

I have the following shell script. For some reason the java program's standard error and standard output is not printed to the file "log" but instead always appear in the console. Is there a type some where or am I missing something? JAVACMD="java -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxre...

how can I statistic my key press frequency and count

I am try to remap my keyboard to type better. But I need to know the frequency of each key include symbol, It will be great if include tab shift ctrl. I need all the keypress acounting not only frequency of letters appears in english words. I am using ibus-pinyin as my input method. and archlinux, awesome wm, without kde and gnome inst...

write a program like squid by libpcap

hi can we in a network gateway write a program with libpcap to extract destination web address and other info like squid? in c language. is any better way? if yo can give me some example and guide. ...

linux command for extracting war file

i have centOS on my VPS and i upload myproject.war file to the tomcat application server (/webapp folder). how can i extract the .war file with linux command prompt? i'm using puTTy. ...

Stream Java audio to an icecast/shoutcast server? Pipes and stdin?

I'm using a java music library called JavaMod. I want to stream the output of the java audio system to a shoutcast server. "ezstream" is a command line tool that accept stdin and encode/stream it to an icecast/shoutcast server, but I'm not sure how to hook ezstream into the java audio system. How do I 'register' the stdin of "ezstream...

Unpatched Linux Kernel Vulnerabilities

I recently found out that there are several vulnerabilities in the linux kernel that allow for privilge escalation, that have not been patched yet in the major distributions, and have public exploits on the usual sources. For example, I could get root on any of my completely up to date Ubuntu 10.04 systems using this very simple exploit....

Is there a good way to submit jobs to a cluster using bash?

Is there a good tool out there to do this on a Linix machine using the bash shell? All I need is to issue different commands on a set of nodes in a cluster and when one of them is done with the job, I'd like to submit another one. Something very similar to what Hadoop can do. I would be interested in knowing the status of the job as well...

Virtual method & this pointer

Hi. I'm just beginning to learn C++ and I'm trying to make Thread class that that has the basic functionality of the Java Thread class. What I'm trying to do is make a class which you subclass, write a Run method (which is pure virtual in the base class) create an object of the subclass call the start method on it and you have thread. T...