Something I have always wondered but never had any luck finding information on is running a shell script when a device mounts...
Lets say I have an external hard drive as a back up, every time I plug the device in I want to launch a shell script to rsync a few directories.
How would I do... (4 Replies)
I just upgraded to Android 2.2 from 2.1. The GPS issue that was troublesome in 2.1 seems to have been fixed. Some of web browsing seems faster, but it could just be my connection is better today ;) Flash works in some browsers but not very good and it is too slow for Flash apps designed for... (0 Replies)
Hi UNIX-Forum!
I don't know if this is the right Forum for my question, but since Android technically is a UNIX-based system...
I have a rooted Android and a Terminal emulator and bash installed.
I wanted to write a little script for my android that activates GPS, gets the location and sends... (3 Replies)
Hello Gurus,
We are in the process of configuring SAN based backup for our DB hosted on Solaris 10 (SPARC and X86) Servers. But the Robotic arm (Medium Changer - HP) is not getting detected on the server.
Need experts help in checking this from the host (Solaris Server) end.
Thank You. (0 Replies)
HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here
Im explaining the requirement of script.
AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Hi,
I have a program that logs serial port data. In order to do so it requires the full device name in linux (e.g. /dev/ttyUSB0) and a baudrate.
Does anyone know how I can find out the device name in the terminal? I am trying to port this application to Android and cant figure it out.
... (22 Replies)
I am looking for a way to run on top of the Linux kernel of an Android device. I want to use the existing configured Linux beneath Android rather than put a new Linux distribution onto a device.
The article "The Android boot process from power on" (sorry, forum won't let me paste the link)... (0 Replies)
MT_RAND(3) 1 MT_RAND(3)mt_rand - Generate a better random valueSYNOPSIS
int mt_rand (void )
DESCRIPTION
int mt_rand (int $min, int $max)
Many random number generators of older libcs have dubious or unknown characteristics and are slow. By default, PHP uses the libc random
number generator with the rand(3) function. The mt_rand(3) function is a drop-in replacement for this. It uses a random number generator
with known characteristics using the Mersenne Twister, which will produce random numbers four times faster than what the average libc
rand() provides.
If called without the optional $min, $max arguments mt_rand(3) returns a pseudo-random value between 0 and mt_getrandmax(3). If you want a
random number between 5 and 15 (inclusive), for example, use mt_rand(5, 15).
Caution
This function does not generate cryptographically secure values, and should not be used for cryptographic purposes. If you need a
cryptographically secure value, consider using random_int(3), random_bytes(3), or openssl_random_pseudo_bytes(3) instead.
PARAMETERS
o $min
- Optional lowest value to be returned (default: 0)
o $max
- Optional highest value to be returned (default: mt_getrandmax(3))
RETURN VALUES
A random integer value between $min (or 0) and $max (or mt_getrandmax(3), inclusive), or FALSE if $max is less than $min.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.4 | |
| | |
| | Issues an E_WARNING and returns FALSE if $max < |
| | $min. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
mt_rand(3) example
<?php
echo mt_rand() . "
";
echo mt_rand() . "
";
echo mt_rand(5, 15);
?>
The above example will output something similar to:
1604716014
1478613278
6
NOTES
Caution
The distribution of mt_rand(3) return values is biased towards even numbers on 64-bit builds of PHP when $max is beyond 2^32. This
is because if $max is greater than the value returned by mt_getrandmax(3), the output of the random number generator must be scaled
up.
SEE ALSO mt_srand(3), mt_getrandmax(3), random_int(3), random_bytes(3), openssl_random_pseudo_bytes(3), rand(3).
PHP Documentation Group MT_RAND(3)