How do I determine the uptime on a SunOS UNIX box in seconds only?
On Linux, I could simply cat /proc/uptime & take the first argument:
cat /proc/uptime | awk '{print $1}'
I'm trying to do the same on a SunOS UNIX box, but there is no /proc/uptime.
There is an uptime command which presents the following output:
$ uptime
12:13pm up ...
For some reason, siginterrupt() only seems to set the behaviour for the first signal received.
In this example program, the first SIGQUIT appears to do nothing, but the second sigquit prints "SIGQUIT Handler" and s.accept() throws an Interrupted system call exception.
from signal import *
from socket import *
import sys
def sigquitHan...
Hi,
I am working with microtime() to time some scripts, but all the scripts have really quick times, eg 2.1934509277344E-5
how can i get php to display that correctly without e-5?
(which i assume is 0.000021934509277344? long time since i did maths...)
...
I'm guessing this has to be an escaping issue, but I can't find it. What's most frustrating is that this is based on an old sed script I used that worked, so why can't I make it work when I try to re-use it a year later? ;)
Framework:
I have a file with a list of filenames in it that all need the same
string of HTML searched and repla...
I'm sure this is a easy question, my Google-fu is obviously failing me.
How do you mount a filesystem using Python (i.e the equivalent of running the shell command mount ...). Obviously you can use os.system to run the shell command, but surely this is a nice tidy, python interface to the mount system call.
I can't find it (I thought i...
I wish to use "gethostbyname" in my Suse m/c but it is not returning any structure.
but on the other systems it is working fine what could be the issue with my m/c ??
...
How the Scala script that reads 5G log file from network drive should be modified in order to read last x lines (like 'tail' in Unix)?
::#!
@echo off
call scala %0 %*
goto :eof
::!#
import scala.io.Source
if (args.length > 0) {
for (line <-Source.fromFile(args(0)).getLines)
if(line.contains("percent")){
print(line)
}
}
...
openat() was added to POSIX in the POSIX.1-2008 revision, and has been supported by Linux since 2.6.16. How is support on non-Linux UNIXes? eg, Darwin, the *BSDs, and proprietary UNIXes.
...
this is a telecom based query.
we receive TAP files from the clearing house.
i want see on unix which version of TAP does it belong.
how can i do it.Isthere any tool to find the TAP file version?
...
What is the meaning for $! in shell or shell scripting? I am trying to understand a script which has the something like the following.
local@usr> a=1
local@usr> echo $a
1
local@usr> echo $!a
a
It is printing the variable back. Is it all for that? What are the other $x options we have? Few I know are $$, $*, $?. If anyone can point me ...
Hi,
I'm using the openssl utility of debian in order to create a certificate.
The certificate paramemters are given in a configuration file, which is made of key-value pairs.
My problem is that I want one of the values to include the number sign (#). But openssl handles this sign as a beginning of comment, i.e. if my value is val#1, o...
How could I find directories with the name of specific length?
For example, I have bunch of directories which have length of the name equal to 33 chars ('a92e8cc611fdebcca3cf2fc8dc02c918', 'c442fb3f46d6c8bd17d27245290a9512' and so on).
Does find utility accepts condition in form of the 'wc -c'? Or maybe some other utilities should be pi...
Some commands like svn log, for example will only take one input from the command line, so I can't say grep 'pattern' | svn log. It will only return the information for the first file, so I need to execute svn log against each one independently.
I can do this with find using it's exec option: find -name '*.jsp' -exec svn log {} \;. Ho...
Hellos good fellas! now i'm desparate. I feel like i'm turning round. when i believe solve something then i break something else.
started using this mac this week.In the process of setting up my environment i face some challenge.I got a maven project which uses cargo plugin to publish to tomcat working fine.for that i had to google to c...
This might be genuine question but i am asking here since i was out of any clue when i was asked this question in an interview.
how could we debug a thread which was created by another thread?
let's say there is a main process and it calles the function pthread_create to create a thread process which is not joinable and that means both ...
I am getting this error while compiling mysql 5.1 source with Archive Storage. Can someone point me to the correct way of enabling archive storage engine?
./configure --prefix=/usr/local/mysql --with-archive-storage-engine
Parse errors: No plan found in TAP output
mysys/my_atomic-t (Wstat: 0 Tests: 0 Failed: 0)
Parse errors: No plan fo...
All,
I need some command like GREP in UNIX for WINDOWS Operating system, If there any way to use grep or any equivalent command in Windows?
Please help
...
What might be a better choice?
I have my code (mostly C - as output from the GNU Eiffel compiler and some C++ for the GUI bindings) working with Sun Studio compiler and gcc.
But i now have to setup a new developer computer and wonder if i should use Solaris with DTrace, locklint or Linux with Valgrind etc for development.
It's just ab...
Hello guys
i know i've posting a lot about mac lately and setting up my environment to develop on java 1.6.
after trying to set my etc/launch.conf like so
setenv JAVA_VERSION 1.6
setenv JAVA_HOME /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/
setenv CATALINA_BASE /Library/apache-tomcat6020
setenv CATALINA_HOM...
If you run this command:
$ curl -XHEAD -i -H "User-Agent: myuseragent" http://www.google.com
HTTP/1.1 302 Found
... snip ...
Server: gws
Content-Length: 222
X-XSS-Protection: 0
you will notice immediately that the curl command hangs. (I am running this in cygwin/VISTA)
If you run it against twitter or facebook, curl terminates immed...