Contents

Editorial



July 2018

Last month I explained how to use VLC to watch Television. All you need is a USB TV Tuner and a channels.conf file configured for your location.
This month I have taken this to the next level and written a GUI (Graphical User Interface) in gtkdialog that will allow you to schedule and record TV programs.

The distro I have chosen this month is Just-Lighthouse64-801. It's a nice distro developed by Dry Falls.

Each month I try and find a piece of software that readers might find useful. This month I have chosen geany.

I have written about Psip (PuppyPhone) in the past but this month I will show you how to use it via a P2P VPN. This provides a whole lot more security and stops unwanted calls. If they can't see you, they can't call you.

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.

Just-Lighthouse64-801

Developed by Dry Falls

Read all about it in the Puppy Linux forums:
http://www.murga-linux.com/puppy/viewtopic.php?t=112102&start=30

LightHousePup has been around for quite some time. Originally developed by forum member Tazoc but continued under a slightly different name by Dry Falls.

I've always liked LHP because it had a very similar feel to Fatdog64. If my memory serves me correctly it was the second 64bit operating system influenced by Puppy Linux.

The other nice thing about LHP and now JL (Just-Lighthouse) is the aesthetics. It's actually quite easy on the eyes with a multitude of colours for different folders and the like. If you haven't tried it, take a look. I'm sure you won't be disappointed.



Software

This month's covers geany, the great little IDE.

Geany

Written by smokey01

Geany is an Integrated Development Environment (IDE) however, most people would say it's just a text editor. Trust me when I say, Geany is much more than a simple text editor. I probably spend more time in geany than any other application and I'm sure many of you do too. It's my primary tool for programming and creating web pages.

Recently I was having a look around the internet and noticed Gedit and Atom and they seemed to be quite popular so I thought I would take a look to see what all the fuss was about. I never managed to get either of them running in Fatdog64 but they sure were a lot bigger than geany. Atom unpacked was about 500 MB, certainly not a light weight. Geany weighed in about 31 MB and the plugins were 12 MB. I think I will stick with geany.

It's worth taking a look at the geany home page.

Another interesting place to visit is the plugins page.

I'm sure you have seen and used geany but did you know it could:

Comment a block of code and insert a GPL notice?

To comment the block of code, first mark/highlight the code. Now select Edit > Format > Comment Lines. This will place a # in front of each line. To remove the comments, mark/highlight the code, select Edit > Format > Uncomment Lines.

To insert a General Public Licence notice, select Edit > Insert Comment > Insert GPL Notice.

If you want to create a new template for coding, click on the down arrow right of New button. This following will be displayed:



Notice the obvious one missing? Yes the shell script. Maybe it's considered too simple to include but I would like it.

To create a template for a shell script, we will call it file.sh. Open geany, click on the New Button. On the first line type:

#!/bin/sh

Now click on File > Save As then select the folder where you need to save the new template:

/usr/share/geany/templates/files/

Name the file: file.sh

Gxlat

Developed by vovchik

Gxlat - Desktop Google Translator redux.

Read all about it here

Barry wrote about it on his news blog.



Tutorials

This month I have written a script so you can schedule and record TV programs, and
explained how to use psip in a VPN.

VLC as a PVR

Written by smokey01

Last month I explained how to watch TV using VLC. This month I will explain how you can use VLC to record your TV programs.

This application was written in Fatdog64-721. It has only been tested in Fatdog and Tahrpup64. It should work in any distro that has gtkdialog, VLC and crond.

This is what the application looks like. I have tried to make it as intuitive as possible. There are many tooltips and some help built in but hopefully you won't need to rely on them.



As you can see in the GUI above, TV Channel 7 Adelaide is selected. A schedule has been created to record the channel 7 news at 06:00 every day for one hour.

To watch TV simply select the channel and click on the Watch TV button. To record TV immediately, select the channel and click the Record button. Be aware you can only use the tuner to do one action at a time. You can't watch and record TV at the same time. You can however record a channel then click on the Recordings button to open a folder where your recordings are stored, then click on the recorded/recording media to watch it. Whenever you are finished recording or watching TV make sure you click on the Stop button. Closing the viewing window will not release the TV Tuner.

The other two buttons, Add and Delete, are for creating and deleting recording schedules. Let's makes some assumptions:
The program is called Get Some Sleep, it's on three times a week on Monday, Wednesday and Friday at 03:00 in the morning and runs for 30 minutes. This is what you would do to schedule a recording:

1. Select the TV Channel
2. Give it a Name EG: Get Some Sleep
3. Select an appropriate place to store the recordings, probably not in your save file.
4. In the Hour column, select 3.
5. In the minute column, select 0.
6. Where it says Day of the Week, type Mon,Wed,Fri
7. Change the Run-Time to 1800 seconds which is 30 Minutes.
8. The final step is to click on the Add button and you will see the schedule added.

When you wish to remove that schedule, highlight it and press the Delete button.

There is a fair bit going on in the background that you may not see. For example it checks to see if you have VLC installed, if not a popup message will be displayed. It will also check to see if you have a channels.conf file.

On the short Menu Bar, left of program_name, under File, you will see Help, About and Quit. If you click on Help, help will be displayed. You will also notice the Help GUI has three buttons. The Ok button closes the GUI. The Get w_scan button will download the source code for w_scan and place it next to where ever you placed this script. The help file will explain how to compile it. You will also get a message if you don't have the devx loaded.
The Menu button will create a desktop file under the Multimedia category. If you move this script to another location the menu entry will not work. To make it work again click on the Menu button again and the desktop file will be updated.
The About Button should be obvious.

You may not find the code all that tidy, sorry about that. There will likely be many different ways to achieve to same result but I use what I know. Mind you each time I write a new application I always learn many new things. This was no exception.

Copy the code below into a text editor and save it as vlc-rec-gui.sh The desktop file will not work if you use a different name unless of course you change the code.

Make the script executable and place it anywhere you wish. I suggest you make a folder under /usr/local/ called TV-Recorder

In the /usr/local/TV-Recorder folder is where you also need to place the channels.conf file. VLC needs this for both watching and recording TV. When you first run the script you should notice a folder called Scripts has been created and another file called channels.txt. The channels.txt is used to create a readable list for TV Channels and the Scripts folder is where the scripts for cron are stored. To understand how cron works click here.

# -------------------------- Start of script --------------------------------------------------------------
#!/bin/bash
# Sun 25 Jul 12:00:00 ACST 2018
# Written by smokey01 & CatDude
################################

echo '<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="100" width="100">
<path style="fill:#111111;stroke:#666666" d="m 41,81 0,8 c 0,0 -6,0 -7,0 -4,0 -6,6 -6,6 2,0 43,0 44,0 0,0 -1,-6 -4,-6 -2,0 -7,0 -7,0 l 0,-8"/>
<path style="fill:#ffffff;stroke:#000000;stroke-width:4px;stroke-linecap:butt" d="m 4.7,74 c 0,-16 0,-45 0,-57 0,-4 0,-8.8 5.2,-8.8 9.1,0 76.1,0 81.1,0 5,0 5,4.8 5,12.8 0,11 0,46 0,53 0,1 0,5 -8,5 -5,0 -74,0 -78.1,0 -5.2,0 -5.2,-5 -5.2,-5 z"/>
<path style="fill:#888888;stroke:#ffffff" d="M 7.8,12 93,12 93,75 7.8,75 z"/>
<g style="fill-opacity:0.6">
<rect style="fill:#6FE7F1;" width="80" height="63" x="10" y="12"/>
</g>
</svg>' > /usr/share/pixmaps/tv.svg

# Where am I
MY_PATH=$(dirname "$(readlink -f "$0")")
MY_PATH=$MY_PATH
export MY_PATH
cd "$MY_PATH"

[ -s "channels.txt" ] || rm channels.txt
[ ! -e "channels.txt" ] && cat channels.conf | cut -d: -f1 > channels.txt
[ ! -e /root/.config/vlc-rec-gui.conf ] && echo "$MY_PATH" > /root/.config/vlc-rec-gui.conf
[ ! -d "Scripts" ] && mkdir "$MY_PATH"/Scripts
[ -e "/tmp/status" ] && rm /tmp/status
touch /tmp/status

[ ! -e "$MY_PATH/channels.conf" ] && Xdialog --icon /usr/share/midi-icons/error.xpm --title Error... --msgbox "Oh Dear...\n\nI can't find the channels.conf file.\n\nVLC TV Recorder needs it to work..." 0 0
[ ! -e /usr/bin/vlc ] && Xdialog --icon /usr/share/midi-icons/error.xpm --title Error --msgbox "VLC does not appear to be installed...\n\nYou didn't really think it would run without VLC, did you? " 0 0

pgrep -x "crond" > /dev/null 2>&1; [ $? -ne 0 ] && Xdialog --icon /usr/share/midi-icons/error.xpm --msgbox "The cron daemon (crond) must be running\nfor scheduling to work..." 0 0

for I in \* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23; do HOUR_ITEMS=`echo "$HOUR_ITEMS<item>$I</item>"`; done
for I in \* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59; do MINUTE_ITEMS=`echo "$MINUTE_ITEMS<item>$I</item>"`; done
for I in \* 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31; do DOM_ITEMS=`echo "$DOM_ITEMS<item>$I</item>"`; done
for I in \* Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do MONTH_ITEMS=`echo "$MONTH_ITEMS<item>$I</item>"`; done

USER=`whoami`

station_list() {
while read -r line; do echo "<item>${line}</item>"; done < channels.txt
}

runnow() {
sleep 1
STRING=`eval awk '/"${CHANNELS}"/' channels.conf`
IFS=':' read -r -a array <<< "$STRING"
BW=`echo ${array[3]} | cut -d '_' -f 2`
MYDATE=`date '+%a_%d_%b_%Y_%H:%M:%S'`
fullmonty=`printf "cvlc dvb-t://frequency=%s:bandwidth=%s :no-sout-all :program=%s :run-time=%s :sout=file/ts:%s/%s_%s.ts vlc://quit\n" ${array[1]} "$BW" ${array[12]} "$LENGTH" "$DESTFOLDER" "${ENTRY1// /_}" "$MYDATE"`
$fullmonty
}
export -f runnow

watchtv() {
STRING=`eval awk '/"${CHANNELS}"/' channels.conf`
IFS=':' read -r -a array <<< "$STRING"
BW=`echo ${array[3]} | cut -d '_' -f 2`
fullmonty=`printf "cvlc dvb-t://frequency=%s:bandwidth=%s :program=%s" ${array[1]} "$BW" ${array[12]}`
$fullmonty
}
export -f watchtv

addprog() {
sleep 1
STRING=`eval awk '/"${CHANNELS}"/' channels.conf`
IFS=':' read -r -a array <<< "$STRING"
BW=`echo ${array[3]} | cut -d '_' -f 2`
MYDATE=`date '+%a_%d_%b_%Y_%H:%M:%S'`
fullmonty=`printf "cvlc dvb-t://frequency=%s:bandwidth=%s :no-sout-all :program=%s :run-time=%s :sout=file/ts:%s/%s_%s.ts vlc://quit\n" ${array[1]} "$BW" ${array[12]} "$LENGTH" "$DESTFOLDER" "${ENTRY1// /_}" "$MYDATE"`



echo '#!/bin/bash' > Scripts/"${ENTRY1// /_}"_"$MYDATE".sh
echo "$fullmonty" >> Scripts/"${ENTRY1// /_}"_"$MYDATE".sh; chmod +x Scripts/"${ENTRY1// /_}"_"$MYDATE".sh

crontab -u "${USER}" -l | { cat; echo "${MINUTE} ${HOUR} ${DOM} ${MONTH} ${DOW} ${MY_PATH}/Scripts/${ENTRY1// /_}_${MYDATE}.sh"; } | crontab -u "${USER}" -

}
export -f addprog

delprog() {
if [ -z "$LIST" ]; then
notselected
else
S2D=`echo "$LIST" | awk '{print $NF}'`
crontab -u "$USER" -l | grep -v "$S2D" | crontab -u "$USER" - ; rm "$S2D"
fi
}
export -f delprog


[ -z $GTKDIALOG ] && GTKDIALOG=gtkdialog

notselected() {
DIALOG='
<window title="ERROR" resizable="true" icon-name="gtk-dialog-error" window-position="3">
<vbox space-expand="true" space-fill="true">
<text><label>"
You must select a program before you can delete it.
"</label></text>
<button ok></button>
</vbox>
<variable>DIALOG</variable>
</window>
'
export DIALOG
eval $(gtkdialog -p DIALOG -c)
}
export -f notselected

getwscan() {
losetup -a | grep "devx"; [ $? -ne 0 ] && Xdialog --icon /usr/share/midi-icons/error.xpm --msgbox "The Devx file does not appear to be loaded.\n\nFFS load it and try again ..." 0 0
wget -c -P ${MY_PATH} http://wirbel.htpc-forum.de/w_scan/w_scan-20170107.tar.bz2
}
export -f getwscan

menuentry(){
echo '[Desktop Entry]
Encoding=UTF-8
Name=VLC TV Record
Comment=Record Television
Exec='$MY_PATH/'vlc-rec-gui.sh
Icon=/usr/share/pixmaps/tv.svg
Terminal=false
NoDisplay=false
Type=Application
GenericName=Record Television
Categories=AudioVideo;Player;Recorder;' > /usr/share/applications/vlc-rec-gui.desktop
}
export -f menuentry

about () {
DIALOG='
<window title="VLC Recorder GUI" width-request="520" height-request="250" icon-name="gtk-about" window-position="3">
<vbox>


<notebook labels="Information|Credits|Licence">
<vbox scrollable="true" height-request="300">
<text wrap="false">
<label>"
VLC is a very popular media player and it is found in many distros or
readily available for installation/download.

VLC can do most, if not all, of the functions one expects to find in an
excellent media play. VLC is also able to display and record live
television. All you need is a TV Tuner adapter and a configuration file
called channels.conf.

I have provided information in the help on how to create the
channels.conf file. This file is essential and VLC is not able to
display or record TV without it.

Unfortunately you must create your own channels.conf file as they are
not interchangeable. When using w_scan it searches for available TV
channels in your area via your TV Tuner. It is important to have good
reception and/or a good antenna to create the channels.conf file.
"
</label></text>
</vbox>
<vbox>
<text justify="2">
<label>"
This application was written by smokey01 and CatDude.

VLC TV Recorder Version 1.0
" </label>
</text>
<pixmap><input file>/usr/share/icons/hicolor/48x48/apps/vlc.png</input><height>48</height><width>48</width></pixmap>
<text justify="2"><label>"
15 July 2018
"</label></text>
</vbox>

<vbox>
<text><label>"

This software is release IAW GPLv3

A full copy of the licence is available online at:

https://www.gnu.org/licenses/gpl.html
"
</label></text>
</vbox>
</notebook>
<hbox homogeneous="true">
<button ok></button>
</hbox>
</vbox>
<variable>DIALOG</variable>
</window>
'
export DIALOG
eval $(gtkdialog -p DIALOG -c)
}
export -f about

help () {
DIALOG='
<window icon-name="gtk-help" title="VLC TV Record Help" width-request="520" height-request="300">
<vbox>
<vbox border-width="5" scrollable="true">
<text wrap="false"><label>"
VLC TV Record is a Graphical User Interface (GUI) to help you manage
your TV recordings.

You will need a copy of VLC, a USB TV tuner adaptor which can be bought
on eBay for about $10. You will also need a file called channels.conf.
This file provides VLC with the TV channel information it requires.
There are many ways to generate the channels.conf file but the one I
suggest is by using w_scan.

If you click on the Get w_scan button the source code will be downloaded
next to this script. Click on the source code file to extract it.

Open a terminal in this folder and type cd w_scan-20170107 into the
extracted folder. Make sure you have the Devx loaded.

Now type ./configure --prefix=/usr and press enter.

Now type make. Then type mv w_scan /usr/local/bin

Now you are ready to build your channels.conf file. First type cd .. to
move up a level next to the script then type the following:
w_scan -c AU -M >> channels.conf

The -c means country so substitute AU for your country. After about five
to ten minutes you should have your channels.conf file.

If you are not sure of your ALPHA2 country code, look on the site below:
https://www.nationsonline.org/oneworld/country_code_list.htm

This application makes use of Cron to schedule the recordings therefore
crond needs to be running.

This application will allow you to choose a TV channel and record it at
a pre-determined time. You can choose the folder where you would like
the recordings to be saved. This option is saved for future recordings.

You also have the option to give your recording a name. If you forget,
the default, program_name, will be used. The date and time is tacked on
the end of the filename to ensure each program is unique.

The saved video format is .ts which is the same as .mpeg. Fear not VLC
has no problems playing this back.

Once you have selected your TV channel, provided a program name,
chosen a save folder and selected your record time, click on the Add
Button. This will place an entry in the viewing panel. At the same time
a script is created which will be run at the time you specified.
This is the magic stuff that goes on in the background.

The Run-Time field is the length of the recording specified in seconds.
The default is 3600 which equates to one hour. This field must contain
an entry or your program may not record.

The comboboxes (Drop Down Menus) can be a little unwieldy if you click
on them but they work just as well if you place your cursor above them
and use your mouse scroll wheel.

Once a program has been recorded you simply delete them from the
viewing panel. Click on the program and click the Delete button.

The Watch TV button will allow you to watch live TV.

The Record Button will allow you to record whatever channel is selected
immediately.

The Stop button will kill all instances of VLC whether you are watching
or recording TV.

As most TV Tuners only have one receiver only one function can be
performed at a time. You cannot record and watch TV at the same time.
However you can record a program and watch the recorded file at the
same time as only one event is using the tuner.
You cannot record two programs at the same time. Multiple tuners may
allow this but this application does not.

Hopefully there are enough tool tips that it will not be necessary to
view this help too often.
"

</label></text>
</vbox>
<hbox homogeneous="true">
<button tooltip-text=" This will download the w_scan source code ">
<label>" Get w_scan "</label>
<input file stock="gtk-save"></input>
<action>getwscan</action>
</button>
<button tooltip-text=" This will create a Menu Entry under Multimedia ">
<label>" Menu "</label>
<input file stock="gtk-select-color"></input>
<action>menuentry</action>
</button>
<button ok></button>
</hbox>
</vbox>
</window>
'
export DIALOG
eval $(gtkdialog -p DIALOG -c)
}
export -f help

MAIN_DIALOG='
<window resizable="false" image-name="/usr/share/pixmaps/tv.svg" title="VLC TV Recorder - 1.0 " width-request="1000" window-position="1">

<vbox>
<hbox>
<menubar tooltip-text=" Help, About and Quit are under the File Menu ">
<menu stock-id="gtk-info" label="_File" use-underline="true">

<menuitem stock-id="gtk-help">
<action>help &</action>
</menuitem>
<menuitem stock-id="gtk-about">
<action>about &</action>
</menuitem>
<menuitemseparator></menuitemseparator>
<menuitem stock-id="gtk-quit" accel-key="0x51" accel-mods="4">
<action>exit:Quit</action>
</menuitem>
</menu>
</menubar>

<vseparator></vseparator>
<vseparator></vseparator>

<text><label>Programe Name:</label></text>
<entry space-expand="false" tooltip-text=" Enter a preferred Filename ">
<width>150</width>
<default>Program_Name</default>
<variable>ENTRY1</variable>
</entry>

<text><label>Save Location:</label></text>
<entry accept="directory" tooltip-text=" This is where the recordings will be placed ">
<variable>DESTFOLDER</variable>
<input file>/root/.config/vlc-rec-gui.conf</input>
<action>echo $DESTFOLDER > /root/.config/vlc-rec-gui.conf</action>
</entry>
<button tooltip-text=" Choose a location to save the file or Directory ">
<input file stock="gtk-open"></input>
<action type="fileselect">DESTFOLDER</action>
</button>
</hbox>
<hbox>

<vbox width-request="160">
<tree>
<variable>CHANNELS</variable>
'"$(station_list)"'
<label>TV Channels</label>
</tree>
</vbox>

<list tooltip-text=" This is where the scheduled programs will be displayed ">
<variable>LIST</variable>
<input file>/var/spool/cron/crontabs/'"$USER"'</input>
<action>echo "${LIST}" > /tmp/status</action>
<action>refresh:STATUS</action>
</list>

<vbox width-request="330">
<hbox height-request="280">

<tree hscrollbar-policy="2" selected-row="0" tooltip-text=" The hour the recording will start ">
<variable>HOUR</variable>
<label>"Hr"</label>
'"$HOUR_ITEMS"'
</tree>

<tree hscrollbar-policy="2" selected-row="0" tooltip-text=" The minute the recording will start ">
<variable>MINUTE</variable>
<label>Min</label>
'"$MINUTE_ITEMS"'
</tree>

<tree hscrollbar-policy="2" selected-row="0" tooltip-text=" Day of the Month the Recording will Start ">
<variable>DOM</variable>
<label>DOM</label>
'"$DOM_ITEMS"'
</tree>

<tree hscrollbar-policy="2" selected-row="0" tooltip-text=" The Month the recording will start ">
<variable>MONTH</variable>
<label>"Mth"</label>
'"$MONTH_ITEMS"'
</tree>
</hbox>

<vbox>
<hbox>
<frame Day of the Week>
<comboboxentry tooltip-text=" Multiple days EG: Mon,Tue,Wed
or a range such as: Mon-Wed. ">
<default>*</default>
<variable>DOW</variable>
<item>*</item>
<item>Sun</item>
<item>Mon</item>
<item>Tue</item>
<item>Wed</item>
<item>Thu</item>
<item>Fri</item>
<item>Sat</item>
</comboboxentry>
</frame>
<frame Run-Time>
<entry width-request="10" tooltip-text=" Specify time in Seconds ">
<default>3600</default>
<variable>LENGTH</variable>
<variable>RUN</variable>
</entry>
</frame>
</hbox>
</vbox>

</vbox>
</hbox>

<hbox homogeneous="true">
<button tooltip-text=" Watch TV right Now ">
<label>Watch TV</label>
<height>24</height>
<width>24</width>
<input file>/usr/share/pixmaps/tv.svg</input>
<action>watchtv &</action>
</button>

<button tooltip-text=" Start Recording Now ">
<label>Record</label>
<input file stock="gtk-yes"></input>
<action>runnow &</action>
</button>

<button tooltip-text=" View Recordings ">
<label>Recordings</label>
<input file stock="gtk-open"></input>
<action>rox "$DESTFOLDER"</action>
</button>

<button tooltip-text=" Stop Recording or Watching TV Now ">
<label>Stop</label>
<input file stock="gtk-no"></input>
<action>killall vlc</action>
</button>

<button tooltip-text=" Schedule a Program ">
<label>Add</label>
<input file stock="gtk-add"></input>
<action>addprog</action>
<action>clear:LIST</action>
<action>refresh:LIST</action>
</button>

<button tooltip-text=" Delete a Schedule Program ">
<input file stock="gtk-remove"></input>
<label>Delete</label>
<action>delprog</action>
<action>clear:LIST</action>
<action>refresh:LIST</action>
</button>

<button tooltip-text=" Close the VLC TV Recorder ">
<label>Quit</label>
<input file stock="gtk-quit"></input>
</button>
</hbox>

<statusbar>
<variable>STATUS</variable>
<input file>/tmp/status</input>
</statusbar>

</vbox>
</window>
'
export MAIN_DIALOG

case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac

# --------------------------------- End of script -----------------------------------------------

Psip P2P & VPN

Written by smokey01

Back in March and April 2017 I wrote about Psip (Puppy Phone) regarding it's basic use, where to get it and how to compile it.

This month I am going to explain how you can protect your privacy when using Psip. If you log into a SIP server it provides a facility where anyone can see you online so they can call, and in some cases annoy you. I don't know about you but I hate unsolicited phone calls. Using Psip in Peer2Peer mode does give you a higher level of privacy but it can be a bit difficult to set up. For you to receive and send calls you need to do a pit of port forwarding in your router, it's not for the faint hearted.

If you use a VPN (Virtual Private Network) such as N2N-Edge then port forwarding is not required. I don't profess to be an expert on N2N but I do know how to make it work with Psip as I use it nearly every day. The N2N web site.

I will try and keep this as simple as I can. There are two binaries. One is called the supernode and the other is either called edge. The supernode is basically a Telephone Operator. Remember a few years back you would call the Telephone Operator and ask to be connected to someone else. This is basically what's happening when you connect to the supernode. You do need to provide some information to the supernode so it knows what to do. The supernode does need to be active to be of any use. The supernode is a daemon. It just sits there dumb fat and happy until a connection is made from a client. The client is the other binary (edge) I mentioned earlier.
There could actually be lots of clients connected to the one supernode all at the same time, which of course is quite common. For each client to see another client they must be logged in to the supernode with the same credentials. The supernode is very clever and can handle multiple clients and networks at the same time.

The most difficult part of this is locating or running a supernode. The supernode needs to be accessible generally on the internet. There are a few public ones available but they can be a bit difficult to find. People who do gaming across the internet often use them.

Here's one I have used in the past: bytemark.leggewie.org:1234 which works quite well. No doubt you will be familiar with the normal URL (bytemark.leggewie.org). The 1234 after the colon is the port number. If you are not familiar with ports never fear as all internet software use them. Your browser normally uses port 80. FTP clients use 21 and SFTP uses port 22 and the list goes on.

Whoever runs the supernode determines the port to be used. All they have to do is specify which port the supernode is listening on like this: ./supernode -l 1234. If the supernode was in your path EG: one of your /bins you could type: supernode -l 1234 without the dot/slash.
You can choose pretty much use any port you like but do remember some are used by other applications. If you choose a port between 1024 - 65535 you should be reasonably safe. If you are not running a supernode all you need is the URL and the port number to connect which I have already provided.

To connect to the supernode you need the edge binary. Before you run the edge binary with the appropriate switches you need to make sure you have tun loaded. The best way is to just type: modprobe tun in a terminal. Some distributions always load tun while others do not. Tun simply means network TUNnel.

Let's connect to the supernode.

This script will do the entire connection for you if you are using v.1.3.2 of edge.

#!/bin/sh
# This loads the network tunnel
modprobe tun
# This line opens a terminal at the size specified. It then runs edge with the following parameters:
# -M means MTU which is the size of the packets transmitted.
# -a is your address or local IP. You can choose your own.
# -c is your community name. Why not use something applicable.
# -k is your encrypted password.
# -l is the URL where the supernode is located.
# The echo $! > /tmp/n2npid creates a file of the Process ID so we can kill everything when we are finished.
urxvt -g 108x20+0+0 -e edge -M 1000 -a "192.168.100.1" -c my-mates -k encrypt-password -l bytemark.leggewie.org:1234
#
This line runs psip with a priority of -10.
nice -n -10 /usr/bin/psip
killall edge

For others to join your network they need to use all of the same credentials except for the local IP. If it's your network then you manage the addresses. Your first friends address would be 192.168.100.2, second 192.168.100.3 third 192.168.100.4 and so on. The addresses need to be in the same range.

Your VPN and tunnel is now active.

You now need to configure psip (PuppyPhone).

You can delete the Iptel and Ekiga entries as you no longer need them. If you do need them then you need two different
/root/.psip.conf files. Unfortunately psip always looks for .psip.conf so you need to rename them manually or create a script to do it for you.

Below is an image of psip I created earlier with you and three of your buddies.



Now select the Setup button. You shouldn't need to do anything in the account section as it's not used.
The audio should be fine unless you're having problems with sound. These problems are normally fixed in your sound mixer, not psip.
Misc.Settings just make sure you have a ring tone selected so you can hear an incoming call. It must be an 8 bit wav file.

The Network area does require a little work.

Disable TCP
Disable optional SRTP
Enter your public IP Address: 192.168.100.1
Disable VAD
Enable ICE




Click on the close button and then click on the Quit button. This will ensure your settings are saved.

Providing psip is in /usr/bin/psip you should now be able to connect to the supernode with psip.
If your mates do the same with their address you will be able to see when they are online as the
red ball changes to a green ball and indicates they are online.

Enjoy.

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.

N2N Edge

Written by smokey01

Back in March 2017 I wrote about the wonderful P2P VPN and how to use it. This month I will explain how to use it with Psip (PuppyPhone).

N2N Edge comes as standard in Fatdog64 but may not in many other Pups so I guess it's a good idea to show you where to get it and compile it. It may well be available in your repository for your distro.

Go to the github page where you can download the source code. This is not latest version but I know this one works. I had problems with the version 2 series.

You will receive a file called n2n-1.3.2.tar.gz

Uncompress the file and enter the n2n-1.3.2 folder. In this folder open a terminal, press backtick key, usually above the Tab key. Make sure Rox has focus on the n2n-1.3.2 folder.

The INSTALL document will explain compilation but if you don't like reading, do this:

type: make PREFIX=/usr to compile the edge and supernode binaries or type: make PREFIX=/usr install to compile and install them.

Remember you need the devx loaded to compile.

Scripts & Code

Generally in here you will find some shell scripts or similar code.

Poor mans cron

Written by smokey01

During my research regarding cron and other schedulers like the at command I stumbled accross a neat little piece of bash code. I had never noticed the until/done commands before.

#!/bin/sh
until [[ "$(date)" =~ "Jul 25 22:52:" ]]; do
sleep 30
done
command/script


It's a loop until the month day and time are satisfied then it runs the command and quits. It only checks every 30 seconds
to see if the system time matches the credentials inside the double quotes. Naturally the frequency can be changed.

A little more bash code could be added to make it easier to input the month, day and time. I think most people would prefer
a little GUI so it could simply be clicked to run it. This method does not require a daemon to work but your computer must be running for the script to work.

The script could be used to shutdown your computer at a specified time, run a backup or just a reminder to go to bed.

Cut and paste the code into geany/text editor and save it as pmc. Now make the pmc file executable.

chmod +x /path/pmc

An easier way is to use Rox. Right mouse click on the script, select Permissions then click the Yes button.

# --------------------------------------- Code Below this line ---------------------------------------------------
#!/bin/sh
#Sat 28 Jul 22:54:59 ACST 2018
#written by smokey01 & CatDude

[ -z $GTKDIALOG ] && GTKDIALOG=gtkdialog
[ ! -d /tmp/timeit ] && mkdir /tmp/timeit

export MTH=$(date +%h)
export DY=$(date +%d)
export HR=$(date +%H)
export MN=$(date -d "now + 2 minutes" +'%M')

doit(){

[[ $HOUR ]] && HOUR=$(printf "%02d" $((10#$HOUR)) )
[[ $MIN ]] && MIN=$(printf "%02d" $((10#$MIN)) )

YEAR=$(date +%Y)
LEAPYEAR=`[ $(date -d "Dec 31, $YEAR" +%j) == 366 ] && echo "true" || echo "false";`

if [ "$LEAPYEAR" = "false" ] && [ "$MONTH" = "Feb" ] && [ "$DAY" -ge "29" ]
then
Xdialog --icon /usr/share/midi-icons/error.xpm --msgbox "Get a grip..." 0 0
else
until [[ "$(date +"%b %d %T")" =~ "$MONTH $DAY $HOUR:$MIN:" ]]; do
sleep 10
echo $MONTH $DAY $HOUR:$MIN $COMMAND
done
eval "$COMMAND"
fi
}
export -f doit

MAIN_DIALOG='
<window icon-name="gtk-preferences" title=" Poor Mans CRON " width-request="450" window-position="3">
<vbox>
<hbox>
<text>
<label>Month:</label>
</text>
<comboboxtext width-request="90" tooltip-text=" Select a Month ">
<variable>MONTH</variable>
<default>"'$MTH'"</default>
<item>Jan</item>
<item>Feb</item>
<item>Mar</item>
<item>Apr</item>
<item>May</item>
<item>Jun</item>
<item>Jul</item>
<item>Aug</item>
<item>Sep</item>
<item>Oct</item>
<item>Nov</item>
<item>Dec</item>
</comboboxtext>

<text><label>Day:</label></text>
<spinbutton range-min="1" range-max="31" range-step="1" tooltip-text=" Select the Day of the Month ">
<variable>DAY</variable>
<default>"'$DY'"</default>
</spinbutton>

<text><label>Hour:</label></text>
<spinbutton range-min="0" range-max="23" range-step="1" tooltip-text=" Select the Hour ">
<variable>HOUR</variable>
<default>"'$HR'"</default>
</spinbutton>

<text><label>Minute:</label></text>
<spinbutton range-min="0" range-max="59" range-step="1" tooltip-text=" Select the Minute ">
<variable>MIN</variable>
<default>"'$MN'"</default>
</spinbutton>
</hbox>

<hbox>
<text><label>Command:</label></text>
<entry tooltip-text=" Enter a script or Command ">
<default> Xdialog --title="Reminder..." --msgbox " Time for sleep, it is way past your bed time. " 0 0</default>
<variable>COMMAND</variable>
</entry>

<button tooltip-text=" Schedule the event ">
<label>Apply</label>
<input file stock="gtk-apply"></input>
<action>doit &</action>
</button>

<button tooltip-text=" Close the Application ">
<label>Quit</label>
<input file stock="gtk-quit"></input>
</button>
</hbox>
</vbox>
</window>
'
export MAIN_DIALOG

case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac

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.

Marking text - smokey01
Background a process - smokey01

Marking text

Written by smokey01

Have you ever had a problem marking text? You know when your mouse hand is a bit shaky and you can't quite highlight the piece of text you want to?

The conventional way is to place the mouse cursor at the start of the text, press down the left mouse key and move the mouse along the text you wish to mark/highlight then release the mouse button. Most days it's pretty easy but some days not so.

Here are two other methods that might make life just that little bit easier.

Method one.
Place the cursor at the start of the text you wish to mark, press and hold the Shift key, now move the cursor to the end of the text and left mouse click. Better for shaky hands.

Method two.
Place the cursor at the start of the text you wish to mark, press and hold the Shift key, now use the right cursor key to highlight the text from left to right. Just release the Shift and cursor key when finished.

To paste this highlighted text, place the cursor where you wish to paste it and press on the mouse scroll button. If you don't have a scroll wheel try Shift+Ins.

Background a process

Written by smokey01

I'm sure many of you know this little trick so this is for those that don't.

There are times when it's convenient to run a process in the background. One example is when running scripts within gtkdialog. If the script is executed by a button, the button will remain depressed until the script exits.

To run a process or program in the background all you do is place an ampersand after the command, EG:
In a terminal type: mtpaint &

You will notice mtpaint will run but the terminal provides some outout, see below.

Image1


Notice the number 21873. That is the PID, Process Identification. By knowing this number you can use the kill
command: kill 21873 to kill that process, in other words, close the program.

Normally when you run an application from a terminal the terminal can't be used for any thing else.
Try running mtpaint in a terminal, this time without the &. You will see this:

Image2


If you press Ctrl+c you will kill mtpaint. Go ahead try it. The cursor returns.

Now run mtpaint again with the ampersand mtpaint & and you're back to the Image1.

Notice you have the prompt which means you can do other things in that terminal. Type: ls then press enter.
You should have seen the contents of the folder.

Try a Ctrl+c and see if you can kill mtpaint. Nope, it lives because it's running in the background.

To get it back to the foreground, in the same terminal type fg. Now you see Image2 again.
Try a Ctrl+c. Oh dear it's dead.

You know how to kill a backgrounded process if you know it's PID, remember kill PID.

What if you don't know the PID? How do you kill the backgrounded process without bringing it to the
foreground first? Most pups have a command called killall. Just type: killall mtpaint.

Entertainment

The August crossword by greengeek.

Crossword

Puppy Crossword (August 2018)
(Formatted by greengeek using the "Puzzlefast" website)

GTKDialog tribute

Many of Puppy's functions can be driven by "command line" (cli) commands, but these functions can be made so much easier by the use of "GTKdialog" gui's that help us drive the command line functionality. This months crossword is a tribute to GTKdialog and it's ability to make life so much easier for the average user.
There are so many GTKdialog programs that I was unable to include them all - however - they are quite significant to Puppy's development so I have included a small portion of the variety of the GTKdialog programs and utilities that are available...

This months crossword is in two parts:

Firstly, a brain teaser:
Here is a phrase that you must decode:

19A-32A-1A-16A-25A'-9A 24A-30A-10D-14D 21D-18D-26A (22A-8D-7A) 28A-30A-33A-11D 29A-5D-4A 20D-2D-15D-23D 12A-27D-13A-3D-6A-32A-17D-31A-10D-14D

This phrase is comprised of the first letter of each and every answer that forms part of this months crossword. That means that you have to solve the crossword before you can work out what the phrase is...
The phrase might not make too much sense, but hey, I used every letter! (Special points to the first Puppian to correctly decode the "first letter" challenge!)

Here is the challenge: don't look at the answers! Try to complete the crossword yourself (using Google and forum searches) - then see if you are able to solve the "secret phrase"

Here is the crossword to solve:
(See clues below image)

(ps: if you have any suggestions for a clue theme/topic for future crosswords please let me know!)














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

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 not losing your mind.

smokey01
greengeek
Dry Falls
vovchik

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