Contents

Editorial



January 2019

Last month was to be the last newsletter as I need to take a break. I was hoping someone would come forward and offer to take over or at least provide some assistance. It never happened. For the moment I will continue producing something. It will probably be rather ad hoc, in other words, not necessarily every month.

On a more positive note, I have upgraded Back Seat Driver from version 2.0 to version 3.0. The newer version adds Psip to the mix. Now you can do remote desktop, transfer files and talk at the same time. During our testing phase it worked very well so hopefully it will work well for you too. To get the best experience you need a decent internet connection. If it's slow then there's not much I can do about that, sorry.

Take a look at the three distros I have featured this month. No words by me but reading the forums should provide the information you need. If it doesn't, ask a question.

I've included a tutorial on how to use Psip through a VPN. This makes it easier to setup and adds additional privacy. Jamesbond has upgraded psip, which in my opinion, significantly increases its functionality.

Last month I mentioned tree, a nice little CLI utility for displaying files and directories. This month I show you where to get the source and how to compile it.

A little bit of information about variables and an interesting crossword by greengeek regarding baby animal names.

I hope you had a Merry Christmas and I wish you a Happy New Year.


Best Regards

smokey01
Distro's

The Puppy Linux Discussion Forum is the main source for a lot of the information repeated here. Where appropriate, links will be provided so you can read first hand about the distribution development. This section will likely just provide highlights as a starting point.
TazPuppy

TazPuppy has reached beta 13.
Fatdog64-800

Fatdog64-800 Beta has been released.
EasyOS 0.9.14

EasyOS Pyro 0.9.14, December 18, 2018
Software

This months covers: Psip-1.42, ClipGrab and startpage.
Psip - PuppyPhone

Psip AKA PuppyPhone - Written by smokey01

Psip is an excellent Voice Over Internet Protocol (VOIP) application written by our own jamesbond. It has been included in many Puppy distributions over the last few years.

Recently jamesbond made a few modifications at my request which has significantly increased it's functionality.
The psip thread: http://www.murga-linux.com/puppy/viewtopic.php?p=1011832#1011832 will explain.

I have made a few new packages of psip which can be found on my website at: http://smokey01.com/psip/

If anyone has compiled psip-1.42 for any other distribution I'm happy to put it on my site for others to download.

I'm yet to update my Psip Help page but it remains quite relevant.

I no longer use a sip provider like Iptel that's mentioned in my help page. I prefer to use true Peer 2 Peer (P2P) via a Virtual Private Network (VPN). This makes setting up Psip much easier and adds a couple of extra layers of security.

If you wish to make your self visible so anyone can call you then a provider like Iptel is necessary.
ClipGrab

Information provided by wikipedia

ClipGrab is a multi-platform software package for downloading videos from popular websites such as YouTube, Vimeo, Dailymotion or Metacafe. It also provides the possibility to convert the downloaded files to other file formats such as MP3, MPEG4, OGG Theora or WMV. It is published as free software under the terms of version 3 of the GNU General Public License.

Puppylinux forum information: http://www.murga-linux.com/puppy/viewtopic.php?t=114941

I haven't tried ClipGrab myself but it does sound interesting.
https://www.startpage.com/

Although https://www.startpage.com/ is not software as such it does seem like a pretty good search engine.

Quote from their site:

You can’t beat Google when it comes to online search. So we’re paying them to use their brilliant search results in order to remove all trackers and logs. The result: The world’s best and most private search engine. Only now you can search without ads following you around, recommending products you’ve already bought. And no more data mining by companies with dubious intentions. We want you to dance like nobody’s watching and search like nobody’s watching.

I have no idea how trustworthy or reliable it is, you be the judge.
Tutorials

Use Psip in a VPN - smokey01.
Psip through a VPN

How to use Psip in a Virtual Private Network - Written by smokey01

If you like to make yourself public/available to talk to anyone who is willing to call you then this is not for you.

If however, you like your privacy and only wish to speak to a select few people, then keep reading.

All you need is Psip, preferably version 1.42 and edge/n2n-edge. You will also need access to a supernode.

Last month I showed you how to compile edge and you can get the latest version of Psip here. If it's not available for your distro let me know and I will attempt to make you a package.

To create a VPN with edge all parties need to connect to the same supernode with the appropriate credentials.

Create the script below and make it executable.

#!/bin/sh
modprobe tun
urxvt -title "Psip-Tunnel" -g 108x20+0+0 -e n2n-edge -d psip-tunnel -M 1000 -a 101.101.101.1 -c community-name -k encrypted-password -l bytemark.leggewie.org:1234 & echo $! > /tmp/edgepid
nice -n -10 /usr/bin/psip --config-file /root/.psip.conf --log-file /root/psip-activity.log --expand-buddies
read edgepid < /tmp/edgepid
kill $edgepid

I will explain what happens when you run the script line by line, command by command.

Line 1. modeprobe tun loads the tunnel driver. It may already be loaded but loading it again doesn't matter. Not having it loaded does matter.
Line 2 part 1. urxvt -title "Psip-Tunnel" -g 108x20+0+0 opens a terminal with a title of "Psip-Tunnel with dimensions 108 wide x 20 high.
Line 2 part 2. -e n2n-edge -d psip-tunnel -M 1000 loads edge/n2n-edge with a tunnel name of psip-tunnel using 1000 MTU.
Line 2 part 3. -a 101.101.101.1 sets your ip address to 101.101.101.1. You can choose your own IP address. I strongly advise you do.
Line 2 part 4. -c community-name -k encrypted-password sets your community name and encrypted password. You should change this also.
Line 2 part 5. -l bytemark.leggewie.org:1234 this is the address of the supernode. This can be changed if you have another supernode to use.
Line 2 part 6. & echo $! > /tmp/edgepid This echoes the process ID number so the tunnel can be killed later.
Line 3 part 1. nice -n -10 /usr/bin/psip nice gives psip some additional priority against other running apps and loads psip.
Line 3 part 2. --config-file /root/.psip.conf loads a particular config file. This switch means you can have more than one.
Line 3 part 3. --log-file /root/psip-activity.log creates a log file at the specified location. Again you can have multiple logs with different names and locations.
Line 3 part 4. --expand-buddies this will expand your buddies list so you don't have to do it manually.
Line 4. read edgepid < /tmp/edgepid this will read the edgepid number created at line 2 part 6.
Line 5. kill $edgepid this will kill the tunnel/VPN and disconnect you from the supernode.

Phew, that was a lot to take in but hopefully it will give you some clarity.

When you run the script a terminal will open and Psip will also start. We could have the terminal hidden but it does provide some useful information for trouble shooting.
If it's in the way just minimize it, don't close it or you will lose your connection to the supernode and other buddies.

When Psip is up you need to do a couple of things.

Create some buddies. It's always a good idea to include yourself. If you are green then you know you are connected to the supernode. Click the Add button.



Probably use your own name rather than Me.

Notice the sip: in front of 101.101.101.1. It's important and must be included. Each buddy must have a unique address in this range.
EG: George may be sip:101.101.101.2, jim sip:101.101.101.3 etc.
You can have multiple Categories. The same people can be in different Categories if you wish but with different IP's but within the 101.101.101.1-255 range.

The next step is to click on the Setup Button, top left. Then the Network button.

Make it look like this:



If you run the script with a different IP address then the Public IP address in Psip needs to be the same.

Psip should run in the VPN/Tunnel using the script provided. The problem is someone else might be using it at the same time.
It's always a good idea to use your own credentials, this maintains your privacy and prevents IP clobbering.
Make sure all your friends use the exact same credentials except for the unique IP address.

Go on, give it a try, I know you want to.
Compiling

This is a good section to discuss how to compile software. Compiling is not everyone's cup of tea but the more people that can manage it, the longer life Puppy will have.

The hardest part of compiling is the build recipe as there are so many options. Let's include some proven recipes here.

You must have the devx loaded as this is where most of your compiling tools reside. In some cases you may also need to have the kernel sources loaded.
tree

Written by smokey01

Last month I introduced you to the tree application.

The tree application, as the name suggests, is useful to display, in a terminal, directory contents, including directories, files, links.

Download the source code from: http://mama.indstate.edu/users/ice/tree/src/tree-1.7.0.tgz
or: ftp://mama.indstate.edu/linux/tree/tree-1.7.0.tgz

Extract the archive.

Enter the tree-1.7.0 directory.

Open a terminal in this directory.

Type make.

In a few seconds you should have a tree binary.

You can make the binary smaller by stripping it with the following command:

strip --strip-unneeded tree

In Fatdog-800b it reduced the binary size from 133k to 73k.

Now copy the tree binary to one of your bins, EG: /usr/local/bin
Scripts & Code

Back Seat Driver version 3.18
Bsdriver3

Backseat driver Version 3.18 - Written by smokey01

Last month I gave you bsdriver version 2. This provided remote desktop operations and file transfers. In version 3 I have included voice communications via Psip. You do however need version 1.42 of Psip.

If you satisfied the dependency requirements for version 2 then all you need is Psip-1.42.

If you are going to take control of someone's computer it's a lot easier if you are talking to the owner while you have his/her computer under your control. It also makes transferring files back and forth a lot easier. If you are near the other person then a landline or mobile phone will do the job nicely however, if they are overseas, not so much and this is where Psip is very useful.

I've tried to build in as much protection as I can with what I call button logic. Once you establish a connection with remote desktop or Psip, some buttons are deactivated to prevent you pressing the wrong buttons/options. The main things you need to be aware of are:

1. If you need help you press the Server Button and Psip as Student Button.

2. If you are providing help then you press the Client Button and Psip as Teacher Button.

3. When transferring files the receiver presses the Receive Files button before the sender presses the Send Files button.

There is a lot of checking going on in the background so if you do something wrong or don't have all the required dependencies installed, you will get a popup message telling you so.

Do read the built in help.

Below is the code. Copy it to a text editor, save it as bsdriver and make the file executable.

#-------------------------------------- Start ------------------------------------------------------

#!/bin/bash
# smokey01 CatDude jamesbond step MochiMoppel - Thu 21 Dec 18:32:54 ACDT 2018
# Version 3.18

# Usage: bsdriver [ Options ]
# Options:
# -d --dump
# -c --config /path/to/config-file
# Version 2.0 added send & receive files
# Version 3.0 added audio via Psip

modprobe tun

export APPVERSION=3.18
APPNAME=bsdriver
export CONFIG=$HOME/.config/$APPNAME.conf # also given via -c --config

# Localisation settings.
export TEXTDOMAIN=fatdog OUTPUT_CHARSET=UTF-8
. gettext.sh # for eval_gettext
export -f eval_gettext

# All temp files go here - it's auto-deleted on exit.
export TMPD="/tmp/$APPNAME-$USER-$$"
mkdir -p "$TMPD" && chmod 700 "$TMPD" || exit 1

# What happens on exit.
trap handle_trap 0 TERM QUIT
handle_trap () {
killtunnel
rm -rf "$TMPD"
}

# Make message.rc file
echo "style 'popup' {
bg[NORMAL] = '#FF0000'
fg[NORMAL] = '#FFFFFF'
font_name = 'Sans 16'
}
widget '*' style 'popup'" > $TMPD/message.rc

# Are all required dependencies installed?
for p in x11vnc:x11vnc ssvncviewer:ssvnc n2n-edge:n2n-v1; do
if ! type ${p%:*} >/dev/null 2>&1
then Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Error")" --infobox "$(BINARY=${p%:*} eval_gettext "Program '\$BINARY' does not exist.")\n\n$(gettext "This application will not work without it.")\n\n$(PACKAGE=${p#*:} eval_gettext "Install package '\$PACKAGE' from your Package Manager.")" 0 0 10000; fi
done
# Are all suggested dependencies installed?
for p in pv:pv ncat:nmap; do
if ! type ${p%:*} >/dev/null 2>&1
then Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Warning")" --infobox "$(BINARY=${p%:*} eval_gettext "Program '\$BINARY' does not exist.")\n\n$(gettext "You will not be able to send/receive files without it.")\n\n$(PACKAGE=${p#*:} eval_gettext "Install package '\$PACKAGE' from your Package Manager.")" 0 0 10000; fi
done

# Parse options.
unset OPT_d
while [ "$1" ]; do
case $1 in
-c | --config) CONFIG=$2; shift 2 ;;
-d | --dump) OPT_d=1; shift ;;
* ) break ;;
esac
done

# Make configuration.
if [ ! -f "$CONFIG" ]; then
cat <<- EOF > "$CONFIG"
SUPERNODE=bytemark.leggewie.org
PORT=1234
NAME=community-name
PASSWORD=encrypted-password
SERVERIP=192.168.6.1
CLIENTIP=192.168.6.2
DESKPORT=39022
SAVEDIR=$HOME
SHOWPSIP=true
TESTPSIP=true
PSIPNAME=cats
PSIPPASS=dogs
NCATNAME=birds
NCATPASS=bees
NCATSENDERIP=192.168.9.1
NCATRECEIVERIP=192.168.9.2
EOF
fi

. "$CONFIG"

#Checks to see if Psip has the --version parameter. If not can't use Psip.
psip_bin=$(command -v psip)
if grep -q -m1 -F -- --version "$psip_bin"; then
TESTPSIP=true
SHOWPSIP=true
else
unset version
TESTPSIP=false
SHOWPSIP=false
Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Psip Warning!")" --msgbox "$(gettext "Voice communications requires Psip Version 1.42\n\nYou can download a copy from:\n\nhttp://smokey01.com/psip.")" 0 0
fi

[ -z $GTKDIALOG ] && GTKDIALOG=gtkdialog

about () {
DIALOG='
<window title="'$(gettext "About - Back Seat Driver")'" resizable="true" icon-name="gtk-about" window-position="3">
<vbox space-expand="true" space-fill="true">

<notebook labels="'$(gettext "Information|Credits|Licence")'">
<vbox>
<text scrollable="true">
<label>"'$(gettext "
This Graphical User Interface was developed to simplify Remote Desktop operations, similar to TeamViewer.
There are many other tools available but they can be difficult to setup. They are usually big, slow, proprietary and often not free.

This application was developed for Fatdog64 and all the dependency applications are therefore available.
These include n2n-edge, x11vnc and ssvncviewer.

n2n-edge is a peer-to-peer Virtual Private Network application. This removes the need for any port forwarding and firewall configuration.

It also increases the security as all transmitted data is encrypted.

x11vnc is a server application and ssvncviewer is a client that connects to the server.
")'"</label></text>
</vbox>
<vbox>
<text justify="2">
<label>"'$(AUTHORS=$'smokey01\nCatDude\njamesbond\nstep\nMochiMoppel' VERSION=$APPVERSION eval_gettext "
This application was written by:

\$AUTHORS

Back Seat Driver Version \$VERSION

")'" </label>
</text>
<pixmap><input file>/usr/share/midi-icons/network48.png</input><height>48</height><width>48</width></pixmap>
<text justify="2"><label>"'$(VERSION_DATE="21 December 2018" ADDRESS="smokey01@smokey01.com" eval_gettext "
\$VERSION_DATE

If you use it and like it, let us know.

Email: \$ADDRESS")'"</label> </text>
</vbox>

<vbox>
<text><label>"'$(gettext "
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You can obtain more information regarding the GNU General Public License at https://www.gnu.org/licenses/

")'"</label></text>

</vbox>
</notebook>
<hbox>
<button ok></button>
</hbox>
</vbox>
<variable>DIALOG</variable>
</window>
'
export DIALOG
eval $(gtkdialog -p DIALOG -c)
}
export -f about

help () {

set -- $(gettext "help-window-width 450 help-window-height 400")
HELP_WIN_WIDTH=${2:-450} HELP_WIN_HEIGHT=${4:-400}

DIALOG='
<window title="'$(gettext "Back Seat Driver")'" resizable="true" icon-name="gtk-help" window-position="3">
<vbox>

<vbox width="'$HELP_WIN_WIDTH'" height="'$HELP_WIN_HEIGHT'" scrollable="true">
<text justify="0"><label>" '"$(eval_gettext "
Back Seat Driver was designed with simplicity in mind.

If you need help, click on the Server button.

To provide help click the Client button.

This will allow the helper to see your desktop and take total control of it.

Back Seat Driver should work with the default settings. Click the Config button to amend the default settings. This has been provided to provide some flexibility.
To collapse the configuration panel, click on the Config button again.

To close the application click on the Quit button.

You can also send files or folders of files back and forth. The receiver must select Send/Receive Files from the Menu Item File Transfers first. A panel will open where you can drag and drop files or folders. Click the Send Button to send the files.

The files or folders will be saved alongside the bsdriver script if you don't set a location for your transferred files.

Click on the Config button. At the bottom of the GUI click on the floppy disk icon and select your desired location to save your files. When you quit the application this setting will be saved in the config file so you don't have to repeat this step.

Note: If you mess up the default settings just remove file \$CONFIG and they will be restored to default settings.
Restart the application for the default settings to take effect.")

$(gettext "If you would like to talk to the other party by voice communications use the Psip buttons. The person providing help should click on the Run Psip as Teacher button and the person requiring help should click on the Run Psip as Student button.

Your audio should work but if it doesn't it's probably because you haven't setup your sound card. If you can record a short message and play it back in mhWaveEdit, or some other audio recorder, then you should be good to go.
You must have Psip version 1.42, or later, installed in /usr/bin otherwise you will not be able to use the audio feature. Earlier versions of Psip break the Psip 1.42 configuration file. A new configuration file is created each time you run Psip. Hopefully this will provide some reliabilty and stop the fiddlers breaking things.

Typical Scenario.
You have someone you wish to help somewhere on the internet. You contact each other by email or phone and agree to a time to meet online. The person requiring help clicks the Run Psip as Student Button. The person helping clicks Run Psip as Teacher Button. Expand the buddies list in the Tunnel group. The Teacher selects Student and clicks on the Call Button. The Student will get a popup message where they can accept or decline the call. The Student can also initiate the call. This will provide communications as long as your sound card is configured correctly.

Once in Psip either the Client or Server button will be active, not both. If you are the student then only the Server button will be available. This button should be clicked first. After the popup message disappears, in about 10 seconds, tell The teacher to click on the Client button. Now the Teacher has full control of your Desktop.")

"'
"
</label> </text>
</vbox>

<hbox>
<button ok></button>
</hbox>
</vbox>
<variable>DIALOG</variable>
</window>
'
export DIALOG
eval $(gtkdialog -p DIALOG -c)
}
export -f help

server () {
touch "$TMPD"/server
Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Back Seat Driver")" --infobox " $(DEPENDS_ON="n2n-edge\nx11vnc\nssvncviewer\npv\nncat\nXdialog\ngtkdialog" eval_gettext "This application uses:\n\n\$DEPENDS_ON\n\nWhen this message closes the \nother person can connect.\n\nSit down, relax and enjoy the ride.") " 0 0 10000 &
urxvt -g 108x20+0+0 --title "$(gettext "Server") $SERVERIP:$DESKPORT" -e \
n2n-edge -d help -M 1000 -a "$SERVERIP" -c "$NAME" -k "$PASSWORD" -l "$SUPERNODE":"$PORT" & echo $! > "$TMPD/n2npid"
sleep 5
nice -n -10 x11vnc -rfbport "$DESKPORT"
rm "$TMPD"/server
killmine
killtunnel
}
export -f server

client () {
touch "$TMPD"/client
urxvt -g 108x20+0+0 --title "$(gettext "Client") $CLIENTIP" -e \
n2n-edge -d help -M 1000 -a "$CLIENTIP" -c "$NAME" -k "$PASSWORD" -l "$SUPERNODE":"$PORT" & echo $! > "$TMPD/n2npid"
sleep 5
nice -n -10 ssvncviewer "$SERVERIP"::"$DESKPORT"
rm "$TMPD"/client
killmine
killtunnel
}
export -f client

killmine () {
pkill -f "x11vnc.*-rfbport.*"
pkill -f "ssvncviewer.*$SERVERIP::$DESKPORT.*"
}
export -f killmine

killtunnel () {
local n2npid
if [ -r "$TMPD/n2npid" ]; then
read n2npid < "$TMPD/n2npid"
kill $n2npid 2>/dev/null
rm "$TMPD"/n2npid
fi
}
export -f killtunnel

killpsip () {
local pid
if [ -r "$TMPD/psippid" ]; then
read pid < "$TMPD/psippid"
kill $pid 2>/dev/null
rm "$TMPD"/psippid
fi
if [ -r "$TMPD/ptunpid" ]; then
read pid < "$TMPD/ptunpid"
kill $pid 2>/dev/null
rm "$TMPD"/ptunpid
fi
}
export -f killpsip
print_config () {
echo "SUPERNODE='$SUPERNODE'
PORT='$PORT'
NAME='$NAME'
PASSWORD='$PASSWORD'
SERVERIP='$SERVERIP'
CLIENTIP='$CLIENTIP'
DESKPORT='$DESKPORT'
SAVEDIR='$SAVEDIR'
SHOWPSIP='$SHOWPSIP'
TESTPSIP='$TESTPSIP'
PSIPNAME='$PSIPNAME'
PSIPPASS='$PSIPPASS'
NCATNAME='$NCATNAME'
NCATPASS='$NCATPASS'
NCATSENDERIP='$NCATSENDERIP'
NCATRECEIVERIP='$NCATRECEIVERIP'
"
}
export -f print_config

# This is to create a tunnel and run psip through it.
run_psip () {
read PUBIP < "$TMPD"/publicip
# Make bsdriver.psip config file if it doesn't exist
if [ ! -e "/root/bsdriver.psip.conf" ]; then
cat <<- EOF > "$HOME/bsdriver.psip.conf"
{
"accounts": [{
"name": "New account",
"sip-url": "",
"registrar": "",
"realm": "",
"user": "",
"password": "",
"use-srtp": 0,
"proxy": "",
"active": 1
}],
"settings": {
"ring-command": "",
"loglevel": 4,
"help-command": "defaultbrowser file:///usr/share/doc/psip-doc.html",
"call-timeout": "30",
"minimise-tray": 0,
"auto-register": 0,
"ringtone-file": "/usr/share/sounds/bell.wav",
"im-beep": 0,
"im-command": "",
"activity-log": 1,
"sampling-rate": 1,
"quality": 5,
"max-calls": "4",
"sip-port": "",
"public-ip": "$PUBIP",
"stun-server": "",
"disable-vad": 1,
"enable-ice": 1,
"turn-server": "",
"turn-user": "",
"turn-password": "",
"turn-realm": "",
"turn-use-tcp": 0,
"disable-tcp": 1,
"disable-optional-srtp": 1,
"audio-in": "",
"audio-out": ""
},
"buddy-categories": [{
"category": "Tunnel",
"buddies": [{
"nick": "$(gettext 'Student')",
"address": "sip:$SERVERIP"
}, {
"nick": "$(gettext 'Teacher')",
"address": "sip:$CLIENTIP"
}]
}]
}
EOF
fi

sleep 1

urxvt -title "$(gettext "Psip:")$SUPERNODE:$PUBIP:$PORT" -g 108x20+0+22 -e n2n-edge -d chat -M 1000 -a "$PUBIP" -c "$PSIPNAME" -k "PSIPPASS" -l "$SUPERNODE":"$PORT" & PSIP_TUNNEL_PID=$!
echo "$PSIP_TUNNEL_PID" > "$TMPD"/ptunpid
sh -c 'echo $$ > "$TMPD"/psippid; exec nice -n -10 psip --config-file $HOME/bsdriver.psip.conf --log-file $HOME/bsdriver.psip.log'
kill $PSIP_TUNNEL_PID
if [ -f "$TMPD"/student ]; then rm "$TMPD"/student; else rm "$TMPD"/teacher; fi
}
export -f run_psip

send_file () {
if ! [ "$SOURCEFOLDER" ]; then
Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Stop")" --infobox "$(gettext "You did not specify a file/directory to send")" 0 0 10000
return
fi
set -- $(gettext "file-transfer-term-width 60 file-transfer-term-height 6")
TERM_WIDTH=${2:-60} TERM_HEIGHT=${4:-6}
BASENAME=$(basename "$SOURCEFOLDER")
DIRNAME=$(dirname "$SOURCEFOLDER")
urxvt -g 108x18+0+0 -e n2n-edge -d tac-tunnel -M 1000 -a "$NCATSENDERIP" -c "$NCATNAME" -k "$NCATPASS" -l "$SUPERNODE":"$PORT" & TAC_TUNNEL_PID=$!

cat > $TMPD/go.sh << EOF
echo "$(gettext 'Sending ...') $(gettext '(press Ctrl-C to abort)')"
tar -C "$DIRNAME" -cf - "$BASENAME" | pv -rb | ncat --send-only "$NCATRECEIVERIP" "$PORT"
ok=\$?
if [ 0 = \$ok ]
then echo "$(gettext "Sent.")"
else echo "$(gettext "Failed.")"
Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Stop")" --infobox "$(gettext 'Failed.')\n\n$(gettext "Your party needs to start receiving")\n$(gettext "before you can send files.")\n\n$(gettext "Perhaps that was the reason for failure?")" 0 0 10000 &
fi
read -t 5 -p "$(gettext 'Closing window in 5 seconds, press Enter to skip ...')"
EOF
urxvt --title "$(gettext "Sending ...")" -geometry ${TERM_WIDTH}x${TERM_HEIGHT} -e sh $TMPD/go.sh
sleep 1
kill $TAC_TUNNEL_PID
}
export -f send_file

receive_file () {
set -- $(gettext "file-transfer-term-width 60 file-transfer-term-height 6")
TERM_WIDTH=${2:-60} TERM_HEIGHT=${4:-6}
urxvt -g 108x18+0+0 -e n2n-edge -d tac-tunnel -M 1000 -a "$NCATRECEIVERIP" -c "$NCATNAME" -k "$NCATPASS" -l "$SUPERNODE":"$PORT" & TAC_TUNNEL_PID=$!

cat > $TMPD/go.sh << EOF
echo $(gettext 'Receiving ...')
DESTDIR="${SAVEDIR}/\$(date '+$(gettext 'Received %F %H:%M:%S')')"
mkdir -p -- "\$DESTDIR" && ncat -l "$NCATRECEIVERIP" "$PORT" | pv -rb | tar -C "\$DESTDIR" -xf -
ok=\$?
if [ 0 = \$ok ]
then echo "$(gettext "Received.")"
else echo "$(gettext "Failed.")"
Xdialog --rc-file $TMPD/message.rc --title "$(gettext "Stop")" --infobox "$(gettext 'Failed.')" 0 0 10000 &
fi
read -t 5 -p "$(gettext 'Closing window in 5 seconds, press Enter to skip ...')"
EOF
urxvt --title "$(gettext "Receiving ...")" -geometry ${TERM_WIDTH}x${TERM_HEIGHT} -e sh $TMPD/go.sh
sleep 1
kill $TAC_TUNNEL_PID
}
export -f receive_file


set -- $(gettext "main-window-width 500 toolbar-button-width 90 send-window-button-width 70 config-panel-label-width 50 config-entry-col1-width 88 config-entry-col2-width 50 wide_button_width 200")
# Don't change the NUMBERS above. Change them below as needed. If you add new WORDS above then change ABOVE and BELOW.
MAIN_WIN_WIDTH=${2:-400} TOOLBAR_BTN_WIDTH=${4:-90} SEND_BTN_WIDTH=${6:-70} CONFIG_LBL_WIDTH=${8:-50} CONFIG_ENTRY_COL1_WIDTH=${10:-88} CONFIG_ENTRY_COL2_WIDTH=${10:-50} WIDE_BTN_WIDTH=${14:-200}
MAIN_DIALOG='
<window title="'$(VERSION=$APPVERSION eval_gettext "Back Seat Driver - Version \$VERSION")'" width-request="'$MAIN_WIN_WIDTH'" icon-name="gtk-network" window-position="1" resizable="false">

<vbox>

<menubar>

<menu stock-id="gtk-file" label="'$(gettext "File")'">
<menuitem stock-id="gtk-quit">
<action>exit:Quit</action>
</menuitem>
<menuitem checkbox="'$SHOWPSIP'" label="'$(gettext "Show Psip")'">
<variable>SHOWPSIP</variable>
<action>if true show:MONTY</action>
<action>if false hide:MONTY</action>
</menuitem>
</menu>

<menu stock-id="gtk-info" label="'$(gettext "Information")'">
<menuitem stock-id="gtk-help">
<action>help &</action>
</menuitem>

<menuitem stock-id="gtk-about">
<action>about &</action>
</menuitem>
</menu>

<menu stock-id="gtk-refresh" label="'$(gettext "File Transfers")'">
<menuitem checkbox="false" label="'$(gettext "Send/Receive Files")'">
<action>if true show:HALFMONTY</action>
<action>if false hide:HALFMONTY</action>
</menuitem>

<menuitem stock-id="gtk-floppy" label="'$(gettext "Saved Files")'">
<action>rox "$SAVEDIR"</action>
</menuitem>
</menu>

</menubar>

<hbox homogeneous="true">
<togglebutton tooltip-text=" '$(gettext "Change the default configuration.")' " width-request="'$TOOLBAR_BTN_WIDTH'">
<default>false</default>
<label>"'$(gettext "Config")'"</label>

<input file stock="gtk-preferences"></input>
<action>if true show:FULLMONTY</action>
<action>if false hide:FULLMONTY</action>
</togglebutton>

<button tooltip-text=" '$(gettext "The person who needs help starts the Server.")' " width-request="'$TOOLBAR_BTN_WIDTH'">
<label>"'$(gettext "Server")'"</label>
<variable>SERVERBUTTON</variable>
<input file stock="gtk-network"></input>
<action>disable:PSIPTEACHER</action>
<action>disable:CLIENTBUTTON</action>
<action>disable:SERVERBUTTON</action>
<action>echo "$SERVERIP" > "$TMPD"/publicip</action>
<action>enable:TIMER1</action>
<action>server &</action>
</button>
<timer visible="false" sensitive="false">
<variable>TIMER1</variable>
<action condition="command_is_true( [ -e '"$TMPD"'/server ] && echo true )">break:</action>
<action>disable:TIMER1</action>
<action>enable:SERVERBUTTON</action>
<action condition="command_is_true( [ -e '"$TMPD"'/student -o -e '"$TMPD"'/teacher ] && echo true )">break:</action>
<action>enable:CLIENTBUTTON</action>
<action>enable:PSIPTEACHER</action>
</timer>

<button tooltip-text=" '$(gettext "The computer guru starts the Client.")' " width-request="'$TOOLBAR_BTN_WIDTH'">
<label>"'$(gettext "Client")'"</label>
<variable>CLIENTBUTTON</variable>
<input file stock="gtk-fullscreen"></input>
<action>disable:PSIPSTUDENT</action>
<action>disable:SERVERBUTTON</action>
<action>disable:CLIENTBUTTON</action>
<action>echo "$CLIENTIP" > "$TMPD"/publicip</action>
<action>enable:TIMER2</action>
<action>client &</action>
</button>
<timer visible="false" sensitive="false">
<variable>TIMER2</variable>
<action condition="command_is_true( [ -e '"$TMPD"'/client ] && echo true )">break:</action>
<action>disable:TIMER2</action>
<action>enable:CLIENTBUTTON</action>
<action condition="command_is_true( [ -e '"$TMPD"'/student -o -e '"$TMPD"'/teacher ] && echo true )">break:</action>
<action>enable:SERVERBUTTON</action>
<action>enable:PSIPSTUDENT</action>
</timer>

<button tooltip-text=" '$(gettext "Close Remote Desktop.")' " width-request="'$TOOLBAR_BTN_WIDTH'">
<label>"'$(gettext "Stop")'"</label>
<input file stock="gtk-stop"></input>
<action>killmine</action>
<action>killtunnel</action>
</button>

<button tooltip-text=" '$(gettext "Save configuration and close the application.")' " width-request="'$TOOLBAR_BTN_WIDTH'">
<label>"'$(gettext "Quit")'"</label>
<input file stock="gtk-quit"></input>
<action>print_config > "'"$CONFIG"'"</action>
<action>killmine; killtunnel; killpsip</action>
<action>exit:0</action>
</button>
<variable>BTNBAR</variable>
</hbox>

<vbox visible="'$SHOWPSIP'">
<frame '$(gettext 'Psip Details')'>
<hbox homogeneous="true">

<button tooltip-text=" '$(gettext "Run Psip through the tunnel/VPN.")' " width-request="'$WIDE_BTN_WIDTH'">
<label>"'$(gettext "Run Psip as Student")'"</label>
<variable>PSIPSTUDENT</variable>
<width>18</width>
<height>18</height>
<sensitive>"'$TESTPSIP'"</sensitive>
<input file>/usr/share/pixmaps/psip48.png</input>
<action>disable:CLIENTBUTTON</action>
<action>disable:PSIPTEACHER</action>
<action>disable:PSIPSTUDENT</action>
<action>touch "$TMPD"/student && echo "$SERVERIP" > "$TMPD"/publicip</action>
<action>enable:TIMER3</action>
<action>run_psip &</action>
</button>
<timer visible="false" sensitive="false">
<variable>TIMER3</variable>
<action condition="command_is_true( [ -e '"$TMPD"'/student ] && echo true )">break:</action>
<action>disable:TIMER3</action>
<action>enable:PSIPSTUDENT</action>
<action condition="command_is_true( [ -e '"$TMPD"'/server ] && echo true )">break:</action>
<action>enable:CLIENTBUTTON</action>
<action>enable:PSIPTEACHER</action>
</timer>

<button tooltip-text=" '$(gettext "Run Psip through the tunnel/VPN.")' " width-request="'$WIDE_BTN_WIDTH'">
<label>"'$(gettext "Run Psip as Teacher")'"</label>
<variable>PSIPTEACHER</variable>
<width>18</width>
<height>18</height>
<sensitive>"'$TESTPSIP'"</sensitive>
<input file>/usr/share/pixmaps/psip48.png</input>
<action>disable:SERVERBUTTON</action>
<action>disable:PSIPSTUDENT</action>
<action>disable:PSIPTEACHER</action>
<action>touch "$TMPD"/teacher && echo "$CLIENTIP" > "$TMPD"/publicip</action>
<action>enable:TIMER4</action>
<action>run_psip &</action>
</button>
<timer visible="false" sensitive="false">
<variable>TIMER4</variable>
<action condition="command_is_true( [ -e '"$TMPD"'/teacher ] && echo true )">break:</action>
<action>disable:TIMER4</action>
<action>enable:PSIPTEACHER</action>
<action condition="command_is_true( [ -e '"$TMPD"'/client ] && echo true )">break:</action>
<action>enable:PSIPSTUDENT</action>
<action>enable:SERVERBUTTON</action>
</timer>
</hbox>
</frame>
<variable>MONTY</variable>
</vbox>

<vbox visible="false">
<frame '$(gettext 'Transfer Details')'>
<hbox>
<text><label>'$(gettext 'File/Dir:')'</label></text>
<entry accept="file" tooltip-text=" '$(gettext "Drop a File or Directory here or click the Open button then click the send button.")' ">
<variable>SOURCEFOLDER</variable>
</entry>

<button width-request="'$SEND_BTN_WIDTH'" tooltip-text=" '$(gettext "Clears the File/Dir field...")' ">
<label>'$(gettext 'Clear')'</label>
<input file stock="gtk-clear"></input>
<action>Clear:SOURCEFOLDER</action>
</button>

<button width-request="'$SEND_BTN_WIDTH'" tooltip-text=" '$(gettext "Choose a File to Send...")' ">
<label>'$(gettext 'Open')'</label>
<input file stock="gtk-open"></input>
<action type="fileselect">SOURCEFOLDER</action>
</button>
</hbox>
<hbox homogeneous="true">
<button width-request="'$WIDE_BTN_WIDTH'" tooltip-text=" '$(gettext "Receive Files or Directories...")' ">
<label>'$(gettext 'Receive')'</label>
<input file stock="gtk-ok"></input>
<action>receive_file &</action>
</button>

<button width-request="'$WIDE_BTN_WIDTH'" tooltip-text=" '$(gettext "Send Files or Directories...")' ">
<label>'$(gettext 'Send')'</label>
<input file stock="gtk-ok"></input>
<action>send_file &</action>
</button>
</hbox>
</frame>
<variable>HALFMONTY</variable>
</vbox>

<vbox visible="false">
<text use-markup="true">
<label>"<b><span bgcolor='"'yellow'"'> '$(gettext "Changing configuration requires restart")' </span></b>"</label>
</text>
<frame '"$(gettext 'Virtual Private Network Configuration')"'>
<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "URL:")'"</label></text>
<entry tooltip-text=" '"$(gettext "This is the URL of the Supernode.")"' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'"$SUPERNODE"'"</default>
<variable>SUPERNODE</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Port:")'"</label></text>
<entry tooltip-text=" '"$(gettext "This is the port the Supernode is listening on.")"' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$PORT"'"</default>
<variable>PORT</variable>
</entry>
</hbox>

<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Name:")'"</label></text>
<entry tooltip-text=" '"$(gettext "Community Name can be anything you like.")"' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'"$NAME"'"</default>
<variable>NAME</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Pass:")'"</label></text>
<entry tooltip-text=" '$(gettext "You may choose your own password but remember the Server and Client must use the same credentials.")' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$PASSWORD"'"</default>
<variable>PASSWORD</variable>
</entry>
</hbox>

<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Server:")'"</label></text>
<entry tooltip-text=" '$(gettext "Server and Client IP must be different and in the same range EG:192.168.100.1/100.")' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'"$SERVERIP"'"</default>
<variable>SERVERIP</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Client:")'"</label></text>
<entry tooltip-text=" '$(gettext "Server and Client IP must be different and in the same range EG:192.168.100.1/100.")' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$CLIENTIP"'"</default>
<variable>CLIENTIP</variable>
</entry>
</hbox>
</frame>

<frame '$(gettext 'Remote Desktop Configuration')'>
<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Port:")'"</label></text>
<entry tooltip-text=" '$(gettext "You may choose any port not in use.")' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'$DESKPORT'"</default>
<variable>DESKPORT</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Desk:")'"</label></text>
<entry sensitive="false" tooltip-text=" '$(gettext "This needs to be the same as the VPN Server.")' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$SERVERIP"'"</default>
<variable>DESKIP</variable>
</entry>
</hbox>
</frame>

<frame '$(gettext 'Psip Community & Password Configuration')'>
<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Name:")'"</label></text>
<entry tooltip-text=" '$(gettext "Must be different to VPN Name.")' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'$PSIPNAME'"</default>
<variable>PSIPNAME</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Pass:")'"</label></text>
<entry tooltip-text=" '$(gettext "Must be different to VPN Pass.")' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$PSIPPASS"'"</default>
<variable>PSIPPASS</variable>
</entry>
</hbox>
</frame>



<frame '$(gettext 'NCAT Configuration')'>
<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Name:")'"</label></text>
<entry tooltip-text=" '$(gettext "Must be different to VPN and Psip Name.")' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'$NCATNAME'"</default>
<variable>NCATNAME</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Pass:")'"</label></text>
<entry tooltip-text=" '$(gettext "Must be different to VPN and Psip Pass.")' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$NCATPASS"'"</default>
<variable>NCATPASS</variable>
</entry>
</hbox>
<hbox>
<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Send:")'"</label></text>
<entry tooltip-text=" '$(gettext "Send and Receive IP must be different and in the same range EG:192.168.100.1/100.")' " width-request="'$CONFIG_ENTRY_COL1_WIDTH'">
<default>"'"$NCATSENDERIP"'"</default>
<variable>NCATSENDERIP</variable>
</entry>

<text width-request="'$CONFIG_LBL_WIDTH'"><label>"'$(gettext "Receive:")'"</label></text>
<entry tooltip-text=" '$(gettext "Send and Receive IP must be different and in the same range EG:192.168.100.1/100.")' " width-request="'$CONFIG_ENTRY_COL2_WIDTH'">
<default>"'"$NCATRECEIVERIP"'"</default>
<variable>NCATRECEIVERIP</variable>
</entry>
</hbox>
</frame>

<frame '$(gettext 'Location to save Files')'>
<text use-markup="true">
<label>"<b><span bgcolor='"'yellow'"'> '$(gettext "Existing files will be overwritten")' </span></b>"</label>
</text>
<hbox>
<entry tooltip-text=" '$(gettext "Path to saved Files.")' " secondary-icon-stock="gtk-floppy" activates_default="true" editable="false" fs-title="'$(gettext "Select an existing folder")'" fs-action="folder">
<default>"'"$SAVEDIR"'"</default>
<variable>SAVEDIR</variable>
<action signal="button-press-event">fileselect:SAVEDIR</action>
</entry>

<button tooltip-text=" '$(gettext "Open saved Files Folder.")' ">
<label>'$(gettext 'Open')'</label>
<input file stock="gtk-open"></input>
<action>rox "$SAVEDIR"</action>
</button>
</hbox>
</frame>
<variable>FULLMONTY</variable>
</vbox>
</vbox>
</window>
'
export MAIN_DIALOG

if [ "$OPT_d" ]
then echo "$MAIN_DIALOG"
else $GTKDIALOG --program=MAIN_DIALOG
fi

#---------------------------------------------- End ---------------------------------------------------
Tips & Tricks

Tips & Tricks are simple little actions you can take to make your life easier when using Puppy. You will probably know most of the tips but there are always new users that don't.

Variables - smokey01

Variables

Written by smokey01

This information is for the absolute beginner. Some of us who have been playing with code for many years forget just how confusing it can be for the beginner.

What is a variable?

There are many ways to explain a variable but I think it's easiest to associate it with something that everyone understands, such as an analogy.
Let's call a variable a box with a name. The box can be empty or it can contain information. You can change the information in the box or even empty it.
The following examples are done in a terminal, but don't freak out, it really is quite simple.

Open a termnial. Probably the most common terminal is urxvt and it's the default in most Pups.

To create a variable named V1 with contents of "Hello World" type: V1="Hello World" I did tell you it was simple.
How do you know it worked? In the same terminal type: echo $V1 and Hello World will be displayed.

You need the $ because that makes it a string variable. Anything between the quotes becomes the contents of the variable. You know, the stuff in the box.

Try this: V1="This is a good test. 12345&@#" Now type echo $V1.

Now try it without the quotes: V1=This is a good test. 12345&@# and then type echo $V1.

The result:
[1] 11356
sh: @#: command not found
sh: is: command not found


When it saw the & it backgrounded the process and treated the next two characters as commands. Remember the quotes are important.

Always use quotes, single ' ' or double " " when defining a variable.

Write some information to a file.

echo "Hello World" > /tmp/myfile

This will create a file called myfile in the /tmp directory and the contents of the file will be Hello World. It has not created a variable, yet.

Use your file manager to see if the file exists and check the contents.

Now to read the contents of the file we just created and make a variable of the contents do this:

read myvariable < /tmp/myfile

To test it worked, type: echo $myvariable

Not so difficult after all, is it?
Entertainment

January crossword - greengeek.
Crossword

Puppy Crossword (January 2019)
(Formatted by greengeek using the "Puzzlefast" website)

Doggy daycare
















Scroll further down for answers:








Useful Links

Puppy Linux Forums USA

Ibiblio repository USA

nluug repository Netherlands

Internode repository Australia

University of Crete repository Greece

aarnet repository Australia

Internet archive repository USA

Puppy Linux Tips by smokey01

Puppy Linux wikka Puppy sites

Bookmarkos provided by kerl

Search the Puppy Linux Forums

Barry Kauler's News Blog

labbe5 Report

https://www.opendesktop.org

Puppy Linux Icon Sets

http://lxer.com/

https://distrowatch.com/

https://www.linux-apps.com/

SecurityBaron.com


Contributors this month

Not all of the people below have physically given me the information to publish. If I find information I will give the credit where it is due. So if you see your name on the list below please don't be alarmed or upset. You are receiving the credit you deserve.

smokey01
greengeek

Proof reading - russoodle

Newsletter Information

Display tip:
To improve the Notecase display format please press F7 then:
- Tick the "Restore last position/size" checkbox.
- Select the "Display" tab and tick "Wrap text".

Newsletter index written by 6502coder can be found here:
http://www.murga-linux.com/puppy/viewtopic.php?p=945962#945962

Contributions

If you have information you would like to see in the newsletter please email it to smokey01 at smokey01@internode.on.net. I prefer it to be created in Notecase otherwise it makes my job a bit more difficult. I don't intend doing any significant editing but I will attempt to read all of the articles and ask a couple of others to do some proof reading. If you would like to assist in proof reading please let me know on the email address above.

Notecase is very easy to learn and use. Try and keep your articles to less than 1000 words. Photos and images should be no bigger than 1024 x 768. I can always make them smaller.

The deadline for articles is the 20th of each month. Let's not worry about time zones. I know it may be the 20th in Australia and only the 19th in the USA but I can live with this. If it's more than 24 hours late with respect to Australian CST then your article may be pushed right, into the next edition. I expect proof reading to take less than a week which will provide about four days to publish at the beginning of each month.

I will upload the Newsletter to my site at http://smokey01.com/newsletters. There will be two versions. One will be an xz compressed Notecase file and the other will be a html file so it can be read in a browser.

I have changed the original naming convention to 0001-PuppyLinuxNewsletter-Jan2017.ncd.xz and 0001-PuppyLinuxNewsletter-Jan2017.html respectively. The formatting of the html is not brilliant but readable. The newsletter is intended to be downloaded and read in Notecase.

Disclaimer

The editor has the right to veto any articles that he/she considers inappropriate. A reasonable effort will be made to avoid spelling and grammatical errors however, I'm sure some may slip through. This newsletter is published by volunteers, and is free, so please be kind. Constructive criticism and positive suggestions are welcomed.

smokey01