chitchat

———-

With all the money spent on fireworks, it hurts to think school budgets will not be fulfilled. An education that would put a twinkle in the eye of a child for a lifetime is replaced by a twinkle in the sky that only last a moment so a few people can have a visual orgasm.

I smelled something like an electrical burn. Thought it might be the UPS, but it was just the router. Need to get a replacement.

————————————————-

Under construction.

Have you ever wanted to ssh to your Linux box that sits behind NAT? Now you can with reverse SSH tunneling. This document will show you step by step how to set up reverse SSH tunneling. The reverse SSH tunneling should work fine with Unix like systems. Let’s assume that Destination’s IP is 192.168.20.55 (Linux box that you want to access). You want to access from Linux client with IP 138.47.99.99.
Destination (192.168.20.55) <- |NAT| <- Source (138.47.99.99)

1. SSH from the destination to the source (with public ip) using command below:

ssh -R 19999:localhost:22 sourceuser@138.47.99.99

* port 19999 can be any unused port.

2. Now you can SSH from source to destination through SSH tuneling:

ssh localhost -p 19999

————————————————-
Screenfetch is a simple bash shell fill that will give you some basic information about your system.

The install:

Install screenfetch on linux

Get prerequisites:

sudo apt-get install lsb-release scrot

Now that we have the dependencies installed, we can install screenFetch. Unfortunately, it’s not in the distro repositories for Ubuntu, Mint, or Debian, so we’ll have to download it from the project’s Git repository. First I’ll create a temporary directory for the download.

$ mkdir ~/screenfetch
$ cd ~/screenfetch

Now we can download the latest package. As of this writing, the latest version is v3.2.2.

Now, make the file executable with:

$ chmod +x screenfetch

You can execute it from here if you want with:

$ ./screenfetch

However, I think it’s better to have it installed somewhere where it will be available system wide. I think /usr/local/bin is a good location. So let’s copy it over to there.

$ sudo cp screenfetch /usr/local/bin

Now, assuming /usr/local/bin is in your $PATH, you should be able to run screenfetch from anywhere.

————————————————-

If you have access to MSWindows machines (XP, 7, or 8), you can build an MSWindows tablet for under $50 dollars. Purchase a cheap Android tablet for under fifty dollars and the add a free rdp (remote desktop) app from the app store and you have an instant windows desktop. Just connect to your mswindows box.  If you do not have access to mswindows systems then get a cheap system for a few hundred dollars. Still cheaper than the tablet per se. You come out ahead.

————————————————-

Flag maker script.

 

&nbsp;#!/bin/bash

#
# memorial.sh -
#
# 2009 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -en "&nbsp;&nbsp; (_)\n&nbsp;&nbsp;&nbsp; &lt;___&gt;\n&nbsp;&nbsp;&nbsp;&nbsp; | |______\n&nbsp;&nbsp;&nbsp;&nbsp; | |* * * )\n&nbsp;&nbsp;&nbsp;&nbsp; | | * * (_________\n&nbsp;&nbsp;&nbsp;&nbsp; | |* * * |* *|####)\n&nbsp;&nbsp;&nbsp;&nbsp; | | * * *| * |&nbsp;&nbsp; (________________\n&nbsp;&nbsp;&nbsp;&nbsp; | |* * * |* *|####|##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | | * * *| * |&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\n&nbsp;&nbsp;&nbsp;&nbsp; | |* * * |* *|####|##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | |~~~~~~| * |&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\n&nbsp;&nbsp;&nbsp;&nbsp; | |######|* *|####|##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |~~~'&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\n&nbsp;&nbsp;&nbsp;&nbsp; | |######|########|##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\n&nbsp;&nbsp;&nbsp;&nbsp; | |######|########|##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | |~~~~~~|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\n&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |########|##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '~~~~~~~~|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |\n&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |##############|\n&nbsp;&nbsp;&nbsp;&nbsp; | |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; '~~~~~~~~~~~~~~~\n&nbsp;&nbsp;&nbsp;&nbsp; | |\n&nbsp;&nbsp;&nbsp;&nbsp; | |\n&nbsp;&nbsp;&nbsp;&nbsp; | |\n"

Fireworks script

fireworks.sh

#!/bin/bash

rows=$(tput lines)
cols=$(tput cols)
colors=(red green blue purple cyan yellow brown)
lock_file=
lock_file_base=/tmp/$(basename $0 .sh)

multiple=0
if [[ "$1" ]]; then
&nbsp;&nbsp;&nbsp; nsingle=$1
&nbsp;&nbsp;&nbsp; shift
else
&nbsp;&nbsp;&nbsp; nsingle=10
fi
if [[ "$1" ]]; then
&nbsp;&nbsp;&nbsp; nmultiple=$1
&nbsp;&nbsp;&nbsp; shift
&nbsp;&nbsp;&nbsp; if [[ $nmultiple -gt 8 ]]; then nmultiple=8; fi
else
&nbsp;&nbsp;&nbsp; nmultiple=6
fi

function colorstr()
{
&nbsp;&nbsp;&nbsp; local&nbsp; row=$1
&nbsp;&nbsp;&nbsp; local&nbsp; col=$2
&nbsp;&nbsp;&nbsp; local&nbsp; color=$3
&nbsp;&nbsp;&nbsp; local&nbsp; v
&nbsp;&nbsp;&nbsp; case "$color" in
&nbsp;&nbsp;&nbsp; red)&nbsp;&nbsp;&nbsp;&nbsp; v=31;;
&nbsp;&nbsp;&nbsp; green)&nbsp;&nbsp; v=34;;
&nbsp;&nbsp;&nbsp; blue)&nbsp;&nbsp;&nbsp; v=32;;
&nbsp;&nbsp;&nbsp; purple)&nbsp; v=35;;
&nbsp;&nbsp;&nbsp; cyan)&nbsp;&nbsp;&nbsp; v=36;;
&nbsp;&nbsp;&nbsp; yellow)&nbsp; v=33;;
&nbsp;&nbsp;&nbsp; brown)&nbsp;&nbsp; v=33;;
&nbsp;&nbsp;&nbsp; white)&nbsp;&nbsp; v=37;;
&nbsp;&nbsp;&nbsp; *)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; v=;;
&nbsp;&nbsp;&nbsp; esac
&nbsp;&nbsp;&nbsp; shift 3

&nbsp;&nbsp;&nbsp; if [[ $multiple -ne 0 ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch $lock_file
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while [[ $(ls $lock_file_base.* 2&gt;/dev/null | head -n 1) != $lock_file ]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 0.05
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done
&nbsp;&nbsp;&nbsp; fi
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp; tput cup $row $col
&nbsp;&nbsp;&nbsp; echo -n -e "\e["$v"m"
&nbsp;&nbsp;&nbsp; set -f
&nbsp;&nbsp;&nbsp; echo -n $*
&nbsp;&nbsp;&nbsp; set +f
&nbsp;&nbsp;&nbsp; if [[ $multiple -ne 0 ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm -f $lock_file
&nbsp;&nbsp;&nbsp; fi
}

function center_colorstr()
{
&nbsp;&nbsp;&nbsp; local&nbsp; row=$1
&nbsp;&nbsp;&nbsp; local&nbsp; color=$2
&nbsp;&nbsp;&nbsp; shift 2
&nbsp;&nbsp;&nbsp; local&nbsp; s="$*"
&nbsp;&nbsp;&nbsp; local&nbsp; slen=${#s}
&nbsp;&nbsp;&nbsp; colorstr $row $(((cols / 2) - (slen / 2))) $color "$s"
}
&nbsp;&nbsp;
function fireworks()
{
&nbsp;&nbsp;&nbsp; local row=$((rows - 1))
&nbsp;&nbsp;&nbsp; local col=$(((RANDOM % (cols / 2)) + (cols / 4)))
&nbsp;&nbsp;&nbsp; local height=$((RANDOM % rows - 2))
&nbsp;&nbsp;&nbsp; local slant
&nbsp;&nbsp;&nbsp; local h
&nbsp;&nbsp;&nbsp; local color1=${colors[$((RANDOM % ${#colors[*]}))]}
&nbsp;&nbsp;&nbsp; local color2=${colors[$((RANDOM % ${#colors[*]}))]}
&nbsp;&nbsp;&nbsp; local color3=${colors[$((RANDOM % ${#colors[*]}))]}
&nbsp;&nbsp;&nbsp; while [[ $color1 == $color2&nbsp; ||&nbsp; $color1 == $color3&nbsp; ||&nbsp; $color2 == $color3 ]]
&nbsp;&nbsp;&nbsp; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; color2=${colors[$((RANDOM % ${#colors[*]}))]}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; color3=${colors[$((RANDOM % ${#colors[*]}))]}
&nbsp;&nbsp;&nbsp; done

&nbsp;&nbsp;&nbsp; case $((RANDOM % 4)) in
&nbsp;&nbsp;&nbsp; 0) slant=-2;;
&nbsp;&nbsp;&nbsp; 1) slant=-1;;
&nbsp;&nbsp;&nbsp; 2) slant=1;;
&nbsp;&nbsp;&nbsp; 3) slant=2;;
&nbsp;&nbsp;&nbsp; esac

&nbsp;&nbsp;&nbsp; if [[ $height -gt 5 ]]; then
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h=$height

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while [[ $h -gt 0 ]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorstr $row $col $color1 '.'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let row--
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [[ $((col + slant)) -ge $((cols - 3))&nbsp; ||&nbsp; $((col + slant)) -le 2 ]]; then break; fi
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let col+=slant
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let h--
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 0.1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [[ $((col + slant)) -lt $((cols - 3))&nbsp; &amp;&amp;&nbsp; $((col + slant)) -gt 2 ]]; then

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; h=$((height / 5))

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while [[ $h -gt 0 ]]
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorstr $row $col $color2 '.'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let row++
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [[ $((col + slant)) -ge $((cols - 3))&nbsp; ||&nbsp; $((col + slant)) -le 2 ]]; then break; fi
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let col+=slant
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; let h--
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sleep 0.1
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; done
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorstr $((row)) $((col - 1)) $color3 '***'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorstr $((row - 1)) $((col)) $color3 '*'
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; colorstr $((row + 1)) $((col)) $color3 '*'
&nbsp;&nbsp;&nbsp; fi
}

for i in $(seq 1 $nsingle)
do
&nbsp;&nbsp;&nbsp; clear
&nbsp;&nbsp;&nbsp; fireworks
&nbsp;&nbsp;&nbsp; sleep 1
done

clear

pids=
for i in $(seq 1 $nmultiple)
do
&nbsp;&nbsp;&nbsp; let multiple++
&nbsp;&nbsp;&nbsp; lock_file=$lock_file_base.$i
&nbsp;&nbsp;&nbsp; fireworks &amp;
&nbsp;&nbsp;&nbsp; pids="$pids $!"
done

trap "kill -9 $pids 2&gt;/dev/null" EXIT

wait $pids
sleep 3

clear
center_colorstr $((rows / 2 - 1)) red "Hope you enjoyed the show!"
center_colorstr $((rows / 2 + 1)) red "Happy forth! "
center_colorstr $((rows / 2 + 3)) red "Computoman"
echo

sleep 5
clear

# vim: tabstop=4: shiftwidth=4: noexpandtab:
# kate: tab-width 4; indent-width 4; replace-tabs false;

 

————————————————-

Dinner (home made biscuit slice ,mixed vegetables, sauteed chicken breast strips, and salad with ranch dressing (not shown).

SUNP0058

Good day.

Advertisements