Using an SSH key pair is my perfered method of authenticating with a server, such as web hosting.
From the command line:
ssh-keygen -t rsa -b 4096 -C "my config description"
-t rsa: Specifies the type of key to create (RSA)
-b 4096: Specifies the number of bits in the key
-C An optional comment to describe the key
2 files will be generated, a private key and a public key (.pub extension). The public key is used on the hosting site. The private key is never shared.
Files can be edited with a...[more]
AI is everywhere. I've even started asking ChatGPT for solutions rather than visiting Google. GPT may not always be bang on, but it's (for me, at least) usually more bang on than an aggregation of results based on key words and overall page rank.
The science behind Artificial General Intelligence (AGI) fascinates me. On one hand, I have no idea where to begin my thought process. On the other, it makes sense that the human brain is a pretty reasonable starting point. But, and it's a big but, is that over-...[more]
Dev log - Development started December 2022
Oops. Appears I have a problem with the high score table. Investigating.
May 2023 - modifications
Added touch control - can now be played using a mobile phone / tablet etc.
Removed the high score table for touch control - too much faff for selecting the characters when entering your initials
Touch control uses localStorage for saving the high score
Lightened the playership's colour to avoid clash with environment - better for mobile play
Raised the st...[more]
I love playing Minecraft. It's my switch-off after a busy day.I don't tend to play it as it 'should' be played (i.e. fighting my way to the end and defeating the Ender Dragon) but I do always play in Survival Mode. Where's the fun without a challenge, hey?
So, my main aim when playing Minecraft is to create a village. Sometimes villages become towns and on the odd rare occasion they become quite a bit bigger after weeks of modifications.
I recently started a new world and walked, swam and rowed around 40,...[more]
If the conditions for life on Earth are not as extraordinary as we think they are, is it possible that mammals would never get a chance elsewhere in the Universe and we have intelligent dinosaurs roaming around on other planets?
This is the kind of thing that keeps me awake at night.
I've always loved the original DOOM games. I was in my early 20s when the first one hit and it hit hard. I can still remember seeing it running on a PC during a night shift and instantly diving in to have a 'go'.
The fact that the whole thing moved and moved quickly struck me as nothing short of witchcraft. How on earth is this possible? PC games up to that point (I'd never encountered id's previous titles) were, for me, the domain of platform games and worthy flight simulators. To be running down corridor...[more]
Take a look at the moon and you'll always see the same 'face'. But surely the moon rotates on its axis? And what of this so-called 'dark side of the moon'.
I had to find an answer for this as it's the sort of thing that bugs my brain as I'm driving home at night.
The moon rotates. That is a fact. But it completes one rotation in pretty much the amount of time it takes to circle the Earth. Approximately 27.3 Earth days.
The Earth completes one rotation on its axis every 24 hours. At least, that's how lo...[more]
In short, no.
This stuff fascinates me and since reading Prof. Brian Cox's Human Universe, I've wanted to pursue it a little.
It seems to be a common misconception that we are descended from the ape family because we appear to have common traits: be-pedal, thinking, dexterous etc. This would imply that apes, as we see them today, have been around for millions of years and that humans evolved from them.
The reality is that humans share a common ancestor with today's apes. Quite what that common ancestor...[more]
Sometimes refered to as file path traversal.
I have become fascinated with the techniques attackers may use to discover web server directories and files. Specifically, of course, those directories and files that are not intended to be obvious.
A simple look at robots.txt in the root directory may unearth some resources that aren't meant to be viewed. By virtue of the fact they are listed in the .txt file the website owners don't want search engines indexing them. This is all above board and I'...[more]
I recently created a small project to capture the URL of sites that have referred to my own website.
Interestingly it seems that search engines have suppressed the query string part of the URL.
e.g. for the URL
https://www.google.com/search?client=firefox-b-d&q=wilfs+corner
I would expect to be able to capture this in its entirety using PHP's
$_SERVER["http_referer"]
What is actually sent from the search engines is just the root domain. e.g. https://www.google.com/
Frustrating but then ...[more]
As an extension to my 'referer' project I also capture the IP address of the client as they arrive at my site using
$_SERVER["REMOTE_ADDR"]
I thought it would be an interesting exercise to see if I could do a reverse lookup on the IP address to identify any A (address) records held in each case.
I found a useful and free service at ipwho.is.
Using PHP's cURL is was able to provide any IP address and return some cool data.
$id = $_POST["id"];
$ip = $_POST["ipaddress"];
$ch = curl_init('h...[more]
The whole concept of Promises in JavaScript I have always found useful. The action is handled asynchronously and the result is either a resolution 'resolve' or a rejection 'reject'.
Where it started to mangle with my brain cells is with the async/await functionality introduced in later versions of ECMAScript.
A simple JavaScript Promise can be defined as below:
const myPromise = new Promise((resolve, reject) => {
// Simulate an asynchronous operation (e.g., fetching data from a server)
s...[more]
December 12th 2023
> Added a screen to estimate your daily points allowance
> Fixed points values to use decimals. i.e. you can now specify 4.5 as a value.
> Added "I know the value" to allow for manual input of points values.
A few years back (not that many years) I fulfilled I lifelong goal to write, illustrate and publish a children's picture book.
That first book was called A Frog Named Bob and told the story of a young frog who didn't know what sound he should make. So, to find out exactly what sound a frog should make he hopped around his animal friends to see just what sound they made.
Of course, a neigh, a moo, an oink or a bleet weren't going to cut it so Bob pretty much gave up. Until that is, a girl frog sat be...[more]
A list of things I really need to get a handle on. Some I'm used commercially and some I haven't.
* React (probably my priority as it focuses on the V bit of MVC)* Vue (I like the idea of this one's simplicity)* Angular (probably a bit more involved as it is a full client-side MVC endeavour)* Laravel (the go-to framework for PHP MVC support)* Python (probably the lowest priority; more intrigue)
I'm very much a vanilla guy. The HTML, CSS, PHP, JavaScript that I write is done without libraries (excluding, j...[more]
Not much to do on a bank holiday Monday so I took myself off to Repton to (finally) go and see the 7th century church of St. Wystan.
I'd always been fascinated by the fact that the Vikings had raided and laid waste to much of the place, but ultimately there's so much more to the church and the settlement of Repton in general.
Repton is situated in the heart of the ancient kingdom of Mercia. As many notices around the town will tell you it was, in fact, the kingdom's capital. But that all changed fol...[more]
I have always wanted to expand my Vintage Points Calculator to allow for people to sign in and record their points progress.
To that end I've started to put the framework in place to allow for registration. The features will be fairly simple:
Record daily points against allowance
Use points bank for 'over-spilled' daily points
Administer daily points and bank amounts
Password recovery
The registration code is around 90% complete. Update: no complete and tested The authentication code is 100% ...[more]
I use MySQL a lot. I run it locally using MAMP for a ton of data projects that never find their way online.
My current development project involves a one-off operation to insert 1,000,000 rows of data to a small table. The table has 2 indexes - a Primary Key and a specific index on 2 columns.
The project is driven by JavaScript that then AJAX's out calls to PHP which runs the database operation.
The actual project is a pixel scanner which uses HTML5's Canvas API to examine a pixel, determine its RGBA val...[more]
Updates to the Vintage Points Calculator are now live - Vintage Points Calculator.
1st August 2023
You can now request a new password - an email is sent out to you with instructions for changing your password
29th July 2023
Created ability to create an account to store points progress
Fixed rounding issues on calculation - occasionally threw an error where there was no rounding required i.e. integers passed rather than floating point
Created admin page to allow for manual adjustment o...[more]
I asked ChatGPT the above question to help me with some research.
Both bcrypt and Argon2 are secure password-hashing algorithms supported by PHP's password_hash function. They are designed to hash passwords securely and protect against brute-force and rainbow table attacks. Here are the key differences between bcrypt and Argon2:
Algorithm and Security Strength:
Bcrypt: Bcrypt is an adaptive password-hashing algorithm based on the Blowfish cipher. It is a widely used and battle-tested algorith...[more]
Player's ship changing direction
I have a few issues with the way the player's ship changes direction.
In the original Defender the ship simply switched to face in the opposite direction and the ground and player ship shifted accordingly until the ship was in the exact opposite x co-ordinate.
The way I have it at the moment isn't quite right and the ship 'swings' far too much. Needs some closer attention as currently it's fairly maddening to 'swing' and ...[more]