This is a very rough guide on how it can be done on an old Debian release, like Jessie (debian 8). There might be something missing, or it might break some stuff for you. Please read everything before starting, you might not wanna do some things or they might not be ok for a production […]
Remote reboot / keepalive using watchdog
I needed something that can do the following: – automatically reboot if another server goes missing/offline – reboot if instructed by another server – it must be failproof and work in all conditions (bad hardware, bad memory, lots of errors) Why? Because I want more control, more automation and don’t want to depend on datacenter […]
Fixing MySQL / InnoDB index corruption
Index corruption is usually a very rare issue, caused either by bugs in MySQL or hardware problems. Here’s how I handled it.
Maintenance mode on Apache / PHP using .htaccess and mod_rewrite
There always come a time where you need to temporarily stop a site for some required maintenance. The simplest quick&dirty method would be to stop the web server, but it’s not pretty for the users and also it brings down all the sites you are hosting. Another method (which I’ve used in the past) was […]
MySQL – Copying tables/databases without using mysqldump
Mysqldump must be one of the most frequently used MySQL utiliies. It’s very easy to use to peform backups with it and it’s reliable. And since its output is a set of SQL statements it’s easy to understand what’s happening and how to use it. For smallish databases mysqldump it’s perfect, but once you’re getting […]
jQuery CDN and Internet Explorer 6 & 7
Basically it seems that you can’t use the following combination: https + jQuery CDN (code.jquery.com) + Internet Explorer / Windows XP. Altough jQuery 1.x officialy supports Internet Explorer 6+, this doesn’t work. Why? It seems that the official jQuery CDN can’t handle https connections coming from Internet Explorer running under Windows XP.
Updating mysql code to mysqli in PHP
There are a few different ways of accessing MySQL from PHP. Historically the mysql extension was the only way until PHP 5.0 (circa 2004). After that mysqli appeared, which is an improved version of the older mysql driver. And also PDO, which gives you an abstraction layer for different databases. Unfortunately there’s still a lot […]
Using the Google Site Verification API in PHP
I wasn’t able to find any tutorial or guide on how to programmatically verify a site for Google, server-side from PHP. What follows is my attempt at doing it. You have to install “Google APIs Client Library for PHP”, available at https://github.com/google/google-api-php-client. I recommend reading the Google documentation on Google Site Verification API from https://developers.google.com/site-verification/v1/getting_started […]
1 Currently unreadable (pending) sectors
Woke up one morning with an awesome message in the server logs: smartd[18500]: Device: /dev/sdd [SAT], 1 Currently unreadable (pending) sectors Any hard disk error is a nightmare. It’s even more interesting when you have no ideea what happened.
MySQL – Converting large tables to InnoDB faster
Why? The purpose of this article is to show you some tips that may help you reduce the conversion time of MySQL tables when switching to InnoDB. Although this is not going to be a problem anymore since MySQL is using InnoDB by default in newer versions, there are still people out there using MyISAM […]