linux

Find hosted directories Jetty/Apache

Hi, Let say I have a directory which is being hosted by Jetty or Apache (i'd like an answer for both), i know the URL including the port and i can log into the server. How can i find the directory that is being hosted by a certain port? I'd also like to go the other way, i have a folder on the server, which i know if being hosted, but...

Linux SMAP Output Decoding

Following is a part of output from smaps. 5b030000-5b82f000 rwxp 5b030000 00:00 0 Size: 8188 kB Rss: 24 kB Pss: 24 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 0 kB Private_Dirty: 24 kB Referenced: 24 kB Swap: 0 kB Ple...

Is there a (Linux) C++ IDE that can 'construct' a project from a makefile?

I am working on a legacy C app which uses makefiles. I am more comfortable (and more productive) working from within an IDE, so I am looking for an IDE that can import the makefile and create a project. Incidentally, these are hand written makefiles (not complicated ones like those generated by Autoconf). I am using Code::Blocks at the ...

Converting a date formated as DD/MM/YYYY to seconds spent from 01/01/1970?

Following command converts date formated as MM/DD/YYYY to seconds. date -d "01/21/2014" +%s How can I convert DD/MM/YYYY formated date to seconds? Thanks ...

Simple socket server for Linux

Hi all, I want TCP/IP based socket server application or code for Linux, which performs a very simple operation: reads xml string from one of the connected socket clients and forwards it to all socket clients which are connected to it. I have such client server application developed in cocoa, but according to my requirements now I need...

Kernel module for /proc

How to write a kernel module that creates a directory in /proc named mymod and a file in it name is mymodfile. This file should accept a number ranged from 1 to 3 when written into it and return the following messages when read based on the number already written into it: • 1: Current system time (in microseconds precision) • 2: System ...

Using many mutex locks

I have a large tree structure on which several threads are working at the same time. Ideally, I would like to have an individual mutex lock for each cell. I looked at the definition of pthread_mutex_t in bits/pthreadtypes.h and it is fairly short, so the memory usage should not be an issue in my case. However, is there any performanc...

Query size of block device file in Python

Hello. I have a Python script that reads a file (typically from optical media) marking the unreadable sectors, to allow a re-attempt to read said unreadable sectors on a different optical reader. I discovered that my script does not work with block devices (e.g. /dev/sr0), in order to create a copy of the contained ISO9660/UDF filesyst...

question of sed replace

hi i have a config file xml <tflow name="CENTRE" inputDTD="/JOBS/cnav/etc/jobReporting/batch/dtd/dtd-ContactCentre.dtd" inputFile="/JOBS/cnav/etc/jobReporting/import/2010.05.02.CONTACTCENTRE.xml" logPath="/JOBS/cnav/etc/jobReporting/logs/" rejectPath="/JOBS/cnav/etc/jobReporting/rejets/"/>...

QT qmake lowercases my custom widget names

I'm using QT 4.6 on Linux and Windows, and on Linux, it insists on including my QScrollPane by qscrollpane.h App.pro: HEADERS += widgets/QScrollPane.h The section from mainform.ui <widget class="QScrollPane" name="ListView"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>500</width> <height>490</height>...

Deleting a possibly locked file in c

I am using fcntl locks in C on linux and have a dilemma of trying to delete a file that may possibly be locked from other processes that also check for the fcntl locking mechanism. What would be the preferred way of handling this file which must be deleted, (Should I simply delete the file w/o regard of other processes that may have read...

linux user login/logout log for computer restriction

Hi ! I would like to know how to log the login and logout of a user : it would be a mean to measure how much time someone has been connected in a month so far. I know it's possible to use the command "last". But this command is based on a file that has a r/w permission for the user, hence the possibility to change these data. I would l...

Help with Python structure in *nixes.

I came from a Windows background whern it comes to development environments. I'm used to run .exe's from everything I need to run and just forget. I usually code in php, javascript, css, html and python. Now, I have to use Linux at my work, in a non changeable Ubuntu 8.04, with permissions to upgrade my system using company's repositor...

Linux keyboard event capturing /dev/inputX

I was trying to capture keyboard events. e.g. I want to drill down a keylogger from the scratch. After 2 hours of fighting I found the following neel@pc1$ ls -l /dev/input/by-id lrwxrwxrwx 1 root root 9 2010-05-05 21:33 usb-Plus_More_Enterprise_LTD._USB-compliant_keyboard-event-kbd -> ../event1 lrwxrwxrwx 1 root root 9 2010-05-05 21:33 ...

Force Java2D Subpixel Antialiasing

I am using Java2D to generate images with text on them. The fonts are being horribly rendered with bad antialiasing on a Server running Ubuntu but render beautifully on an OSX and Ubuntu workstation. I guess that the difference between the two Ubuntu installs is xwindows vs no xwindows? Maybe? Anyway, I guess that my rendering hints ...

Linux command to find the which are the jars loaded by the jvm

Can someone let me know, what will be unix command if I need to check want are the jars loaded by java.. ...

Tee a Pipe Asynchronously

...

How does Linux blocking I/O actually work?

In Linux, when you make a blocking i/o call like read or accept, what actually happens? My thoughts: the process get taken out of the run queue, put into a waiting or blocking state on some wait queue. Then when a tcp connection is made (for accept) or the hard drive is ready or something for a file read, a hardware interrupt is raised ...

sed: group capturing

Is there any way to tell sed to output only captured groups? for example given by input: This is a sample 123 text and some 987 numbers and pattern /([\d]+)/ I could get only 123 and 987 output in the way formatted by back references perhaps? ...

Recommendations for keeping a build server updated

As a guy who frequently switches between QA, build and operations, I keep running into the issue of what to do about operating system updates on the build server. The dichotomy is the same on Windows, Linux, MacOS or any other o/s that can update itself via the internet: The QA team wants to keep the build server exactly as it is from...