unix

Accessing data link layer packets

I want to create a socket for accessing IPv4 packets from data link layer. From unix network programming V1, socket(PF_PACKET, SOCK_DGRAM, htons(ETH_P_IP)) 1)I am implementing a dhcp client, is this the correct way of doing that? (means without accessing data link layer, i cannot receive reply from dhcp server) or is there any other e...

Can the Unix list command 'ls' output numerical chmod permissions?

Is it possible when listing a directory to view numerical unix permissions such as 644 rather than the symbolic output -rw-rw-r-- Thanks. ...

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...

Script that will quit out every 5 minutes then renew itself where it left off

Hey all, I've got a UNIX question... I have a PHP script that I run in the terminal that parses a bunch of images and puts them in the database. This script has already been written Due to restrictions on my hosting (Bluehost) I cannot run a process for more than 5ish minutes. I'm wondering how to set it up so that I will quit out of t...

How to create installer for solaris

Hi, I have already createdrpm file for my application. It works fine for Fedora linux. also the same worked fine for linux mint. But Solaris does not support rpm. So how to create installer package for solaris OS. I have solaris 10 linux as OS. Thanks Sunil Kumar Sahoo ...

Remove first line in text file without allocating memory for entire text file

Hey all, I have a very large text file and all I need to do is remove one single line from the top of the file. Ideally, it would be done in PHP, but any unix command would work fine. I'm thinking I can just stream through the beginning of the file till I reach \n, but I'm not sure how I do that. Thanks, Matt Mueller ...

Is there a standard permissions scheme for web server directories?

I have built many web sites and have used a few different ways of setting the permissions on my folders. I would like to know if there is a definitive configuration for web server directories. I have listed the folders which I consider to be standard in a typical web site directory, what is the permssion setting required for each one?...

shell script purpose of x in "x$VARIABLE"

I'm peeking through some shell scripts - what's the purpose of the x in the comarison shcu as if [ "x$USER" != "x$RUN_AS_USER" ]; then su - $RUN_AS_USER -c "$CATALINA_HOME/bin/startup.sh" else $CATALINA_HOME/bin/startup.sh fi ...

Executing an script with crontab returns 127 error code

I am executing a script manually on my UNIX system manually, it runs successfully and updated required records in ORACLE database. How ever when I exwcute the same script with crontab my process exits with the error code 127. On analysing further, I got there is some problem in these statements. LOGFILE=sachin ORALOGIN=abc/abc@abcd ...

ddd gets inactive when mouse is moved out of its window

My ddd window doesn't take any keyboard input when my mouse cursor is moved out of the window. Although ddd window is still active, but it doesn't take any inputs. I will have to move my mouse over its window to make it work again. Is there a way to configure it in a way that it takes the input no matter where the mouse pointer is, just ...

Setting a custom system date on the fly for PHP script

Hi, We have a script that needs to function between two dates, so to test the script we need to change the UNIX system date to simulate the date conditions. PROBLEM: The problem is we have other systems running on the same server so we can't just change the UNIX system date. QUESTION: Is there a way to set the system date on the fly w...

File modification time (seconds) on Unix

Hi there, On Unix, is there a command to display a file's modification time, precise to the second? On Linux this is easily done with a "stat -c %y", which returns something like 2009-11-27 11:36:06.000000000 +0100. I found no equivalent on Unix. ...

Possible to svn export and include unversioned files?

I would like to export my code from the working svn copy while including all unversioned files. For example, there are uploaded images/config files etc, that I would like included in the export. How can I achieve this? ...

Looking for book on Bash scripting

I'd like to brush up on my knowledge of Shell scripting with Bash for a job interview Monday. What would the preferred book be for someone with an existing knowledge looking to review the topic? ...

Linking with .so files (webkit)

Hi, I'm trying to create a program that uses some of the code from WebKit/GTK+. Specifically, I want to load a string, use WebKit's parser to construct a DOM tree and then iterate over that tree. I'm trying to use a class called HTMLDocument. WebKit/GTK+ doesn't expose this as part of its API and I'm running into some trouble linking ...

What LD stand for on LD_LIBRARY_PATH variable on *unix?

I know that LD_LIBRARY_PATH is a environment variable where the linker will look for the shared library (which contains shared objects) to link with the executable code. But what does the LD Stands for, is it for Load? or List Directory? ...

How to Use CCache with CMake?

I would like to do the following: If CCache is present in PATH, use "ccache g++" for compilation, else use g++. I tried writing a small my-cmake script containing CC="ccache gcc" CXX="ccache g++" cmake $* but it does not seem to work (running make still does not use ccache; I checked this using CMAKE_VERBOSE_MAKEFILE on). Updat...

What is the use of TNS_ADMIN variable in Oracle?

Hi All, Please tell me what is the use of TNS_ADMIN parameter in Oracle? I am working on Unix using oracle database. Is this parameter is required to locate the sqlplus. I am executing a script in which a update query is executed on Oracle Database. The script fails with 127 error code when executed with crontab. The script content...

Does sqlplus uses TNS_ADMIN variable?

Please tell me does sqlplus uses TNS_ADMIN variable on UNIX and AIX? Can we able to locate sqlplus if this variable could not be located? ...

Knowing the availability of variables in crontab

What all variables BY DEFAULT are available if a script is executed by the crontab on UNIX Are .profile and oracle.env executed when the cron job is executed? ...