LVM: Resizing swap Logical Volume

Logical Volume Manager is a Linux tool for managing your partition. LVM allows you to have the ability to play around with partition size and/or combine multiple hard disk to create partition across all the combined hard disk. The LVM-HOWTO explains its function and how you could benefit from it.

Resizing swap partition is a little bit different but a lot easier. Since we are not concern over the swap partition’s content and resize2fs doesn’t support swap partition; we can safely re-size the logical volume and re-format the partition to update its partition size. In the example below, PART 1 shrinks the swap partition from 8GB to 4GB and PART 2 increases the partition back to 8GB.

Read More

Display content for member's only using shortcode

While doing a website for a client of mine, one of the requirement was to show content to subscribers or members only. Although there is a plugin for this but I stumble upon a much simpler script. For more details, you can visit justinandlock.com for the full how to.

Since the tutorial only teach you how to create them through functions.php inside your theme files, I’ve made some modification towards the aesthetics of it. Obviously, we would want to display the login and register link for easy access to our viewers. Here is my code which you can place them inside functions.php located in your theme folder. If it’s not there, just create one. Read More