Nov 4, 2016 ·
8 minute read
magento2
Contents Introduction Magento 1.x Migrations Magento 2.x Migrations Edmonds Commerce Migrations Introduction Database Migrations See also: https://en.wikipedia.org/wiki/Schema_migration Database migrations are a way of setting database state pragmatically, it is used in various frameworks, platforms and ORMs like Laravel’s Eloquent, Symfony’s Doctrine among many. There are many different use cases for migrations during development, they can be used to reduce the technical debt to a database during development allowing it to be a decoupled part of the project.
Read On →
Nov 2, 2016 ·
1 minute read
php
If you would like to work with state of the art encryption techniques in your PHP project then you need to check out libsodium and the corresponding PHP library, pecl-libsodium Getting it installed on your centos7 and PHP7 box though can be a little tricky Here is a bash script which will install all the required depencies and get it working: #!/usr/bin/env bash if [[ "$(whoami)" != "root" ]] then
Read On →
Nov 2, 2016 ·
1 minute read
cluster
I had to work on one of UKFasts clustered servers today and learnt a few new commands. I wanted to record these here mainly for my future self but hopefully you’ll find them useful too. clustat This is the first command you’ll want to run (as root) on the server. This will give you the current status of all the cluster nodes and services. clusvcadm This is the command you’ll use to managage services (such as mysql).
Read On →
Oct 28, 2016 ·
1 minute read
magento
I recently had the need to debug the Magento API and instantly took to Google to see what solutions already existed. I found a few solutions on stackoverflow but these all involved either changing core files, adding code to index.php or setting up a proxy. After looking into this further I realised all the API calls come through a set of controllers in Mage_Api. In order to log all API calls I simply needed to rewrite the controllers, add my logging code and then call the original controller.
Read On →
Oct 28, 2016 ·
1 minute read
linux
Another Update on Shutdown Solution? While the other solutions on this blog (here and here) are probably more elegant they have dependencies on either the desktop (Gnome) or systemd. This solution should be portable across Linux distros and desktops. The Solution freedesktop.org define a specification for application launchers. These launchers will run on all compatible desktops (which means almost all Linux desktops). The desktop launcher for update on shutdown can be created using the following command: cat <<'EOF' | bash echo "[Desktop Entry] Name=Shutdown Exec=gnome-terminal --command=\"sudo bash -c 'dnf -y upgrade; shutdown now'\" Type=Application Terminal=true" > ~/.local/share/applications/shutdown.desktop; chmod u+x ~/.local/share/applications/shutdown.desktop; ln -s ~/.local/share/applications/shutdown.desktop ~/Desktop/shutdown.desktop EOF This should give you a launcher on your desktop as well as in your normal application menu.
Read On →
Oct 27, 2016 ·
1 minute read
linux
With the Dirty Cow exploit out in the wild, it is important to make sure that your Linux machines are kept up to date. The following commands will ensure your machine updates itself each time you shut it down su cat > /usr/lib/systemd/system-shutdown/upgrade <<EOL && chmod +x /usr/lib/systemd/system-shutdown/upgrade #!/bin/sh /usr/bin/dnf upgrade -y EOL