This is a note to myself as much as anything; GMvault – used to back up gmail accounts. Very useful Imapsync – used to transfer emails from one gmail account to another. Very handy when closing an account Logstalgia – used to visualise logs. Can install on MacOS and watch logs on other systems
So far this is the easiest way I have found to update Mediawiki. This presumes SSH access. Back up your database and files first!
cd(if going for another version, replace with the appropriate link)
tar -xvzf mediawiki-1.31.1.tar.gzIf your sites are stored elsewhere, replaces /var/www/YOURSITE with whatever the path name is. Copy with the rf flags forces over-write and copies recursively.
cp -rf mediawiki-1.31.1/* /var/www/YOURSITE
Visit https://yoursitename/mw-config/ in your browserFollow the instructions from there – you will need the upgrade key from your existing LocalSettings.php file, which should be found in your existing Wiki directory via:
cat LocalSettings.php | grep -A 2 key
I spent a lot of time in text editors and have been using Sublime Text for years; Atom recently caught my attention as a completely free alternative (though Sublime’s trial period is currently unlimited…) that has a huge community behind it and good support. One of the biggest things that I found off-putting was the lack of autocompletion – or autoclose a tag – via typing a </ – something I had gotten rather used to in Sublime which does that by default. Turns out that one of the best bits of Atom is the packaging system, and there is a package for that. It’s called Less Than Slash and can be installed from the Atom package manager which comes with it (open it with CMD+, on a Mac). Ten seconds later the package is installed and I have my autocomplete back! Happy camper.
This issue drove me batty for an hour – after installing WHMCS with PHP’s Ioncube extension installed successfully the cronjob required by WHMCS would not run, complaining about Ioncube not being installed. Yet php -v showed that it was in fact installed. What gives? Turns out that Ioncube had been enabled for PHP-FPM in the following directory:
/etc/php/7.0/fpm/conf.d/…but had not been enabled in this directory also:
/etc/php/7.0/cli/conf.d/…which is another directory that needs the same config file in. In my server’s case the config file was named 00-ioncube.ini and consisted of the following:
And with that, voila, cron job works. Can’t get that hour of my life back, though. Update: For the php7.1 servers the zend_extension line read:
zend_extension = “/usr/lib/php/20151012/ioncube_loader_lin_7.0.so”
zend_extension = “/usr/lib/php/20160303/ioncube_loader_lin_7.1.so”
I must have spent hours today trying to fix a problem with Woocommerce – no matter which way I set up a variable product it always showed as out of stock no matter which combination of options I selected. The error message was:
Sorry, this product is unavailable. Please choose a different combination.Very frustrating. The problem in the end? I had not yet set prices for all of the variable products. To resolve this go to Product -> Variations -> click on the dropdown box which defaults to “Add Variation” -> Set Regular Prices -> click Go. Hopefully that’s all it takes to fix your problem too. I was installing custom PHP snippets to try and resolve this issue and going down all sorts of wrong paths when I had simply neglected to take note of which fields were required.
LinkChecker is a great way of doing this; http://wummel.github.io/linkchecker/ Other people’s sites may have robots.txt files that prevent you from using this tool on their sites but it’s darn handy for pulling up broken links on your own sites. This is a valid alternative to the Integrity tool on Mac if you’re comfortable with the command line and piping the output to a CSV file etc.
So you want to export your MySQL database then import it on the same server with a new name. I tried this several times and using the SOURCE command inside MySQL or just mysql -p < db.sql both resulted in the database re-importing over the original name. To fix that run:
sed -i 's/OLDDATABASENAME/NEWDBNAME/g' mysqldumpFile.sql
mysql -p create NEWDBNAME; use NEWDBNAME; SOURCE /path/to/sql/fileNo need for a semicolon on the last line. Then check the success by:
This one had me scratching my head for a while – using php7.0-fpm and the latest nginx on Debian 8 Jessie I was seeing our PHP contact form working correctly but returning a Gateway 504 error upon submission, which was resulting in a great deal of resubmitted forms and error notifications from users. This only started occuring after we moved our site to Digital Ocean – it turns out that it was a IP priority issue and the following resolved it:
vim /etc/gai.confand uncommenting the following line:
Then a reboot. Voila, the contact form worked properly again.
precedence ::ffff:0:0/96 100
Running a Mac with Windows running in a Virtualbox virtual machine? Here’s how to pass through a USB device so that whenever the VM (Virtual Machine) is running and the USB device is plugged into a USB port it appears in the Windows VM and not in Mac OS X. Open up Virtualbox and make sure that the Windows VM is not running: Click on “Settings” at the top and you should see this screen: Click on “Ports” (third from the right hand side in the icon menu at the top): It defaults to Serial – click on USB: Nobody wants to be using USB 1.1 (slow) so click on USB 2.0: Then plug in your USB device that you want to pass through. In a nutshell, we will be setting up the specific USB devices we select on this screen to be passed through to the Windows VM whenever they are plugged in while the VM is powered on. If the virtual machine is closed down when you plug in the USB device the normal Mac OS X system will read the USB device as usual. Click on the icon on the right that has a little green plus and you should see a listing of USB devices that are eligible for passthrough: In this instance we are selecting the SanDisk Cruzer Blade. Click on it. Now you should see it listed under “USB Device Filters”. The USB controller has been moved to USB 3.0 in the above screen shot – ignore that, as USB 3.0 currently does not work on Windows 7 VMs. Click OK, and go back to the main Virtualbox screen. Safely remove the USB device from your computer and then start the Windows virtual machine. If you have only just selected USB 2.0 for the first time you will probably see the above screen. Otherwise, you can now plug your USB device in: …and it should be picked up as if it were plugged into a physical Windows computer: All done. Now, if you look in Finder in Mac OS X you won’t see the drive: Closing down the VM, though, and unplugging/reinserting the drive will make it show up as normal: In the above screen shot it is appearing as “NO NAME”. All done! Incidentally, if you want a USB thumbdrive to work in both Windows and OS X you want it formatted into FAT32 or ExFAT rather than NTFS or Mac OS X Extended. If you wish to remove the USB device from the passthrough list, click on the USB device in the list and then click on the little red minus sign on the right hand side.
Well, about ten minutes after installing the new Owncloud Nine we found out that we had typo’d the admin password. Fortunately, it’s an easy fix. Run the following (this worked on Debian with a fresh Owncloud 9 install):
cd /path/to/owncloud sudo -u webserveruser php occ user:resetpassword adminaccountnameIn our case the command was:
cd /var/www/cloud sudo -u www-data php occ user:resetpassword adminIt should prompt you for your password twice: Assuming there are no more typos, that’s all done!