Total eclipse of the sun.

Way back in March 2006 (29th to be precise) I was lucky enough to witness one of the most spectacular events seen anywhere on the planet. I was in the Turkish seaside town of Kaş and this is what I saw. It’s quite eerie and the drop in temperature during totality was quite significant

I had to go looking for one of my old websites on the wayback machine to find the images. That cost me hours of my time reading & reminiscing but well worth it just to find these images again. The original memory card & hard drive having gone to the digital graveyard a long time ago.

Installing PHP onto your NginX server

Our web server is currently pretty useless at the moment so let’s make it a bit more useful.

Enter the following command into your terminal.

sudo apt-get install php7.3-fpm php7.3-mysql php7.3-xmlrpc php7.3-curl php7.3-gd php-imagick php7.3-imap -y

Now we need to enable php in NginX. To do so we need to make some changes to the NginX settings, Type the following command into your terminal to edit the settings file.

sudo nano /etc/nginx/sites-available/default

Find the line that contains the following

index index.html index.htm index.nginx-debian.html;

Edit the line so it looks like this

index index.php index.html index.htm;

Now scroll down to find the section that begins with something like this

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
# location ~ \.php$ {

Edit the section so it looks like this

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
        include snippets/fastcgi-php.conf;

#       # With php-fpm (or other unix sockets):
        fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
#       # With php-cgi (or other tcp sockets):
#       fastcgi_pass 127.0.0.1:9000;
}

Now you can save the config file (ctrl-s ctrl-x) and tell NginX to reload it with the following command

sudo service nginx reload

You should now create a simple PHP file to check if the setup is working correctly. To do this, type in the following command.

sudo nano /var/www/html/index.php

You need to now add the following code to your newly created file:-

<?php phpinfo(); ?>

Now save the file (ctrl-s ctrl-x)

Finally, you can now view your dynamically created web page by entering the IP address of your server (the one you noted when you installed NginX) into your browser. If you have forgotten it, you can enter the command

ifconfig

again and locate the IP address on the line that starts with inet. The IP address should start with 192.168. Entering this IP address should now show you a page something like this.

This shows PHP is installed correctly

Prev < Build a Raspberry-Pi Webserver

Build a Raspberry Pi Web Server

So you’ve bought a Raspberry Pi and you are now struggling to find something to do with it after learning how to flash the
LEDs.

How about building a home web server to run one or more websites. It’s not as difficult as it sounds and is a great learning
process.

This site and others are being hosted on a Raspberry Pi 3B+ running WordPress on an NginX web server.

The first thing you will need is to do is install Raspberry Pi OS onto your SD card (I use Debian). Full instructions can be found on the official Raspberry Pi OS Downloads page.

Install NginX

Let’s begin by installing & setting up our web server. For this I will be using NginX (pronounced Engine-X) Open Source as the server (you could use another server such as Apache but I think NginXis better suited to the RPi). NginX can serve HTML pages over HTTP but we’re more interested in the dynamic content served up by WordPress via the PHP scripting language (more of this later).

Right so to install NginX onto your RPi enter the following command on your RPi Terminal.

sudo spt-get istall nginx

Now we start the server with the command

sudo service nginx start

You can now test your server by entering the IP address into a web browser. The IP address of my server is http://192.168.0.32, to find the IP address of your server, enter the following command into your terminal.

ifconfig

You will be presented with 1 or more blocks of text. Find the line that starts eth0: This is your ethernet connection and will contain a line beginning inet, this is your IP address and should start 192.168, Make a note of this address as you will need it again later.

When you enter your IP address into the browser you should see the following page.

Configuring NginX

With our server up and running, we need to do some configuration to optimise the server’s performance.

First lets open up the configuration file using the following command in the terminal.

sudo nano /etc/nginx/nginx.conf

Any line in this file beginning with a ‘#’ is commented out. When you see the word ‘uncomment’ in the instructions below, that means remove the ‘#’ from the start of the line.

  • The maximum allowed connections is 1024 so we should change the worker_connections line to worker_connections 1024;
  • Uncomment the multi_accept line & change it to multi_accept on;
  • NginX will log every access to the server. If you don’t want huge log files you should turn this off. Change the access_log line to access_log off;
  • Uncomment server_tokens and change it to server_tokens off; to stop the NginX version number being sent out in errors & headers.
  • Change the number of seconds an idle connection will be closed after by changing the keep alive timeout to 10 like so keepalive_timeout 10; This will force an idle connection to close after 10 seconds.
  • Add the line client_max_body_size 16m; to allow for pages with lots of images.
  • Uncomment the gzip_vary line and change to gzip_vary on; to tell proxies to allow gzipped and regular files to be cached. This stops non-gzip capable clients trying to render gzipped files.
  • Uncomment the gzip_proxied line and change it to gzip_proxied any; to force all gzip to compress all proxy responses.
  • Uncomment the gzip_comp_level line and change it to gzip_comp_level 5; to give an optimal compression ratio while not adversely impacting CPU usage too much.
  • Uncomment the gzip_http_version line and change it to gzip_http_version 1.1; to ensure both http/1.0 & http/1.1 files are compressed.
  • Add the line gzip_min_length 256; next so we don’t try to compress files smaller than 256 bytes.
  • Finally replace the gzip_tipes line with the following to add missing MIME types.
gzip_types application/atom+xml 
     application/javascript 
     application/json 
     application/rss+xml 
     application/vnd.ms-fontobject 
     application/x-font-ttf 
     application/x-web-app-manifest+json 
     application/xhtml+xml 
     application/xml 
     font/opentype 
     image/svg+xml 
     image/x-icon 
     text/css 
     text/plain 
     text/x-component 
     text/javascript 
     text/xml;

This will make sure all the listed file types are compressed along with the html types.

Save your changes by pressing <ctrl-s> then quit nano by pressing <ctrl-x>. Now type the following into the terminal to test the integrity of your changes.

sudo nginx -t

If everything is ok type the following into the terminal to restart your server.

sudo service nginx restart
Next > Install PHP

Lobscouse (AKA Scouse)

This is a dish I have eaten regularly since a child and is most welcome on a cold winter night.

Ingredients
Serves 4-6

  • 1/2 pound of stewing steak
  • 1/2 pound of breast of lamb
  • 1 large onion
  • 1 pound of carrots
  • 5 pounds of potatoes
  • OXO cubes (beef stock cubes)
  • 2 teaspoons of vegetable oil
  • Salt & Pepper
  • Water

Cooking Instructions
Cooked slowly for approx. 4 hours

Dice the meat into large cubes & lightly brown in the vegetable oil.

Place meat into a large saucepan, chop onion into large chunks and add to the meat. Add sliced carrots and 1 pound of finely chopped potatoes.

Half fill saucepan with cold water and then crumble the stock cubes into the water. Add salt & pepper to season.

Simmer for 2 hours, stiring occasionally. Peel the remaining potatoes and chop roughly, add these to the saucepan and simmer for another 2 hours.

Serve hot with crusty bread.

The Scouse can be made in advance and kept covered & refrigerated for up to 2 days and reheated in a saucepan. The dish usually tastes better after being reheated.

Menemen (Turkish Omelette)

This is a recipe I picked up on my travels to Turkey. Both myself and my wife really enjoy this dish and have served it to guests on numerous occasions.

Ingredients
Serves 2-3

  • 6 large eggs
  • 1 medium onion
  • 1 pound skinned chopped tomatoes (or 1 tin chopped tomatoes)
  • 4 ounces mild green chilli peppers
  • 1 ounce margarine/spread (oil doesn’t work so well but can be used if nothing else)
  • 1 teaspoon ground black pepper
  • 1 hand-full chopped parsley
  • salt for seasoning
  • water

Cooking Instructions

Peel and finely slice the onion. Remove most (but not all) of the seeds from the chillis then slice them into rings, keeping as many seeds as required for hotness.

Melt the margarine into a large frying pan then add the onions & chillis. Sweat the onions until they become soft.

Add the tomatoes and allow to reduce (at a fairly high heat) for approx 10 minutes.

While the tomatoes are reducing, beat the eggs with the salt and pepper.

When there is almost no liquid left in the tomatoes, add a small quantity of water and the beaten eggs.

Stir the mixture until the eggs have all firmed up and the dish is ready to serve with crusty bread and a fresh Parsley garnish.

How to become a better Super-Villian

  • Don’t put a self-destruct button in your base, it’s only asking for trouble. Ever notice that any idiot who tries to blow everyone to hell always fails. There is no need to blow everything up. If you’re that paranoid and you absolutely must have a self-destruct, make it instantaneous. Why would you have a 5 minute countdown for a bomb?? If you need to blow it all to hell, make it quick: have a button that instantly triggers a nuclear bomb. No pussy explosions. That way, even if the hero somehow miraculously survives (WHICH HE WON’T), he’ll die of radiation poisoning eventually.
  • Don’t build a seaside base. You’re only asking to have a 3-way attack on you- air, land, and sea. Build your evil fortress deep underground, preferably under a mountain. This way, only a direct attack on your front door is possible, minimizing the threat.
  • Make your base impregnable. Have one way in, one way out, and one trash chute. The trash chute is optional but if you really must have one make sure if leads directly to an industrial shredder, you know the ones used in a breakers yard. Just make sure it’s permanently running and has a self contained power source with NO off switch of any form.
  • Never tell anyone your complete plan. No one needs to know all the details except you. Make sure information is on a need to know basis. This prevents leaks in the system.
  • Forget the trash compactor. Every time a hero stumbles into a trash compactor, there’s always enough time to get out. As mentioned above, use a car body shredder and for added spice, make sure the edges are rounded so there is nothing to grip on to & ensure everything is greased daily, including the walls. You may lose a few minions during the process but they’re expendable right.
  • Set an example. If you ignore tip #4 and a leak gets out, show no mercy. Show each and every member of your organization the death of whoever is responsible for the leak. Throw him in the shredder.
  • Kill on sight. Don’t waste time with an elaborate torture machine. Shoot heroes in the head. Not the chest, the head. Even heroes wear body armour. Wait until you see his brain splattered everywhere then dump his body in the shredder so that future heroes can’t find his gizmos.
  • Right before you kill, DO NOT reveal your secret plan to the hero. Even if he dies, chances are he’s wearing a transmitter. This compulsive need to let someone know the plan has brought down many a super villain.
  • Think big yet simple. Instead of some dumb ass intricate plan to seize the world’s largest cubic zirconia to fuel a laser to melt the polar ice caps and lower beach side property value, thus making it easier for you to buy the entire nation of Kerplunkenstein, make it more realistic. Carpet-bomb Europe. All of Europe. Then demand the surrender of the human race. See? Simple, yet effective. Matter over mind.
  • Don’t hire specialized goons. Oddjob, Jaws, Mayday, Xenia Onatopp, Pussy Galore… every one of those either died or betrayed the villain. Specialized goons are overrated.
  • If you must have a centralized control room in your evil base, DO NOT have large air ducts leading to it, especially ones big enough for a hero-sized creature to crawl through. In fact, don’t have them anywhere in your base. Heroes like to crawl around in the ventilation system.
  • Stockpile Kryptonite. Superman could drop by at any time. In fact, give every bullet a Kryptonite tip. Line the walls with it.
  • Don’t underestimate a strike force of only four people. As a heroic rule, the fewer people there are, the better chance they stand. I can’t explain this. When four women invade your lair, be as ruthless as you would if four thousand men did.