BASH: Irish Weather


function weather2morrow() 
{ 
   echo "Weather forecast for"\
        "$(date +%A,\ %d\ %B\ %Y --date=tomorrow):"\
        "Sunny spells & scattered showers 🌦 " 
}

Bonus content from: June, 2012


A "good Summer" means high humidity...

Bonus content from: June, 2009


iGoogle weather widget showing forecast...

The United States May Drop Kim Kardashian's Ass On Iran

Image shows Kim Kardashian in jeans, white t-shirts, and red high-heel shoes, falling towards Iran, after being dropped from a B-2 stealth bomber

America is currently spending tens of millions of dollars on developing a bomb that is capable of penetrating and destroying Iranian nuclear facilities deep within the country's mountain ranges¹.

A nuclear strike would of course be more than enough to do the job, but even unscrupulous America would be incapable of delivering such a ironic plan as to use nuclear warfare to stop a hypothesised nuclear war, so they set Lockheed Martin and AFRL the task of developing a large conventional bomb to do the task.

Now a new radical new idea has sprung forth from the crazy minds of US' military R&D*: they plan to turn Kim Kardashian's buttocks into a Massive Ordnance Penetrator (MOP).

Close-up of Kim Kardashian squatting in white dress. The dress is covered in U.S. air-force insignia, including American flag and seal, and phrases: '50 Megatons' and 'God bless America'

The military scientists believe that due to the size and consistency of the celebrities rear (denser than Plutonium), a drop from above the stratosphere would result in a 50 megaton explosion and an impact crater 2 miles in diameter. Tests are currently being run to see if there is a risk of nuclear fallout being released from the "KD" (Kardashian Device). They say there is a small chance of a toxic release on the way down.

Mahmoud Ahmadinejad in sunglasses pointing at camera with 'Drop dat ass' written below it
Iranian president, محمود احمدی‌نژاد (Mahmoud Ahmadinejad), gave a chilling reply to the news of America's development of this new biological weapon. Apparently goading the United States' into war, he is on the record as saying: "Do it! Drop dat ass".

¹https://www.wsj.com/articles/SB10001424052970203363504577187420287098692
²Rear-search and Development

content originally published: June, 2012

MacMillan's "The Rite of Spring" + Magma - 'Slag Tanz'.


Music: Magma - 'Slag Tanz'. Dance: MacMillan's "Rite of Spring" - English National Ballet (2012). Principal: Erina Takahashi.



source video: https://www.youtube.com/watch?v=GEOi4ZzUud4

BASH: Glitch images using sed



Once an image is converted to text (via ImageMagick) any form of text manipulation can be used (not just sed) to create different results. The process is slow however, and should be seen as a novelty rather than a legitimate alternative to pixel-array manipulation in a different programming environment.

# Use ImageMagick to convert image to text file
convert merkel.jpg merkel.txt

# sed replaces every occurrence of $i value with '0' (except in first line)
for (( i=0; i<255; i++))
{ 
   sed '1! s,'"$i"',0,g' < merkel.txt \
   | convert - "merkel_$i.png"
}
Animated effects can also be interesting...

BASH: Watch 5 QVC YouTube live-streams at once, using MPV


For no other reason than "just because". The Bash script is generic enough to be used in other scenarios. Most work is done by MPV and its '--ytdl-format' option. A small delay is added before each mpv call, to avoid swamping YouTube with concurrent video requests.

#!/bin/bash

# Stream 5 QVC YouTube live-streams simultaneously.
# - Requires 'mpv' - N.B. Kills all running instances of mpv when exiting.
# - See YouTube format codes, for video quality, below.
# ver. 2017.02.11.21.46.52

### YOUTUBE VIDEO IDS ##########################################################

# QVC ...... USA .......... UK ........ Italy ....... Japan ...... France
videos=('2oG7ZbZnTcA' '8pHCfXXZlts' '-9RIKfrDP2E' 'wMo3F5IouNs' 'uUwo_p57g5c')

### FUNCTIONS ##################################################################

function finish() # Kill all mpv players when exiting
{
  killall mpv
}
trap finish EXIT

function playVideo() # Takes YouTube video ID
{
   sleep "$2" # The "be nice" delay
   mpv --quiet --ytdl-format 91 https://www.youtube.com/watch?v="$1" 
}

### BEGIN ######################################################################

for ytid in "${videos[@]}"; do ((x+=2)); (playVideo "$ytid" "$x" &); done
read -p "Press Enter key to exit"$'\n' # Hold before exiting
#zenity --warning --text="End it all?" --icon-name="" # Zenity hold alternative
exit

### FORMAT CODES ###############################################################

# format code  extension  resolution note
# 91           mp4        144p       HLS , h264, aac  @ 48k
# 92           mp4        240p       HLS , h264, aac  @ 48k
# 93           mp4        360p       HLS , h264, aac  @128k
# 94           mp4        480p       HLS , h264, aac  @128k
# 95           mp4        720p       HLS , h264, aac  @256k
# 96           mp4        1080p      HLS , h264, aac  @256k