
{"id":16654,"date":"2017-04-21T15:11:29","date_gmt":"2017-04-21T15:11:29","guid":{"rendered":"http:\/\/www.beautifulwork.org\/?p=16654"},"modified":"2017-04-21T15:11:29","modified_gmt":"2017-04-21T15:11:29","slug":"sources-of-random-data","status":"publish","type":"post","link":"https:\/\/www.trueangle.org\/index.php\/2017\/04\/21\/sources-of-random-data\/","title":{"rendered":"GNU coreutils: Sources of random data"},"content":{"rendered":"<p>script file contents<\/p>\n<pre>\n#!\/bin\/bash\n\nget_seeded_random()\n{\n    seed=\"$1\"\n    echo $seed\n    openssl enc -aes-256-ctr -pass pass:\"$seed\" -nosalt \\\n\t    \/dev\/null\n}\n\nshuf -i1-100 --random-source=&lt;(get_seeded_random 45)\n<\/pre>\n<p>using \/dev\/urandom <\/p>\n<pre>\n$sudo shuf -i1-5 --random-source=\/dev\/urandom\n1\n2\n4\n3\n5\n$sudo shuf -i1-5 --random-source=\/dev\/urandom\n3\n4\n5\n1\n2\n$sudo shuf -i1-5 --random-source=\/dev\/urandom\n4\n5\n2\n1\n3\n$sudo shuf -i1-5 --random-source=\/dev\/urandom\n4\n2\n3\n1\n5\n$sudo shuf  --random-source=\/dev\/urandom\n^C\n$sudo shuf -i1-10 --random-source=\/dev\/urandom\n2\n4\n6\n10\n7\n8\n5\n3\n1\n9\n$sudo shuf -i1-10 --random-source=\/dev\/urandom\n6\n2\n10\n3\n5\n8\n7\n9\n4\n1\n$sudo shuf -i1-10 \n5\n4\n10\n8\n9\n6\n7\n1\n2\n3\n$sudo shuf \nqq\n\n\nqq\n$sudo shuf -i1-100 --random-source=\/dev\/urandom\n65\n51\n62\n79\n41\n35\n26\n36\n52\n77\n54\n82\n48\n99\n75\n17\n39\n31\n1\n7\n88\n61\n9\n94\n73\n70\n63\n55\n44\n38\n23\n84\n15\n25\n53\n85\n66\n16\n20\n69\n81\n32\n98\n45\n96\n49\n74\n10\n4\n59\n93\n40\n12\n13\n50\n100\n14\n90\n6\n68\n8\n57\n5\n34\n60\n67\n80\n3\n2\n78\n18\n76\n21\n92\n33\n56\n24\n37\n87\n83\n47\n29\n97\n46\n89\n43\n91\n27\n11\n58\n64\n19\n28\n86\n95\n72\n30\n22\n71\n42\n$sudo shuf -i1-100 --random-source=\/dev\/random\n8\n79\n40\n19\n62\n27\n90\n71\n9\n93\n32\n85\n21\n3\n26\n31\n63\n18\n99\n2\n78\n11\n100\n49\n75\n64\n37\n13\n39\n30\n29\n73\n82\n34\n55\n14\n35\n80\n84\n33\n67\n98\n92\n25\n87\n51\n41\n88\n10\n4\n97\n45\n53\n68\n16\n15\n47\n46\n42\n36\n54\n94\n70\n28\n61\n83\n58\n96\n69\n91\n59\n1\n72\n38\n5\n23\n60\n12\n74\n44\n7\n52\n48\n86\n43\n95\n20\n65\n50\n24\n76\n22\n6\n66\n81\n89\n56\n77\n17\n57\n$sudo shuf -i1-100 --random-source=\/dev\/null\nshuf: \u2018\/dev\/null\u2019: end of file\n$sudo shuf -i1-100 --random-source=\/dev\/zero\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20\n21\n22\n23\n24\n25\n26\n27\n28\n29\n30\n31\n32\n33\n34\n35\n36\n37\n38\n39\n40\n41\n42\n43\n44\n45\n46\n47\n48\n49\n50\n51\n52\n53\n54\n55\n56\n57\n58\n59\n60\n61\n62\n63\n64\n65\n66\n67\n68\n69\n70\n71\n72\n73\n74\n75\n76\n77\n78\n79\n80\n81\n82\n83\n84\n85\n86\n87\n88\n89\n90\n91\n92\n93\n94\n95\n96\n97\n98\n99\n100\n$\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>script file contents #!\/bin\/bash get_seeded_random() { seed=&#8221;$1&#8243; echo $seed openssl enc -aes-256-ctr -pass pass:&#8221;$seed&#8221; -nosalt \\ \/dev\/null } shuf -i1-100 &#8211;random-source=&lt;(get_seeded_random 45) using \/dev\/urandom $sudo shuf -i1-5 &#8211;random-source=\/dev\/urandom 1 2 4 3 5 $sudo shuf -i1-5 &#8211;random-source=\/dev\/urandom 3 4 5 1 2 $sudo shuf -i1-5 &#8211;random-source=\/dev\/urandom 4 5 2 1 3 $sudo shuf -i1-5 &#8211;random-source=\/dev\/urandom &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.trueangle.org\/index.php\/2017\/04\/21\/sources-of-random-data\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;GNU coreutils: Sources of random data&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[83],"tags":[1343],"_links":{"self":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16654"}],"collection":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/comments?post=16654"}],"version-history":[{"count":0,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/posts\/16654\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/media?parent=16654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/categories?post=16654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.trueangle.org\/index.php\/wp-json\/wp\/v2\/tags?post=16654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}