Massively modifying images with ImageMagick

    Web editors often have the need to edit a large number of images. For example, the large image size of professional cameras tends to be overkill for most sites. I wanted a quick and easy way to resize large images and that was how I found ImageMagick.

    ImageMagick is a suite of tools and according to the man page, we can “use it to convert between image formats as  well  as  resize  an image, blur, crop, despeckle, dither, draw on, flip, join, re-sample, and much more”. First, let’s install imagemagick:

    Then, we can use the convert command to do the actual edition. Check the man page to see the astounding number of options this command has. For example, if I want to resize all the JPG images in the current directory to a width of 1280 pixels and save the resulting images as the same name but with “min-” before the name I would execute the following command:

    And here lies the advantage of ImageMagick: it can be used in a script to edit images extremely quickly. ImageMagick can also be used on Mac OS X and Windows. For more information about the convert command, refer to http://www.imagemagick.org/script/convert.php

Share

Alan Verdugo / 2016/12/12 / Uncategorized / 0 Comments

Broken WordPress after Ubuntu 16.04 upgrade

    After some delays, I finally upgraded the server’s OS to the LTS Ubuntu 16.04. At first I thought that everything went fine, but then I tried to access the blog and it did not work, it only showed a blank page. A very bad omen. Then, when I tried to login into WordPress, this horrible message appeared:

    The message was actually much longer, I am just posting the beginning. If you have suffered with PHP in the past (like me), you will notice that this uninterpreted PHP code. That was my first clue, something was wrong with PHP. I created the infamous test.php page to test if PHP is actually working correctly with Apache. For those of you who haven’t done this, it basically is a “hello world” approach to see if PHP is working correctly. We paste the following code into a file named test.php or pleasework.php or something like that.

    Then we move that file to the Apache public directory (/var/www/html, is the default in Ubuntu) and grant it appropriate permissions. Then we go to yourdomain.com/test.php and, if PHP is working, we should see a page with PHP’s logo and all sorts of information like System, Server API and many more. In my case, I only got another blank page. This meant that something was very wrong with PHP.

    So I went into the server via SSH and executed php -v. Turns out I didn’t even have the php command. How was that possible? Well, turns out PHP5 is no longer the default in Ubuntu 16.04, instead, PHP7 is the default. At some point during the upgrade, PHP was completely uninstalled. So, let’s install it again:

Then install libapache2-mod-php7.0:

Then install php7.0-mbstring:

Then install php7.0-mysql:

Finally, reload Apache’s configuration:

    Once all that was done, I reloaded the test.php page and it gave me all the information I mentioned before. I also logged in successfully into WordPress. Now I am wondering if I should change the OS to something else than Ubuntu, and if I should change the WordPress theme. There are other problems that need to be solved, but for now WordPress is working as it should and I am happy.

Share

Alan Verdugo / 2016/12/04 / Uncategorized / 1 Comment

How to change the resources of cloud servers using Tivoli Service Automation Manager

In order to modify the resources of a Cloud server, you need to do the following:

In this example we will add disk space to an AIX cloud server.

Login into the Tivoli Service Automation Manager.

Once you are logged in, in “My projects”, select “Manage Servers…”1

Search for the hostname of the desired server and select it.2

Click on the “Modify Server Resources” button.3

Click on the Edit button.4

In this case we will add more space to the disk. Simply specify the desired total amount and click OK.5

Once your request has been placed, it will be resolved after a few minutes. You can check its status on the “My Requests” part of the home page. You will also get an email notification.6

After that, a couple of commands need to be run in the target server in order to get the changes applied.

Run:

cfgmgr
chvg -g rootvg

With that, you should be able to see the new available space in the server with lsvg rootvg.

In AIX, you can assign new space to a file system using the chfs command, like this:

Change file system size:
    chfs -a size=[-/+]N[GM] [/filesystem]
G=Gigabytes
M=Megabytes

Example:

    chfs -a size=+200M /dev/fslv02
Filesystem size changed to 1835008

Share

Alan Verdugo / 2014/09/12 / Uncategorized / 0 Comments