General :: Generate Random Number Either 1 Or 0?

Jan 21, 2010

Not only that but I need tons and tons of them generated, and I need it to be totally random each time.

Code:
matthew@mvm:/h/misc> cat a
#!/bin/bash
for i in {1..5}; do
echo $RANDOM

[Code]....

There you can see that it is the same number. It does that every time!! Grrr. The strange thing is each time I manually type [or copy & paste] it into the terminal, it gives random [not static, like I am getting from my script] results.

The reason I want this is because I am making a script where this line will randomly go up or down [depending on if the random number is 1 or 0].

View 4 Replies


ADVERTISEMENT

General :: CLI Commands To Generate Random Result From Specified List?

Jul 20, 2011

List of 77 lines with the names of movies. For ease, let's say it's in a text file. What I want is a command line argument I can pass that'll read each line and pick one of those 77 lines at random, except I can't figure out how to do this. Is there a program I can just pipe the output of 'cat listofmovies.txt' to?

View 13 Replies View Related

General :: Generate Random List And Determine Size Of Arbitrary Block Of Files In Dir?

Mar 4, 2010

I want to generate a temporary random list from a directory of files and then determine the size of an arbitrary block of files from this list (say 1-25 or 26-50) and add their names to a file along with some other info for each name. I can generate a random list with file sizes like this: ls -l | sort -R | cut -d " " -f 6 but i'm not sure how to add up the sizes of just a certain block of these files and at the same time save the file names.

View 2 Replies View Related

General :: Use RANDOM Number In Procmailrc?

May 2, 2011

I want to generate random name for email file name to prevent overwriting but $RANDOM ENV VARs does not work in it what can I do? this is my procmailrc:

Quote:

SHELL=/bin/bash
SUBJECT=`formail -xSubject:`
FROM=`formail -xFrom:`
SUBJECT=`echo $SUBJECT | sed -e 's/ /-/g'`
FROM=`echo $FROM | sed -e 's/.*<//g' | sed -e 's/>//g' | sed -e 's/@/AT/g'`
STOREFILE=20`date +%y-%m-%d_%H-%M-%S`_${FROM}_${SUBJECT}_${RANDOM}${RAMDOM}

it works fine except ${RANDOM}${RAMDOM} and I do not want to use mktemp command .

View 8 Replies View Related

Software :: Generate Random Letters Only?

Aug 24, 2010

I have this: Code: dd if=/dev/urandom count=128 bs=1 2>&1 | md5 | cut -b-10 But I only want it to have letters and no numbers. What can I do for this?

View 13 Replies View Related

Programming :: Using /dev/random To Generate Double?

Mar 6, 2010

I need to generate random numbers using /dev/random in C. The numbers should be of type double (64-bit floating point).The functionality should be equal to linux command "od -An -N8 -t fD /dev/random", but written in C.The prototype should be "double drand(void);".

View 7 Replies View Related

Programming :: Script To Generate Random Dates?

Aug 3, 2010

A script to generate random dates. It uses the year range 2006-2009, and truncates every month of the year to an ordinary February's 28 days, but otherwise it's pretty solid and safe.

Code:
spate=1
while [ $spate -le 120 ]

[code]....

View 1 Replies View Related

Programming :: Get Random Number From -1 To 1 In C?

Mar 4, 2011

i want to generate random number in c programming from -1 to 1

View 1 Replies View Related

SUSE :: Initializing The Random Number Generator?

Jan 10, 2009

I just tried booting SUSE 11.0, but the system stops at the point it shows "initializing random number generator". I have left the system running at that point for almost 2 hrs, with no way to get past that. System isn't locked up. It has never done this before. How do I fix this?I have also tried failsafe booting, but it stops at the same spot also.

View 3 Replies View Related

Ubuntu Security :: Making A Hardware Random Number Generator

Apr 1, 2011

I'd like to somehow connect a serial port to a headphone jack, plug it into the geiger counter and literally dump random noise from the geiger counter into the entropy pool used by /dev/random

View 7 Replies View Related

Software :: When Type Mpd & To Bring Up Ring On A Single Nodethe Output Is A Random Number?

Mar 9, 2011

when we type mpd & to bring up ring on a single nodethe output is a random number,like this:>>mpd &>>[1] 5450anybody knows what is this resulting number?ps: i dont think its a port number because when i type >>mpd -eits prints out the port number mpd takes

View 1 Replies View Related

Programming :: Create File Listing In C++ That Will Generate Line Number On Every Line Of Code

Apr 11, 2010

I have a project due for my Intro to C++ class and we are suppose to generate a file listing that will take an input of a C++ source code with .cpp extension and make a copy of it with a .lst extention that will have a line number preceding each and every line.

View 12 Replies View Related

Ubuntu Networking :: Unable To Connect To A Small Number Of Random Websites: Otherwise Networking Is Fine

Dec 29, 2010

I was having no problems (that I knew of) browsing the web since installing Ubuntu 10.10 a week or so ago. I was previously trialling Win7 as my customers will likely be using that in the future. Then I wanted to go to internode.on.net. Got the following: Quote: Firefox can't establish a connection to the server at internode.on.net. or Quote: Oops! Google Chrome could not connect to internode.on.net

As it was just after Christmas I thought it must be down, for upgrades or maintenance etc. I later tried to go to Freebsd.org; same error. I've been having a small number of other websites give the same error. I thought nothing of this until I tried it on my wife's macpro. I could log onto all the websites I wanted to and none gave any indication of having been down. Both boxes are on the same adsl connection. I still can't access internode or freebsd on 10.10 yet have been able to access every website on OSX. Now, I was only looking at them for info but am worried I won't be able to access something important. (so far everything I 'need' is working)

ping just drops out. edit: weirdest thing! I just retried and now can not emulate the problem for internode. freebsd still won't show. that is less than five minutes between problems and resolution! I hadn't even posted! But I still would like to have an idea of what is going on. Here is the ping error for freebsd: Quote:

[Code]...

View 9 Replies View Related

General :: Unix Ps -l Priority Whoes One Number In Column "PRI" But In Same Time Ps -o Pri Shows Another Number?

May 21, 2011

Why does unix ps -l whows one number in column "PRI" but in same time ps -o pri shows another number? cpu and nice are zero for those processes

View 1 Replies View Related

Ubuntu Multimedia :: Copy Random Jpg From Random Folder

Jan 19, 2010

I'm looking for a script that copies a random .jpg from a random folder in my ~/Pictures folder to my ~/temp folder with a standard filename. This file will then be displayed in Conky. I can fix the last part, but I cannot find a way to do the first part.

View 3 Replies View Related

General :: How To Generate A Log In Syslog

Sep 7, 2010

I am configuring syslog-ng on my server.
I suspect something to be wrong.

Is there a tool I can use in the shell to generate a log? So I can check that the log appear in the syslog file.

View 3 Replies View Related

General :: Not Able To Generate Boot.log?

Feb 20, 2011

I m not able to find anything under boot.log file. Here is the output of boot.log files.

As you can see nothing is getting written inside the boot.log files .

How can i make all the events to be logged under boot.log file?

Code:
# ls -ltr /var/log | grep boot
-rw------- 1 root root 0 Jan 25 15:59 boot.log.4
-rw------- 1 root root 0 Feb 1 18:38 boot.log.3
-rw------- 1 root root 0 Feb 9 00:00 boot.log.2
-rw------- 1 root root 0 Feb 16 17:57 boot.log.1
-rw------- 1 root root 0 Feb 20 04:02 boot.log

View 11 Replies View Related

General :: How To Generate Report - Sa* And Sar* Files ?

May 29, 2011

I have collected the sa* and sar* files for the past two weeks , i need to generate the report for these files how can i do so i am using centos 5.5. assist me with a tool or a command to do the same.

View 6 Replies View Related

General :: Generate List Of All Available Man Pages On System?

Nov 5, 2010

How to generate a list of all available man pages on a system?

View 4 Replies View Related

General :: Generate A Public/private Key - UNIX

Nov 17, 2010

For using SSH, why does a host also need to have a public and private key? And how can I generate a public/private key pair for myself?

View 5 Replies View Related

General :: Generate Without Password Or To Provide Script

Jan 26, 2011

system debian php-4.x.x.src.deb. What actions should be performed that would build the binary deb with support memcache, mhash, and mcrypt? Assume that all the required packages of libraries installed on the system. system centos php-4.x.x.src.rpm. What actions should be performed that would build the binary rpm with support memcache, mhash, and mcrypt? Assume that all the required packages of libraries installed on the system. There is the software raid1 md0 Disc / dev / sda / dev / sdb. You must configure grub, that would have been able to boot from both drives. Assume that only one section ("/"). Generate for httpd ssl key and integrate into the system. to generate without a password or to provide a password script. Scan open ports and see what processes are installed network connections. What ports must be left open to normally closed firewall for full operation and setup http server (http, https)? Write a shell script that would produce an analysis of processes mysql and delete those that connection more than 5 minutes excluding system processes (eg replication), as well as sending mail warning in the log if an error occurs mysql string ABCDEFGH. Provide autostart at boot time (integration in init.d), protection against re-run, exception handling (when using lock files).

View 3 Replies View Related

General :: Generate VoIP Traffic For Wireless?

Mar 28, 2010

Recently a hav installed fedora and ns-2.34(after much effort).Now i want to generate VoIP traffic for wifi. give m url where i can find gud examples for generating VoIP traffic.

View 1 Replies View Related

General :: Generate Html Based On Directory Structure?

Jul 22, 2010

does any one knows a linux based program/script that can generate html files based on directory structure?

View 1 Replies View Related

General :: Mac OS To Generate Pdf From A Document Without Additional Software To Install

Jan 4, 2011

I have seen how simple it is for Mac OS to generate pdf from a document without additional software to install. But I am looking for this functionality in Linux. One scenario, for example, if I have myDocument.txt that contain an article, how can I convert this into pdf? My next question is, assuming that myDocument.txt is a 3-paged document, will it generate a 3-page continuous pdf and not just 3 separate pdfs?
Any tools for linux that does this? (GUI is fine, but commandline is preferable)

View 6 Replies View Related

General :: Security - Tool To Generate Memorable Passwords?

Jan 24, 2011

I'm looking for a tool, command line or GUI, for Linux that generates memorable passwords An equivalent of what I am looking for would be passwords that the Mac Os X keychain can generate, something like apples12$/fourteen. Something strong, but easily memorized by a user.

View 2 Replies View Related

General :: Manually Generate A Fake ACPI Lid Event From A Script?

Jul 4, 2010

I'm trying to make sure that my laptop will suspend if I unplug it after the lid is already closed, and I believe that one way to accomplish this would be to simulate an ACPI lid event when the power adapter is plugged or unplugged. In order to do this, I need to find a command that will generate a fake ACPI lid event. Is there any such command?

View 1 Replies View Related

General :: Generate Software License Key For System Based Applications?

Feb 11, 2011

My application is an integration of all the open source components with customized heavily including OS. I would need to know how to generate license keys for my application.
Does any one have any clue?

View 6 Replies View Related

General :: ./checksetup For Bugzilla3 On Debian 5.0 Generate Permission Denied?

Jan 18, 2011

When I attempt to run a ./checksetup.pl I am getting the following error message.

Creating /var/lib/bugzilla3/data/pdsphaseibugs/attachments directory... mkdir /var/lib/bugzilla3/data/pdsphaseibugs/attachments failed: Permission denied at /usr/share/perl5/Bugzilla/Install/Filesystem.pm line 385.

The script su to www-data and here is a copy of the directory the script is executed from :

fuidsg46:/usr/share/perl5/Bugzilla/Install# ls -la
total 276
drwxr-xr-x 2 root www-data 4096 2011-01-11 12:17 .
drwxr-xr-x 16 root root 4096 2011-01-11 12:17 ..

[Code]....

View 1 Replies View Related

General :: Generate 64bit Executable (utility) Using PPC Cross Compiler?

Sep 7, 2010

I need to generate 64-bit executable(utility) using PowerPC-linux cross compiler? i.e. Any options need to pass ppc-gcc other then "-m64". I have written a small test program on 64-bit server and generated 64-bit executable using gcc alone.

Ex:
#
file a.out
a.out: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped
#

Actually I want to generate a executable(using PowerPC-linux cross compiler),which will run on 64-bit machines. In my Makefile I am trying to use CC = XXXXX/powerpc-linux/bin/powerpc-linux-gcc -m64 to ppc-linux-gcc,but giving error.
error: -m64 not supported in this configuration
If I remove -m64 its generating 32-bit executable.

View 5 Replies View Related

General :: Write A Script To Generate A Bar Graph / Chart / Histogram?

Feb 9, 2011

write a script to generate a bar graph/chart/histogram etc that can make the analysis part simpler.

While dealing with so much data, i fear a manual approach could lead to human errors and hence thought that a script might be a better approach.

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved