Tag: howto

  • Repairing damaged or crashed MySQL tables

    Always remember, regular backups of your databases are best practice, in the event the below fail, backups may be the only method you have to restore a working table or database.

    Damaged or crashed MySQL tables due to an unsafe server shut downs, disk space limits or general MySQL failures? You will normally see something along the lines of “marked as crashed and should be repaired when using LOCK TABLES” within your MySQL log files.

    MySQL has a number of tools to try and repair crashed / damaged tables. Log into your server as root and run the following commands. Replacing “/var/lib/mysql/” with the location of your DB files.

    Check what tables need repaired:

    myisamchk –check /var/lib/mysql/*/*.MYI

    Try a safe recovery:

    myisamchk –safe-recover /var/lib/mysql/*/*.MYI

    Try a normal recovery (if safe recovery fails):

    myisamchk –recover /var/lib/mysql/*/*.MYI

    Try a force recovery (as a final last step):

    myisamchk –safe-recover –extend-check –force /var/lib/mysql/*/*.MYI

    or:

    myisamchk –recover –extend-check –force /var/lib/mysql/*/*.MYI

  • How to open a .Pages file using windows

    How to open a .Pages file using windows

    Today I was asked by a client how they open a .Pages files using a windows. Their computer didn’t recognise the file.

    What is a .PAGES file?

    A .PAGES file is an archive technology created by Apple for use on its Mac OS, it is very similar to .zip files. They are normally created when using iWorks a Mac OS program similar to Microsoft Office, Mac users can share there documents however it defaults to using a .PAGES archive format which is only supported on Mac devices.

    How to open it?

    It’s actually quite simple, just rename the file and change the .Pages extension to .zip and you can open it as a normal zip archive.

    • Right click file and select Rename
    • Replace .pages with .zip
    • Click yes when it popups up with “Are you sure?”
    • You should now be able to open the file
  • WordPress: Update user / admin password via database

    WordPress: Update user / admin password via database

    Forgot your WordPress admin login details or a previous developer is unwilling to give you the WordPress login details, well the answer is very simple. As long as you have database access you can use the website below to generate a new password hashsum, simply replace the origional password value with the new hashsum and you will have access again. (more…)

  • Removing glued tyres

    Removing glued tyres

    It’s time to remove my Super Swamper tyres from the plastic rims they are glued to, I’ve got new metal beadlocked rims, foams and weights which you can see in this post.

    First step was to put a pan of water on full boil with the wheel in it. The idea is to boil the wheel and hopefully the glue will begin to crack and become brittle allowing you to carefully pull the tyre off.

    2015-10-07 22.42.10

    I left it on full boil for a good 10 minutes just to make sure, I am not sure if there is a science to this.

    2015-10-07 22.50.25

    Now when I took it out it was very hot, be very careful as boiling water may have got into your foams so when you apply pressure you may get a painful surprise.

    2015-10-07 22.54.53

    I carefully started pulling the tyre away from the rim until one tiny section separated, I then followed this around the rim and gradually separated more of the type.

    2015-10-07 22.58.46

    After about 10 minutes of carefully pulling and pushing I managed to free one side of the rubber.

    2015-10-07 22.59.57

    Now it was time for the other side, this side was not so easy. I managed to get the first bit to separate by pushing the rim through the tyre, hopefully you get the idea from the image.

    2015-10-07 23.01.16

    I then decided I would pull out the existing weights and foams, giving me extra room to apply force. The weights are actually in good shape, so I will reuse these.

    2015-10-07 23.05.05

    I put the tyre back on boil, been out for a good 20 minutes now, and the glue on this side of the wheel is very strong.

    2015-10-07 23.08.56

    Eventually with the help of a normal kitchen eating knife I was able to break the rest of the glue without damaging the tyre.

    2015-10-07 23.15.05

    Now I have to repeat this step for the next 3 wheels and then begin fitting the beadlocks.

  • UPS modification getting rid of the annoying beeping

    UPS modification getting rid of the annoying beeping

    I connect a UPS to a generator allowing me to safely power my sensitive electronic equipment (laptops) when in remote locations, generators are not perfect and occasionally the power fluxuates causing spikes, over and under voltage issues. To resolve these issues and make it safer for my sensitive devices I use a UPS which provides a cleaner and more reliable energy supply. When a under voltage occurs the UPS boosts the power using the battery, when this happens (which is often) the UPS beeps for an extended period (indicating it is using the battery, which I don’t really need to know as it’s only for a couple of seconds normally).

    (more…)

  • Knowing your Generator (Unstable, Over & Under Voltage)

    I take a small portable generator with me when I am using my RC cars this allows me to charge batteries and run power tools such as a dermal or soldering iron for onsite repairs which comes in really handy. I like to be prepared when I take my cars out, nothing worse than driving to the RC track to be heading home 15 minutes later.

    Don’t just plug anything into your Generator

    A lot of people don’t understand you cannot simply just plug anything into a generator for example laptops and printers. Especially not into the cheap generators like mine. (more…)

  • Combine multiple files into one using Windows Command Prompt

    Combine multiple files into one using Windows Command Prompt

    Combine multiple files into a single file is very simple on Windows as long as the files you are wanting to combine are text (binary). Its not possible to merge multiple images, videos and other none binary related content using this method. Here is the Command Prompt (cmd) command we will be using to achieve this. (more…)

  • SEO: Finding commenatable blogs via Google

    SEO: Finding commenatable blogs via Google

    Google is one of the biggest search engines with billions of pages, you enter in some keywords and it will find related pages. Google has some advanced search commands which allow you to refine your search results, I will be showing you how to refine your search results down to just blogs which you have the ability to leave a comment. (more…)

  • PHP: Show PHP errors messages for debugging code

    PHP: Show PHP errors messages for debugging code

    Need to easily debug some php code? simple add the following code to your script to enable PHP error reporting and display error messages. This allows you to quickly debug without making configuration changes to servers PHP configuration.

    It is good practice to hide error messages for security reasons, error messages could be used by hackers to gather information and vulnerabilities.

    This code is provided as it and may require changes to work for your needs.

  • PHP: Compare floats & why its different to a normal comparison

    Comparing two bits of data in PHP is quite simple but there are special occasions when a simple comparison of data needs to be slightly different. One of the common issues is comparing float numbers, a common mistake is comparing two float numbers the same way in which you would compare two integers or two strings.

    What does float, double or real number look like?
    1.234
    1.2e4
    7E-10

    This is due to how PHP stores float numbers (also known as doubles or real numbers) which gives this type of data a very limited precision resulting in numbers being slightly off, for a more in-depth explanation please read the following article http://php.net/manual/en/language.types.float.php.

    This issue only occurs once a calculation is performed on a float number.

    The best way of comparing two floats to get an accurate comparison is to convert the value to an alternative data type such as a integer, string or use “bccomp” which allows you to compare 2 float data types together up to the precision you specify (bccomp can also be used to determine which of the two floats is higher or lower).

    Read up on bccomp: http://php.net/manual/en/function.bccomp.php

    Is Match Comparison

    Greater or Lower Comparison