Starbeamrainbowlabs

About

Hello!

I am a computer science student who is in their second year at Hull University. I started out teaching myself about various web technologies, and then I managed to get a place at University, where I am now, though I'm currently on an industrial placement. I currently know C# + Monogame / XNA (+ WPF), HTML5, CSS3, Javascript (ES6 + Node.js), PHP and a bit of Python. Oh yeah, and I can use XSLT too.

I love to experiment and learn about new things on a regular basis. You can find some of the things that I've done in the labs and code sections of this website, or on GitHub. My current projects are Pepperminty Wiki, an entire wiki engine in a single file (the source code is spread across multiple files - don't worry!), and a Prolog Visualisation Tool, although the latter is in its very early stages.

I can also be found in a number of other different places around the web. I've compiled a list of the places that I can remember below.

I can be contacted at the email address webmaster at starbeamrainbowlabs dot com. Suggestions, bug reports and constructive criticism are always welcome.

Blog

Blog Roll | Article Atom Feed


Latest Post

How to update your linux kernel version on a KumSufi server

(Or why PHP throws random errors in the latest update)

Hello again!

Since I had a bit of a time trying to find some clear information on the subject, I'm writing the blog post so that it might help others. Basically, yesterday night I updated the packages on my server (the one that runs this website!). There was a PHP update, but I didn't think much of it.

This morning, I tried to access my ownCloud instance, only to discover that it was throwing random errors and refusing to load. I'm running PHP version 7.0.16-1+deb.sury.org~xenial+2. It was spewing errors like this one:

PHP message: PHP Fatal error:  Uncaught Exception: Could not gather sufficient random data in /srv/owncloud/lib/private/Security/SecureRandom.php:80
Stack trace:
#0 /srv/owncloud/lib/private/Security/SecureRandom.php(80): random_int(0, 63)
#1 /srv/owncloud/lib/private/AppFramework/Http/Request.php(484): OC\Security\SecureRandom->generate(20)
#2 /srv/owncloud/lib/private/Log/Owncloud.php(90): OC\AppFramework\Http\Request->getId()
#3 [internal function]: OC\Log\Owncloud::write('PHP', 'Uncaught Except...', 3)
#4 /srv/owncloud/lib/private/Log.php(298): call_user_func(Array, 'PHP', 'Uncaught Except...', 3)
#5 /srv/owncloud/lib/private/Log.php(156): OC\Log->log(3, 'Uncaught Except...', Array)
#6 /srv/owncloud/lib/private/Log/ErrorHandler.php(67): OC\Log->critical('Uncaught Except...', Array)
#7 [internal function]: OC\Log\ErrorHandler::onShutdown()
#8 {main}
  thrown in /srv/owncloud/lib/private/Security/SecureRandom.php on line 80" while reading response header from upstream, client: x.y.z.w, server: ownc

That's odd. After googling around a bit, I found this page on the Arch Linux bug tracker. I'm not using arch (Ubuntu 16.04.2 LTS actually), but it turned out that this comment shed some much-needed light on the problem.

Basically, PHP have changed the way they ask the Linux Kernel for random bytes. They now use the getrandom() kernel function instead of /dev/urandom as they did before. The trouble is that getrandom() was introduced in linux 3.17, and I was running OVH's custom 3.14.32-xxxx-grs-ipv6-64 kernel.

Thankfully, after a bit more digging, I found this article. It suggests installing the kernel you want and moving one of the grub config file generators to another directory, but I found that simply changing the permissions did the trick.

Basically, I did the following:


apt update
apt full-upgrade
apt install linux-image-generic
chmod -x /etc/grub.d/06_OVHkernel
update-grub
reboot

Basically, the above first updates everything on the system. Then it installs the linux-image-generic package. linux-image-generic is the pseudo-package that always depends on the latest stable kernel image available.

Next, I remove execute privileges on the file /etc/grub.d/06_OVHkernel. This is the file that gives the default installed OVH kernel priority over any other instalaled kernels, so it's important to exclude it from the grub configuration process.

Lastly, I update my grub configuration with update-grub and then reboot. You need to make sure that you update your grub configuration file, since if you don't it'll still use the old OVH kernel!

With that all done, I'm now running 4.4.0-62-generic according to uname -a. If follow these steps yourself, make sure you have a backup! While I am happy to try and help you out in the comments below, I'm not responsible for any consequences that may arise as a result of following this guide :-)


By on

Labs

A night sky full of pretty twinkling stars.
Starry Sky
A small gem I found in my archives. From 2013.
Archives: Colour Picker
A bicycle riding through some procedural scrolling parallax hills.
Parallax Bicycle
A procedural castle generator I wrote for /r/proceduralgeneration
Procedural Castles
A pen I created as a demo whilst writing a class to draw regular shapes.
Rotating Shapes
A pen I created as a demo whilst writing a class to draw smooth lines.
Smooth Lines
A small experiment to get my head around how fractals work.
Fractal Shapes
An example of context.ellipse in action, written for a blog post.
Ripples
Get all the fun of the fair without the noise and the cold.
Big Wheel
Some treasure is hidden on your screen. Can you find it using only your ears?
Audio Treasure Hunter
A Voronoi Diagram Generator
Voronoi Diagrams
A random snowflake generator
Snowflake Generator
A fully functional wiki in a box.
Pepperminty Wiki
Some clouds drifting across the screen, drawn via the HTML5 Canvas.
HTML5 Canvas Clouds
A turtle based drawing program for your first forays into simple programming.
Imaanvas
A client side online tool for stitching strings of still images into an animated gif.
Gif Renderer
A set of parallax scrolling stars using the HTML5 Canvas
Parallax Scrolling Stars
An (almost) pure CSS spotlight demo.
(Almost) Pure CSS Spotlight
A Javascript Bookmarklet to fade the unimportant parts of a page. Also features HTML5 fullscreen API integration.
Lightsout
A small script to trianglify (draw triangles on) an image.
Image Trianglifier

Code

The one and only C♯ class generator. Tired of typing the same old scaffolding out all the time? Give this tool a try.
Cscz
A class modelled on StreamWriter that makes it easy to generate CSV files.
CSVWriter
A web based tool that generates diagrams based on Prolog traces.
Prolog Visualisation Tool
A command line tool to generate random noise, written in C#
Noisebox
A (hopefully) better traceroute utility written in C#
TraceRoutePlus
An easier way to generate XML.
Simple XML Writer
A PHP based Atom feed generator.
PHP Atom Generator
A simple CodeMirror based javascript bookmarklet editor.
Bookmarklet Playground

Tools

I find useful tools on the internet occasionally. I will list them here.

Brackets
ConEmu
WinSCP
7zip
Bfxr
I'm Only Resting
HxD
DCPicker
Art by Mythdael