Odds & Ends

Network Related Stuff

Interesting webpage about wi-fi network signals on:

https://www.cyberciti.biz/tips/linux-find-out-wireless-network-speed-signal-strength.html

To measure strength of wifi signal on Macbook : open a Terminal window and enter the following:

while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 1; done

Mac gives me -60 in the lounge.

(This has now stopped working. probably ‘cos Apple changed summat. Happens sometimes.

This is what happens now:

alex@Alexs_MacBook ~ % while x=1; do /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I | grep CtlRSSI; sleep 1; done

zsh: no such file or directory: /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport

Alex.23 Nov 2025)

For the Raspberry Pi, get a Terminal window up and enter:

iwconfig wlan0

Typical response could be:

pi@I:~ $ iwconfig wlan0
wlan0 IEEE 802.11 ESSID:”BTHub5-8929″
Mode:Managed Frequency:2.462 GHz Access Point: E4:75:DC:E3:E7:54
Bit Rate=39 Mb/s Tx-Power=20 dBm
Retry short long limit:2 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=45/70 Signal level=-65 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:14262 Invalid misc:137971 Missed beacon:0

45/70 and -65db is OK.

To see the Pi’s hostname simply enter at the command prompt:
hostname

To display the Pi’s internal I.P. address , enter: (that is a capital i)
hostname -I

To send that displayed answer to a file, enter:            hostname -I > /home/pi/myHostname.txt

To see stuff about signal strength on wi-fi, enter:

 iwconfig wlan0

Internet Connection Speed

See: http://blog.scphillips.com/posts/2015/05/monitoring-broadband-speed-with-loggly/
– where there is a description of how to use Loggly to draw graphs of your internet speed. 

A strip-down version (that doesn’t draw graphs) is as follows:

At the Terminal, (or in a Bash script):
sudo apt-get update
sudo apt-get upgrade
We will be needing to install a Python program, so pip is needed

sudo apt-get install python-pip

sudo pip install speedtest-cli
speedtest-cli –simpl

Bits and Pieces

To display a file use cat i.e.

cat /proc/cpuinfo

cat/etc/os-release

To see status of disk usage every 2 seconds, enter: 

sudo watch df -k

To see space used by different disks enter: df -h

To see current memory information, enter:

free -m

To find out which architecture of the arm chip you have, enter: uname -a

Bash Programming

This section contains some of the more commonly found bash expressions.

When you load terminal and type a command, it is Bash that reads and obeys it. For example if you type:

touch testfile.txt

It creates an empty file called testfile.txt in the current directory. You can use this file to get used to the context of a few Bash commands.

First enter the command (lower case LS – means list)

ls

to display a list of the current directory. Notice that textfile.txt, the file you just created is there

Try entering each of the following lines to check it out.

Send the current date and time to your new file, like so:

date > testfile.txt

Now read the file, and display it’e contents, comme ça:

cat testfile.txt

Create a variable called pointerfile, and make it equal to the contents of the file testfile.txt by using the $ symbol, like in the following line: (Watch out to get the space after cat, and no spaces either side of the =)

pointertofile = $(cat “testfile.txt”)

(the inverted commas surrounding testfile.txt mean that it is a real word and not a variable). Now if we do:

echo pointertofile

we would have printed simply pointertofile. But if we were to use the $ in front of pointertofile, like this:

echo $pointertofile

we would get the contents of pointertofile printed. So $ means ‘contents of’ and a word surrounded by “ means this is a string and not a variable.

next delete a file by using the rm . (lower case RM – means remove)
rm testfile.txt

now we can use the ls command again to make sure it has indeed been deleted. (lower case LS)

ls

Website

To recover a forgotten phpmyadmin password . .
 At command line, enter:
nano /var/www/html/wp-config.php
and the DBUSER and DBPASSWORD are there in clear near the top !
From there you can access the database and create a new user password etc.
to enable you to log into the website’s Dashboard (or control panel).
phpmyadmin’s address is :
localhost/localhost/wordpress | phpMyAdmin 4.6.6deb4