How to have random jukebox music playing in an Arma 3 mission.

This script in the initPlayerLocal.sqf will play a continuous jukebox of music in your Arma 3 mission. This is just like in Warlords where you have continuous background music. _null = [] spawn { _musicPool = "getText (_x >> ‘name’) != ” && getNumber (_x >> ‘duration’) > 20" configClasses…

Read More

Very interesting shell scripting example.

This simple shell script will pick a random sentence from a text file. This is made up of multiple sentences from parts of the text file merged into one long sentence. words.sh1 2 3 4 5 #!/bin/sh   numwords=$(shuf -i 14-88 -n 1) words=$(shuf -n $numwords 122-0.txt | cut -d$”…

Read More

Very interesting and strange bash trick with ls.

This is a very interesting bash trick I found using ls. This runs the ls command with random parameters. This is not very useful, but interesting nonetheless. 4.4 Tue Mar 03 jason@Yog-Sothoth 0: $ ls -`cat /dev/urandom | tr -dc ‘hula’ | head –bytes 1`4.4 Tue Mar 03 jason@Yog-Sothoth 0:…

Read More

Very useful C program. Print a random fortune.

Here is one of my programs. I wrote this ages ago and it uses the standard ASCII character set. This will print a random fortune by running the fortune app to get a fortune and this selects a category to print from. #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h>…

Read More

how to generate long random numbers with the Linux command line.

This simple command prints out a long random number string from /dev/urandom. jason@Yog-Sothoth » img » $ tr -dc "[:digit:]" < /dev/urandom | head -c 64 ; echo 9958048462925775253231939134565711861924198983498274782350446110 Do it this way to remove the newline after the output. This would be good for use in a script. jason@Yog-Sothoth…

Read More

Get a randomly generated bash shell prompt and some other tricks for the Linux shell.

A nice shell prompt that is randomly generated each time it appears. Working version. PS1="\[\e[1;31m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]@\[\e[1;35m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]\$ "PS1="\[\e[1;31m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]@\[\e[1;35m\]$(shuf -n 1 /usr/share/dict/words)\[\e[m\]\$ " Select a random word from a textfile with bash. ubuntu ~ $ shuf -n 1 /usr/share/dict/words pluckedubuntu ~ $ shuf -n…

Read More

How to shuffle play a directory full of movies with mpv on Linux.

The mpv movie player can play a directory of movies randomly, this is useful if the user wants movies playing randomly in the background. Do it like this. mpv –shuffle /media/jason/Seagate\ Backup\ Plus\ Drive/Movies/**mpv –shuffle /media/jason/Seagate\ Backup\ Plus\ Drive/Movies/** This is the result, a randomly chosen movie from your collection….

Read More

How to spawn a randomly placed building in Arma 3.

This simple code for Arma 3 will spawn a randomly placed HQ building within the area of the mkr1 marker. This is a 4000×4000 marker placed on the map. This gets a random safe area and places the building within the area of this marker. _mrk = "mkr1"; _area =…

Read More

Install the fortune program on your Linux machine and have a nice fortune in your terminal.

To get useful Ubuntu server command line tips in your terminal, firstly install the fortune package and some more fortunes. ┌─[jason@darkstar]─[~] └──╼ $sudo apt install fortune fortunes-bofh-excuses fortunes-ubuntu-server┌─[jason@darkstar]─[~] └──╼ $sudo apt install fortune fortunes-bofh-excuses fortunes-ubuntu-server Now run the command to print a random Ubuntu server tip. ┌─[jason@darkstar]─[~] └──╼ $fortune ubuntu-server-tips…

Read More

Random Linux commands.

Fetch information about a random Linux command. curl -sL commandlinefu.com/commands/random/plaintext | sed ‘3,4!d’curl -sL commandlinefu.com/commands/random/plaintext | sed ‘3,4!d’ Here is an example. ┌─[jason@neo]─[~] └──╼ $curl -sL commandlinefu.com/commands/random/plaintext | sed ‘3,4!d’ # An easter egg built into python to give you the Zen of Python echo "import this" | python┌─[jason@neo]─[~] └──╼…

Read More

A simple random number routine in C.

This is a simple random number example in C. This will print a random number from 1 – 64. #include <stdio.h> #include <stdlib.h>   int main (void) {   srand(time(NULL)); int r = rand() % 64;   printf("Random INT: %i\n", r);   return 0; }#include <stdio.h> #include <stdlib.h> int main…

Read More

My PHP code for my Linux pages index.

This code is on my https://securitronlinux.com/linux/ page. It shows a random image and a random webpage link. <?php $time = strftime(“%A %d %B %Y. %r – %Z”); srand(time(NULL)); $day = rand() % 6; $string = sprintf(“<font size=\”2pt\”><p>Welcome to my website.</p>\n”); $links = array(“BejArray” => array(“0” => “perl_code.php”, “1” => “psx_doom.php”,…

Read More