Skip to main content

Questions tagged [random]

UNIX random devices and utilities

Filter by
Sorted by
Tagged with
3 votes
4 answers
1k views

Rename files to random filenames (but not to checksums)

Sometimes I need to batch rename files on a macOS system to random or pseudo-random filenames, eight lowercase letters and digits only, e.g. from mcmurdo-station.png to something like a12bc0xy.png. ...
jsx97's user avatar
  • 71
1 vote
0 answers
48 views

AM335X setting of RNG

I kindly request any advice regarding the configuration of the HW RNG of TI AM335X. I'm aiming to achieve security certification for our device, which is based on the PLC Wago PFC200 750-8217. One of ...
bpob's user avatar
  • 11
-3 votes
1 answer
168 views

What happens if you put /dev/urandom into a shell script and run it?

I want to know what happens when you run the contents of /dev/urandom as a shell script. I know when you cat it into a terminal it will set off a bunch of random things in the terminal environment. ...
AcinonX's user avatar
  • 111
-1 votes
3 answers
59 views

Why ubuntu 18 not booting inder vmware?

Image imported from AZURE and converted to VMWARE. Booting stop after few seconds. Can't understanding why... Very long loading "random:" and no loading more.
Eugene Kononenko's user avatar
3 votes
1 answer
321 views

CSPRNG use on Amazon Linux 2

I need to use a cryptographically strong (certification requirement), which is of high quality (pass industry standard randomness tests) reasonably performant (see below) PRNG. Originally, I assumed ...
Alex O's user avatar
  • 133
0 votes
1 answer
29 views

Would it be feasible to create a script that can right click the mouse at a very specific location when an even more specific number gets generated?

I'm aware of a program that can simulate a right-click at specific coordinates on my display at any given interval. However, I'm wondering if it's possible to write a script that can perform a right-...
Ryan's user avatar
  • 1
-1 votes
1 answer
158 views

How to force =RAND() to run only once in LibreOffice Calc?

I am trying to randomize a list of words in LibreOffice Calc. Column A contains numbers 1 to 15, indicating the initial order of the words. Column B contains the words themselves. Here is the original ...
wvz93427's user avatar
3 votes
2 answers
1k views

Faster wipe hdd with random data

I know that with dd if=/dev/urandom of=/dev/sdX bs=1M count=hdd_size_in_MB you can wipe a whole disk with random data. But urandom is very slow. So I wonder if it would be possible to just create ...
user3776738's user avatar
0 votes
0 answers
268 views

Fast, cryptographically strong PRNG using /dev/urandom

Edit to make the question more specific: Can a program just read from /dev/urandom to provide high quality, cryptographically strong random numbers at a rate of at least 1MB/sec on a Ubuntu LTS VM in ...
Alex O's user avatar
  • 133
1 vote
1 answer
1k views

How to generate random master password?

I want to generate a secure random password for the encrypted Linux system. What offline tools should I use? Any advice if I should use xkcdpass, apg, diceware, or another utility, and how built ...
whiteman808's user avatar
0 votes
1 answer
765 views

Setting up rngd (randomness generator) on old computers

The rngd program comes from package rng-tools5 on Ubuntu/Debian. # neofetch ...-:::::-... root@dell-7577 .-MMMMMMMMMMMMMMM-. -------------- ...
Vlastimil Burián's user avatar
0 votes
0 answers
581 views

understanding fio test results - 90th percentiles benchmark - Latency --> avg/stdev?

What are the relationships in storage benchmarking with fio between the average(avg) and standard deviation (stdev) at latency? Avg / stdev at latency is important for sequential or random test? Most ...
Hamza Karabulut's user avatar
3 votes
2 answers
346 views

reinitialize random to be reinitialized

Printing the $RANDOM variable in zsh is giving me the same result if I don't use it in another context. It's like the shell has a cache of command outputs or variable values so I can't have the new ...
aaa's user avatar
  • 167
0 votes
1 answer
970 views

random string (variable) generator based on user input

i need to get a script, which will ask user to input a number (from 1 to ....... lets say 100, does not matter), and then based on number entered generate n random strings (aplphanumeric nevermind), ...
qqqqq's user avatar
  • 3
0 votes
2 answers
152 views

bash alias to randomly run a command among many

I need help figuring out how to run a bash alias or function that randomly chooses another command or alias and runs it. the list of commands and aliases and function aliases is known beforehand. the ...
stacking and exchanging woohoo's user avatar
1 vote
0 answers
150 views

Do we still need the haveged daemon with versions of linux after 5.10.119?

Per kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256 Linux locks the value of /proc/sys/kernel/random/entropy_avail to 256. Do we still need haveged?
Archimedes Trajano's user avatar
1 vote
2 answers
378 views

Random freezes, pointer moves, no response to clicks

Why is my laptop freezing? Screen randomly freezes, I can move pointer but no response to clicking. Cannot alt-tab through windows. This happens in firefox and chromium. Ran memtester, all ok. Set FF ...
QRP's user avatar
  • 31
2 votes
2 answers
3k views

Fastest way to write bash variable to a file

I want to generate some big files for some experiment. This is my script. It creates a file then reads it to a variable and then tries to write it as many times defined in the loop in files: #! /usr/...
DEKKER's user avatar
  • 968
4 votes
1 answer
323 views

How Does Linux Generate Random Numbers on Startup

I am currently taking an OS class using XINU, where I am able to control every process running on the OS, and because of this, I can completely predict the output of its random number generator. Here ...
Byte11's user avatar
  • 205
-1 votes
1 answer
208 views

Why is my file with 10 random bytes larger than 10 bytes?

So I have generated a random string of 10 bytes using the command openssl rand -hex 10 > result. My question is why does the resulting file have a size of 21 bytes? I haven't encrypted so I am not ...
Kobby's user avatar
  • 17
2 votes
1 answer
45 views

What is the name of fortuna's kernel process in FreeBSD?

Historically yarrow algorithm had a kernel process with the name of yarrow. But after replacing it with Fortuna, the kernel process disappears. What is the name of the new kernel process of Fortuna's ...
spmzt's user avatar
  • 39
0 votes
1 answer
321 views

How to avoid duplicate random number generation?

TL;DR: A program draws the same random seed when started twice simultaneously. How did it happen? Details I'm running an MCMC statistical analysis, so I execute the program (phylobayes) twice to get 2 ...
PlasmaBinturong's user avatar
0 votes
1 answer
976 views

Selecting n random files from one directory and copying them to another folder + other files with same same, but different filetype

I have two directories, lets call them X and Y Within them I have 100k+ files, .jpg files in X and .txt files in Y I want to randomly select N files from X and copy to folder Z This should be ...
Martin Pedersen's user avatar
0 votes
1 answer
173 views

Why does cat randomFile.txt mess up with my terminal? [duplicate]

I am simply generating a pseudo-random content file with. dd if=/dev/urandom bs=1M count=1 of=./filetone.txt To then cat it cat ./fileone.txt The issue is that upon completing with this command it ...
freddie_ventura's user avatar
1 vote
3 answers
140 views

Different $RANDOM results in sed when reading lines in multiple files

I'm trying to run a command that will read multiple files in a directory, look at each line of each file, and whenever it reads a specific string ("gene_height") on any line it replaces 2 ...
the_pocket_of_big_noob's user avatar
2 votes
1 answer
456 views

Different behavior of RANDOM and URANDOM on Rpi Buster

System is: pi@titania:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 10 (buster)" NAME="Raspbian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" ...
3john's user avatar
  • 29
23 votes
2 answers
9k views

kernel 5.10.119 caused the values of /proc/sys/kernel/random/entropy_avail and poolsize to be 256

After update to kernel 5.10.119, /proc/sys/kernel/random/entropy_avail became stuck to 256 and does not change when moving the mouse. It used to be greater than 3000. # cat /proc/sys/kernel/random/...
user528206's user avatar
1 vote
1 answer
317 views

Won't the new nonblocking architecture for /dev/random make it less secure?

If entropy is not accounted for, and the pool doesn't block even if insufficient entropy has been supplied, isn't it potentially insecure?
2080's user avatar
  • 121
21 votes
3 answers
5k views

How can I force /dev/random to block?

For a class on cryptography, I am trying to drain the entropy pool in Linux (e.g. make /proc/sys/kernel/random/entropy_avail go to 0 and block a command reading from /dev/random) but I can't make it ...
John Phillips's user avatar
0 votes
1 answer
2k views

Random float sleep in bash script?

I need randomized pauses in my script between two numbers smaller than 1 second in my script. The following used to work: #! /bin/bash sleep $(python -c "import random;print random.uniform(.2,.8)&...
John's user avatar
  • 3
-1 votes
1 answer
642 views

Pick random line from a compressed text file with zcat/gz or altnernatives

I have a simple bash script that picks a random line from a text file. This is originally done with shuf file.txt | head -1 (the same result can be achieved with cat file.txt | shuf | head -1). I also ...
lisa-thehexbit's user avatar
-2 votes
2 answers
190 views

bash error syntax random number [closed]

My assignement is to show a random number (od -vAn -N4 -tu4 < /dev/urandom) between two numbers in read. I don't understand why there are syntax error when I check the min value exception and with ...
Nicolas Pellerin's user avatar
4 votes
3 answers
982 views

Random number output between two ranges linked together

This question is about generating random numbers between a range, which is fine, but it doesn't fit my case. I'll explain in SQL terms because it seems to me that's easier to understand, though the ...
schrodingerscatcuriosity's user avatar
0 votes
3 answers
280 views

How to create a random complex password in SuSe 12

I need a way to generate a random password following this requirements: Password at least 9 characters at least 2 capital letters at least 2 small letters at least 2 digits at least 2 special ...
Chris Sandoval Hidalgo's user avatar
8 votes
2 answers
5k views

syslog message at boot: uninitialized urandom read

CPU is AMD GX-412TC SOC: GX-412TC GE412TIYJ44JB 4 6W 2MB 1.0GHz/ 1.4GHz N/A N/A DDR-1333 0-90°C which does not have rdrand: grep rdrand /proc/cpuinfo # nothing I see following messages in my syslog ...
Martin Vegter's user avatar
0 votes
0 answers
62 views

How to intentionally minimize the system entropy

My question might seem counter-intuitive at first, as most of the time people want to do the opposite (i.e., increase entropy). I have a few USB devices that act as random number generators -- namely, ...
Proto Ukr's user avatar
  • 151
0 votes
0 answers
240 views

Reading an infinite data in Python and feeding to another external process

I am using Python to read data from a TRNG (true random number generator) device, and I want to feed this data to an external utility (e.g., dieharder). The data itself is an indefinite stream, but ...
Proto Ukr's user avatar
  • 151
2 votes
2 answers
2k views

How to configure RANDOM for getting the same 32 bit range of random numbers, like by using SRANDOM?

Environment: Debian Bash What is known: RANDOM gives a random number in a range of 15 bits by the following: echo $RANDOM SRANDOM gives a random number in a range of 32 bits by the following: echo $...
Alfred.37's user avatar
  • 138
0 votes
2 answers
1k views

Putting the contents of /dev/urandom into a variable?

This is a follow on from my previous thread :- Passing date command into a variable? Ok so effectively I would like /dev/urandom to generate 4 digits for me. And place them into a variable. Here is an ...
Shanzem's user avatar
  • 25
3 votes
2 answers
819 views

What if I have a bad (static, low entropy) random-seed in systemd?

On embedded systems, read-only filesystems are common. Read-only means that /var/lib/systemd/random-seed cannot be updated on reboot, and is probably a clone of another device's random-seed. Does this ...
Josh Vander Hook's user avatar
3 votes
3 answers
2k views

Create Numbers 1-6 in random order using AWK

I'm using AWK to generate values between 1 - 6 which need to come out in random order. I have managed to sort out the logic for the creation of the right range of numbers but am struggling with ...
Jonathan B's user avatar
-4 votes
2 answers
400 views

random output from input

Related question : how to create a random output from users input I was thinking to take an input(only one argument) from user just like Hello. And, I want to give output like olleho llohe he llo lo ...
user avatar
0 votes
1 answer
229 views

Why is counting repeated numbers from /dev/urandom the same on every system?

This command, which generates numbers from /dev/urandom and prints how many repeated numbers there are, returns the same on every system. Why? dd if=/dev/urandom count=1 bs=5M 2> /dev/null | od - | ...
lolsu's user avatar
  • 3
-1 votes
1 answer
909 views

Replacing numbers in a text file in each iteration with random values

I have a text file with the following content: number of apples 7 I would like to run the shell script and modify the number with random values for say 5 iterations. So I need my output to look like ...
Ritam Chatterjee's user avatar
2 votes
3 answers
2k views

How to generate a comma separated list of random ints

I am trying to generate a comma separated unordered list of ints between 1 and 10, I have tried the following but it results in an ordered list: seq -s "," 10 | shuf
spudger's user avatar
  • 23
11 votes
2 answers
4k views

/dev/random EXTREMELY slow in Ubuntu for Windows 10 (WSL)

I am using Ubuntu 20.04 for Windows 10 (WSL2) on a Haswell laptop and I am getting about 0.6 bytes per second. As in 6 bytes total after 10 seconds of waiting. This is unacceptable. What is the ...
Chris_F's user avatar
  • 248
1 vote
1 answer
290 views

why reading from `/dev/random` put `1;2c` character behind the cursor? [duplicate]

when I run command dd if=/dev/random count=1 bs=32 I get some random junk binary data but after receiving them, there is still some characters (as I see always 1;2c) after termination of dd process. [...
Amir reza Riahi's user avatar
0 votes
1 answer
72 views

Seed executables randomization outside of code

We have put in place a features test framework which consists in running our code against some third partie`s pre-existing software. We do so periodically and compare the results with expected results ...
arennuit's user avatar
  • 101
0 votes
2 answers
388 views

How to sample without replacement from a script that randomly extracts 200characters using shuf?

I have this script that extracts 200 random characters from a set: #!/usr/bin/bash n=$(stat -c "%s" newfile.txt) r=$(shuf -i1-"$((n-200+1))" -n1) < newfile.txt tail -c+"$r&...
GSQ's user avatar
  • 37
0 votes
0 answers
78 views

Could a new AMD processor be limiting dd write speed when using /dev/urandom as the input?

I have recently bought a new computer that uses a pretty recent AMD Athlon chip. When using it for low-level formatting with dd, I noticed that setting if=/dev/zero allows it to write to the disk at ...
user942937's user avatar

1
2 3 4 5