Skip to content
    • About

Reza Snowdon's Blog

  • ER6F complete fork rebuild

    April 27th, 2026

    I noticed a bit of a clicking sound when the front of my bike was depressed down hard. So after asking about it on a forum, the recommended action was a rebuild of the forks and new fork oil. So at the behest of the Kawasaki boffins, I did just that.

    Replacing the fork oil fluid is something that needs to be done on the front forks of a motorcycle at some point (depends on the bike and usage) and the bike had a lot of travel and I would not be surprised if it had never had an front fork oil change before.

    This was probably one of the most expensive jobs I’ve done in that so many different tools were needed. The rest of this post is just notes on pain points and by no means a complete guide – check out youtube there are plenty of great videos that at worst get you 90% of the way and if all is well 100%!.

    If anything here doesn’t make sense, just post a comment and I will get back to you.

    Pushing the front of the bike

    First of all, the bike has no centre stand which is typical on ‘sporty’ bikes so to get the bike up on it’s front so the wheel and forks could be removed, a separate stand is needed. I opted for the Abba stand and although it is a bit of a pain to set up, it held the front end of the bike up.

    I did not trust it completely though, it works by clamping into the frame itself and I’ve found if it’s not set up precisely a knock can easily displace it. I positioned the bike under a metal girder down the center of the garage. I used some cargo straps wrapped around the triple tree as an insurance policy in case the stand gave way for any reason (thankfully it didn’t and the stand did its job). I struck lucky with this as my garage has a big metal girder down the center.

    Removing a fork

    Removing the wheel is straightforward, nothing much to say but when it comes to removing the fork cap, it may be a two person job with one person holding the stem and another twisting the top cap. Once removed, put the fork on its side and spray some wd 40 in between the gaps leave it to soak in for 20 min or so. Then, have one person grab the stanchion with two hands and ask another person with a socket wrench to undo the top.

    Draining old oil and inspecting the bushings and seals.

    Seperating the fork

    The stanchion (silver inner tube) and fork leg (golden part) are connected with a damper rod. To remove this you need to remove the bolt at the bottom. However, it’s not that easy as just twisting. You need an additional tool that looks like a fire poker called a fork damper rod holder. These are not a one size fits all and you need to get one for your bike that fits the damper rod. They are expensive for what they are and don’t be surprised if you find yours is £60.

    This bolt was really stuck in place and not just that it’s far up enough in the fork that a standard allen key will need the longer end in contact with the bolt, leaving you with little leverage to twist the bolt off.

    As a work around a slim socket and a breaker bar was used to provide some leverage. So holding the damper rod holder and pushing the breaker bar down while the fork was in a vice did the job. So once that’s done you can separate the two and see the state of things.

    Bushings are well worn and all that was disposed of. and a full new set of bushings and seals was applied.

    Final pain point – seating the new bushing (bronze one in the image above)

    Youtube videos will have you thinking that getting the top bushing in is just hitting it with a fork seal and this bushing will go into place.

    No, not at all. Mine was an absolute pain and needed to be pushed together with two screwdrivers from the top of the bushing down so that the bushing was pushed together (closing the gap) and down into the fork so that it was seated just a few mm into the fork.

    At the same time screwdrivers and fork stanchions are not great companions and if there are any nicks caused by a screwdriver in the stanchion you can find that the new rubber fork seals will get shredded. To help prevent this I placed electricians tape around the screwdriver ends to help stop this occurring. Using a rubber hammer I tapped around the bushing to get it seated.

    Once that was done the fork seal driver came down. People make a fuss about using but you can get a universal one from ebay for £11 and it’s definitely worth it.

    I didn’t enjoy this job, I did need quite a few tools in order to do this, so I probably spent around £500 just on tools but I’ve got those tools now so anything else needed, I’ve got them.

    • Abba stand (with rear lift)
    • Fork seal driver
    • Fork rebuild kit
    • Dampner

    I hope this helped if you have similar issues. Here we have the er6 all put back together again with fresh new oil and seals and bushings. The only thing about this task was that looking back it would have been much easier to just put it into a shop and have them do it for probably cheaper than the cost of all these tools but as always the knowledge I’ve gained is valuable and rewarding in its own way.

  • Implementing the Onion Software Architecture in C++ using ModernCPPStarter

    October 10th, 2025

    I’ve become interested in the onion architecture these past few months after having a discussion about software architectures and decided to try and improve my understanding of the architecture by implementing it from scratch using the ModernCPPStarter project was used as a basis for this project.

    This should help as a springboard for future projects as you can jump straight in with a c++ project template that has the onion architecture implemented.

    The current functionality is straightforward: get a list of all users and images associated with their profile from a Sqlite database.

    There is also a docker image and devcontainer so if you open this in vscode you should be ready to go.

    There is a makefile too with commands to build, run, test and clean the project.

    If you would like to use this template check out: ModernCppStarterOnionArchitecture

    Any contributions to the project are welcome.

  • Rapid Prototyping with Limited Resources

    September 9th, 2025

    Do you prefer to take your time and write software carefully or get it done as quickly as possible?

    A Questioner

    I know the model answer would be something along the lines of take your time and carefully consider everything, consult colleagues, check best practices but in practice, it depends.

    If it’s a small demo or an experiment, quick and dirty is fine but the moment it even approaches the medium to longer term, the careful and considered approach coupled with a good cadence is the go to (and typically the default). The quick approach is good for a little while and then technical debt quickly creeps in and the time is paid back exponentially for the earlier action along with the pain for good measure.

    It’s interesting and fun to go this route in the form of a hackathon which i occasionally do over a weekend. It challenges the mindset and the exercise I enjoy most out of it is the definition of the project and stripping back as much as you can. How can we make it simpler? What can we strip out or reduce? Do we need this? When it involves hardware, finding parts in your existing inventory and working around it also proves an interesting challenge.

    Track in a box – a box with buttons and a mic for timekeeping

    Track in a box came about when during a chit chat with a colleague a few years ago where we discussed how much easier it would be if we had a physical device we could start and stop common tasks rather than the steps in the web UI provided by the timekeeping software (Timecamp).

    We tracked our time pretty closely but typically we got calls, interruptions and all sorts so stopping and starting the tracker was a hassle and something we did frequently.

    It got me thinking that it should be easy to implement something with a few buttons and then maybe a voice to text if the tool has an API. Sure enough, it did have an API and I after getting fired up about the idea, decided to spend the weekend making something. The challenge would be to have something by Monday that we could try out in the office.

    Making it

    Planning

    Planning was short and consisted of – what libraries/services does this thing need and do I have the key components. Do the voice to text and timecamp api work?

    Software

    The timecamp api is really straightforward and easy to use. It was a breeze to set up and do simple calls to start and stop timers as well as assign them to a task. Google also has an API that doesn’t need authentication for audio to text so that was easy to implement too. You can assign descriptions to activities so pressing a button and dictating it seemed like a great idea. The only thing was keeping in mind that there was a limited time, this was an experiment and always to keep it as simple as possible while still being useful.

    Hardware

    Hardware was a bit more tricky, I had a raspberry pi and a mic and some arcade style buttons but no enclosure and the mic did not fit the raspberry pi as it was a sterio audio cable. This came up in a conversation with my girlfriend and as she displayed an ever so slight interest, I promptly recruited her to help me! An arts and craft shop and a mobile phone shop sorted the enclosure and adapter issues and she took on the marking and drilling of the holes in the wooden enclosure – amazing! Only basic minimal soldering was done on the buttons.

    Restraint

    It’s innate to try to improve and thoughts relating to making the enclosure smaller, using WiFi instead of wired, adding a battery so you did not need to plug it in etc. All that stuff just needs to be put to one side or the project would not be doable within the time frame. It’s an exercise in resourcefulness and the kind of approach someone may take in a situation where time and resources were low.

    The result

    It was definitely the result of a hackathon – a wooden box with buttons on and a rats nest of cables with a single board computer nestled in. A microphone perched on the corner of the box:

    Showing up on Monday, my colleague was startled what had been put it together and we had some fun putting it through its paces.

    It was a fun experiment and I had something that worked which was the main goal. I ended up ironing out some bugs later on (mainly related to interrupt timings and recordings) but enjoyed using it and it removed some of the difficulties of time keeping. All the code can be found here in the track in a box repository on Github. Overall – refreshing, fun and interesting. It’s great to see something working in such a small time frame and putting all concerns about longevity to one side. If you haven’t done a hackathon already, find yourself an idea and build it. Most important of all be sure to have fun!

  • Developing software with an AI assistant

    July 16th, 2025
    Sheepdog herding sheep (by Veronica White)

    Many of us have used things like Chat GPT for help with a range of things and in some cases it does a good job with making mundane tasks relating to text generation and summation quickly.

    This also translates across to software development where these assistants can help with programming, whether it’s generation, checking things over or debugging. I’ve asked about the occasional snippet from Chat GPT but I’ve not really used it extensively while programming. Recently I started a personal project with the specific intention of using an AI programming assistant to see how things go with the hope that it would accelerate things. This post covers my initial experience working with it.

    Getting started

    VS Code is my IDE of choice which has an assistant called copilot built in. It’s developed by Microsoft and requires a Github login in order to use it. Copilot appears well integrated to VS code and it can make changes to files without having to manually copy and paste from the chat and can read in files for context when making requests.

    What it like?

    It becomes apparent early on, it’s a bit like having a junior developer that can write very quickly. The key word here being ‘junior’ because it can generate code requested in the prompt but at the same time it does not seem to have any context for a larger project where multiple files are involved. It was somewhat like reviewing pull requests when considering the ability for the response to be merged directly into a file.

    I found that the assistant always needs to be herded in the right direction. An analogy would be I’m the farmer and the prompt is my new sheepdog and the sheep are the output of the assistant. This equates to things going vaguely in the right direction but you’ve got to constantly observe and adjust and correct in order for things not to spiral out of control.

    The assistant appears well suited for making initial classes and basic methods but once things got a bit more complex, I seemed to rely on it less once a class matured, slipping back into programming as I have done previously. Then, once a new class is required, I dive back to the assistant for initial generation.

    Guidelines I currently work towards

    Make sure you understand what it outputs. If you don’t understand what was generated, don’t include it or work to understand it before you include if it seems useful.

    Make sure you approve of the aesthetics. Things like single responsibility, understanding the rest of the project is class based etc seems beyond the assistant’s ability at the moment.

    Use its strengths, avoid the weaknesses. If I was making a completely new file and class, I started with the prompt to fill in the bulk and then fine tuned from there.

    Overall, in its current state the assistant is a useful multiplier in certain situations but a bit of a frustration and hindrance in others. I’ll continue to use it and look forward to improvements regarding the assistants ability to gain further context when generating code. I’ll also work to understand if there are ways to improve my prompt writing.

    Key Question – Can you use the assistant to make a program without knowing anything about programming?

    I’ve been asked this a few times. From what I’ve seen, I think it can be done to an extent. If you’re making a simpler one file program that does a single task such as parsing a file and outputting xyz for example, then yes – that should be no problem at all.

    However, as the project get bigger, the ability to develop the software without knowledge of programming becomes increasingly difficult because without having an underlying knowledge, there are difficulties in identifying rubbish code, structuring the project and debugging.

  • Kawasaki ER6F (2006) – servicing and tweaks so far.

    October 29th, 2023

    I’ve had the bike for just over a year now and it was the first and only bike I’ve had since receiving my full (A) licence. I’ve put roughly 2500 miles on and have ridden in a variety of places, everything from small gravel tracks to motorways. I’m quite fond of the thing and it was certainly a bit rough around the edges to say the least when I bought it. However, over the past 13 months I’ve done quite a lot of work on it. Work includes:

    • Fixed idle engine speed adjuster
    • Replace broken number plate light
    • Oil and filter change
    • Adjust clutch and brake levers
    • Coolant change
    • Front brake pads (both sets)
    • Brake fluid flush (front and rear)
    • Spark plug change
    • Air filter change
    • Horn was not working – cable severed due to wear and tear.
    • Replace chain and sprockets
    • Rear brake pads
    • Front and Rear caliper rebuilds
    • Diagnose FI issue and made custom tool to read logs (false positive from oxygen sensor)
    • Chain adjustment
    • Tyres (These were done by a mechanic as I don’t have the tyre replacement tools nor the inclination)
    • Added rear stand pins
    • General lubrication

    These were not jobs that were done for the sake of it, the bike genuinely needed them done. The combination of Youtube and the bike’s manual have been invaluable. Some particularly useful channels are:

    • Dave Moss Tuning
    • Halfdead rider – ER6f vidoes

    Overall its gone really well and there were no major mishaps when doing the jobs which surprised me as I haven’t worked on bikes or cars before and I’ve also learnt so much in the process. I have reflected somewhat on this and think that as a novice amateur, there are a few things that can help when working on motorcycles.

    Taking your time

    Just taking your time and thinking about things, checking and rechecking videos and the manual is always helpful and also consulting forums can help ensure the job goes well. This is easier said than done when the bike is your main form of transportation (I mainly use the car for work) but try to give yourself at least a weekend for a job.

    Read the manual

    The manual for your bike will be immensely helpful, and getting this will provide the key steps for a servicing task and schematics.

    See if there are videos

    This is useful to supplement the manual. Often the manual will give you just the key steps, no tips or at all. This is where youtube comes in and having a video of someone going through the task is invaluable, particularly for more involved tasks (for a novice like me) such as spark plug changes and replacing the chain and sprocket.

    Check your cognitive state

    If something is not going well, you’ve lost something or are starting to lose your patience, take a break and do something else, have a cup of tea and come back to it either in a few hours or even in a few days.

    Sometimes you also just have to jump in. Despite having watched the spark plug change video multiple times and having a good step by step idea of what to do, I was concerned I would do something wrong and damage the bike and held off on it for weeks despite having the time and parts. But one weekend I just became resolute and dived in and it went fine. The issue with the spark plug change is that it looks more challenging than it is because the bike basically looks like it’s been chopped in half and there is a lot of cabling.

    Try to prevent distractions

    I find that the missus will come into the garage and talk about something randomly, and if I talk and work it can mean things go a little wrong. So stopping work completely and chatting is better than half concentrating on either talking or the task.

    Document and organize

    Take plenty of pictures with your phone, you can’t take too many. It helps immensely when dealing with things like screws and cabling. If you need to check what things are supposed to look like, you can check the images.

    Also, have a small container to put things like screws in. I’m terrible for putting parts in random places and having to search for them. Keeping your workspace as organized as possible also helps and the same goes for keeping things clean.

    Also have a tidy work area.

    Check and recheck

    Your safety is paramount and checking the bike before riding is extremely important much in the same way as the POWDERS check. After any amend, I go on a short ride and gauge how the bike is and if I can feel anything is off I’ll return and make any amends.

    Have the right tools

    Sometimes it can be frustrating to find out you need a tool mid way through a job but it’s better to just stop and buy the tool rather than make a mess of it using something that’s inappropriate. It can increase costs but you have the tool for next time, the job will be much smoother and it’s still probably cheaper or the same cost than taking it to a garage or fixing the issue if it’s bodged with using improvised tools.

    Conclusion

    If you have not worked on bikes or are just getting started, I hope the above points help. It’s by no means exhaustive but I personally found that bearing these points in mind helped immensely. If you have any tips, disagree or think anything else needs adding, drop it in the comments. Thanks for reading and best wishes for your motorcycle maintenance!

    Preventing screws or any debris entering the engine during spark plug change
    Fresh tyres
    Freshly rebuilt with new pads
    Caliper rebuild
    Rosie the cat
  • How to fix: Kawasaki E6f/ER6N idle adjust cable seized and not turning.

    November 12th, 2022

    This howto is also on kawiforums

    Bike: 06 ER6F.

    Difficulty: Easy

    Tools required: wd40, hex key set to remove fairing, screwdriver set (flat head and cross)

    Issue

    Idle was quite low, roughly around 800rpm and it was causing the bike to cut out on occasion at a stand still.

    It should be around 1250 – 1350 so I went to adjust the idle and it would not budge, it was not rotating either way.

    Solution

    Remove the lower cowling and then the top fairing. Be careful to detach the indicator wire before removing it fully and take care not to scratch the fairing or cowling.

    The image below shows the location of the throttle body and where the actual adjustment takes place.

    The arrow on the left in the image below shows the pin; which when extending, adjusts the air intake to let more air in on idle. If you twist your throttle (with ignition off) it will make more sense as you will see the cable rotate the wheel (in the direction of the arrow to the right). Take a picture for reference just like the one below.

    To solve the issue, apply some wd 40 to the spring (the one the screwdriver is resting on) and place a flat head screwdriver in between the spring sections and just rotate the screwdriver slightly to flex the spring. 

    Apply some wd 40 to the pin area and also squirt some down the rubber hose where the thumb screw is. Keep the cable raised maybe with some string or something and let the wd40 trickle down overnight.

    Then use a small wire brush (roughly toothbrush size) on the springs and the pin to remove any rust or grime. Applying wd 40 over several days and giving it a scrub may be the safest option if it’s a really bad case to avoid any damage (it’s what I did).

    That should basically be it, with those steps, it should mean the idle cable moves freely. 

    it’s not complicated by any means but the thing is so small and delicate I took the slow and steady route to lessen the risk of any damage.

    At this point, the cable should be rotating and you will notice the pin moving in and out of the housing. The pin only needs to extend by a roughly a millimeter or so only a minor change will cause the bike to increase it’s idle by a few hundred rpm. It’s best to take it steady with the adjustments. That’s why it’s good to use the reference picture you took earlier in case you need to reset the pin position.

    If you have this issue, I hope this helps! Thanks for reading.

  • Donation machine result – success!

    February 8th, 2021

    A more detailed version of this blog post has been featured on Monevator.com

    This is a follow up to this blog post

    It’s just over a year since the ‘donation machine’ was set up and it looks to have been a success as the index funds have increased in value by around 12% and has generated just over £30 in dividends.

    So that’s been moved over from the brokerage to the bank account and then transferred to crisis. So if we use that £30 in their ‘societal return on investment‘ calculation (£30 * 3.3) this equates to an investment of £99.

    Hooray! Humble beginnings but not a bad start at all. With the growth and adding some more funds to the pot, it should mean a larger round of dividends next time.

  • Comparing CRC32 to MD5 for use in Hash Tables

    July 27th, 2020

    This is a follow on from the previous blog post about using a cyclic redundancy check (CRC32 in this case) to hash domain names to determine which database they should be stored on. More on that here.

    Although CRC seems to work fine in the sense that it generated a completely unique hash codes it was not designed for that purpose. Instead, the focus of CRC is on error detection in data on storage devices and when transmitted over networks. I won’t go into it any further here as it’s explained very well elsewhere. On the other hand md5 was specifically designed as a hash function.

    The question I had was whether MD5 was better at evenly distributing hashed values across a set of nodes. In a nutshell MD5 was better but not by a great deal and this was measured using a standard deviation and also by simply eyeballing the data (smaller min/max range in md5). If you look at the two graphs below, they each show 1 million domain names were distributed across a set of 64 databases and what you can see is that the groupings on the md5 graph are slightly more clustered around 15600 – 15700 but it’s nothing major and the crc32 does a reasonably good job.

    MD5 Code

    Both java and python implementations were made which are shown below and the larger repository can be found below.

    Java

    Python

    Main repository with crc32 and md5 tests and results

    Conclusion

    I’ll be scrapping the CRC32 and using the md5 instead simply because that’s what MD5 was designed for and the distribution is slightly better. If you need any clarification or have any improvements to the code, please comment below.

  • Building a donation machine

    February 5th, 2020

    A more detailed version of this blog post has been featured on Monevator.com

    Please note that this is by no means a recommendation that you take this approach. It’s a method I have chosen to donate money.

    While reading a part of American Psycho by Brett Ellis I took a break due to how grim it is. During that break, I started looking into homeless statistics and came across the Crisis website which is a charity that directly helps homeless people find a home and also campaigns for changes needed to solve homelessness altogether.

    After browsing through the site and learning more, I spotted the Crisis investor page which discusses Social Return on Investment (SROI). This is a completely new to me but my understanding of it is that by donating money you are making an investment in society that yields dividends and/or savings. They have conducted research and are able to provide estimates on the savings a donation makes. It boils down to – for each £1 you invest, there is around £3.30 SROI.

    This return on investment comes from the result of helping people find homes and providing them with support they need which makes it more likely that they will start paying taxes.

    Conceiving the machine

    This got me thinking of stocks and shares investments in relation to charities and after some thinking the idea of a set of shares that are dedicated to perpetually creating money for charity came to mind and is something I found very appealing.

    How do shares generate money?

    When you buy shares you are buying a piece of a business. Some companies distribute money to shareholders in the form of something called ‘dividends’. Dividends are usually paid out periodically (usually a few times a year). Although not all companies give dividends, many do and the dividend payout can fluctuate (just like the stock price) .

    Building the core of the machine

    Getting this off the ground with the basics involved:

    1. Opening a low cost brokerage account (just for charity donations)
    2. Deposit cash in the account
    3. Purchase some shares (UK Vanguard ETF’s)
    4. Set dividends to pay out to bank immediately
    5. Bank transfer them over to the charity once they arrive

    I’m currently on step 4 so I’m just waiting for some dividends to be paid at the moment.

    Why make this ‘machine’

    It perpetually generates money

    So the key benefit is that in theory it should perpetually generate money. Share prices go up and down but British companies are pretty good at paying out dividends and by buying an ETF (an ETF is like buying a share of a group of companies. So if you bought a FTSE 100 ETF, you would be buying a slice of every company in the FTSE 100. For more on ETF’s please read this) you are not relying on a single company continually dishes out dividends.

    You can build on it

    This simply means adding more cash to it. So by periodically buying more shares, the dividend payout should on average increase meaning there is more cash to donate.

    You have a lump sum

    There is a lump sum in the account that you can call upon if things go really really bad and you need cash. However, lets stay positive and go with the plan of never needing to touch it and letting it continue generating the cash for donation.

    It should grow by itself

    In addition to this share prices have historically increased over time so we should find that this machine generates more cash as time goes on.

    Automating the machine

    What I have so far is a good starting point, it gets the ball rolling and it is now only a matter of time before some dividends are paid, ready to be donated.

    However, the end goal is to completely automate this whole process so that in a sense it is a truly automated machine that regularly makes and dispenses money to charitable causes with little if any involvement from me. So it behaves just like a direct debit but instead of a set amount each month, dividends are checked are paid out as soon as they arrive.

    More on this next time.

  • Evenly distributing data on a group of MySQL databases

    February 1st, 2020

    I recently read an article about the way pinterest save data. After some rapid growth, they experimented with a variety of setups (which did not work too well), they devised a simple (relatively speaking) system to save data across an array of MySQL databases. The idea behind this being that you could initially put all the databases on a single server and as demand grows, move these databases out to their own servers.

    Part of this approach involved saving data for a specific URL. This involved doing a hash and running a modulus operation on a URL that returns a number between a certain value (e.g. 1 – 4096) to determine where the data would be stored for that URL. So for example, a hash would be ran on the string ‘example.com’ and that would return 3 which would place it on db0003, ‘example.com/1’ would return 2034 which would place it on ‘db2034’ and so forth. The idea around this being that data would be evenly distributed between the databases.

    I’ve been thinking about a project involving saving large amounts of data in a distributed fashion and was quite taken by this because of it’s simple approach to sharding. However, how evenly data were distributed was something I wondered about. After some initial poking around, it seemed that crc32 was a good candidate due to it not being particularly resource intensive compared to md5 and sha*.

    However, two questions sprang to mind:

    * How evenly was distributed between the shards.
    * Are there no discrepancies between the hash function

    I was pretty sure the answers to the questions would be ‘quite well’, and ‘there are no discrepancies’ respectively but did some tests anyway. After all, the last thing we want is for one implementation to give a different result from another.

    The test strings were ran on the majestic millions top domains and what the code does is create an array of all the shard id’s with each one initialized at 0. Then go through that majestic millions text file line by line and does a hash (and modulus) to get the shard id. Once the shard id is retrieved, iterate the array with the shard id’s by 1. The graph below shows the result of those hashes and shows how many domains each bucket has.

    The x axis shows the shard id and the y axis shows the number of records in each shard. Click to embiggen

    What we can see from eyeballing the graph it is that data are roughly evenly distributed between the shards. A few outliers here and there but most shards have between 100 and 140 items. Another script which compares the shard result of each implementation demonstrated there were no discrepancies either.

    All code can be found here. Any questions, feel free to comment and I’ll get back asap.

1 2 3
Next Page→

Proudly powered by WordPress