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 (configFile >> "CfgMusic"); _poolSize = … Read more

Very nice C code to generate a random string. And some other useful info.

This code generates a random string when run, this could be quite useful. Print some very useful Linux system information using C. These two C programming samples should be quite useful to any programmer on Linux. Print a random fortune from an array. This program prints a random fortune from an array. This is a … 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> #include <string.h> const char* x[] … 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 » img » $ tr … 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 1 /usr/share/dict/words plucked Select a … 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. This is how to do … 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 If you want to download … 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]─[~] └──╼ $curl -sL commandlinefu.com/commands/random/plaintext | sed … Read more

C code that will select a random word from an array and include it in a string.

This code will pick a random word from the x[] array and include it in the printed string. This program will also get your current Linux username to customize the output. I am sure this code would be very useful to someone who wants to know how to handle arrays in C. #include <stdio.h> #include … 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”, “2” => “cgi_code.php”, “3” => … Read more