Michael Helm's Technology Blog
Linux Servers, Cpanel and Mysql and Raspberry Pi along with my own tech thoughts
    • Home

    Personal Software Projects Portfolio

    Update Your Windows Programs with Ease: Mastering the winget upgrade Command

    Navigating Email Spam Filters: Understanding and Adjusting Sieve Scripts on Plesk Servers

    Expanding the Root Partition on Debian with LVM: A Step-by-Step Guide

    Block WordPress XML-RPC Requests on Linux Servers

    Adding a New Swap Partition in Linux: Step-by-Step Guide

    July 5, 2009By adminin Blog Tags: disk partitioning, fstab, Linux, Linux commands, memory management, parted, server management, swap partition, System Administration, system performance

    Following my previous post on creating a swap file, I realized it would be worthwhile to discuss another approach: adding an entirely new swap partition. While swap files are excellent for emergency situations, a dedicated swap partition often provides better performance for long-term use.

    Prerequisites

    Before we begin, you’ll need:

    • A separate hard drive that is either not currently mounted or can be safely unmounted using the standard umount command
    • Root/sudo access to your system

    For this guide, I’ll assume the device is /dev/sdc, but your system might use a different device name (such as /dev/sdb, /dev/sda, /dev/hda1, etc.).

    Step-by-Step Process

    1. Ensure the drive is unmounted If the drive already contains a swap partition that’s in use, disable it first:
      swapoff /dev/sdc
      If the drive is clean and doesn’t have any swap partitions, you can skip this step.
    2. Access the partition manager Launch the parted utility to manage the disk partitioning:
      parted /dev/sdc
      This will load the parted prompt, which provides an interface for manipulating disk partitions.
    3. View existing partitions At the parted prompt, enter:
      print
      This will display details of any existing partitions and available free space on the disk.
    4. Create the new swap partition Once you’ve identified how much space you want to allocate (at minimum, I recommend matching your RAM size), create the partition with:
      mkpartfs part-type linux-swap start end
      Replace start and end with appropriate values shown from the print command. For example, if the starting point is 1024MB and you want a 4GB swap partition, your end point would be 5120MB (1024 + 4096).
    5. Exit parted Type quit to exit the parted utility. The new partition will have been assigned a number, such as sdc2 (or higher if other partitions already exist).
    6. Format the new partition for swap Format the newly created partition as swap space:
      mkswap /dev/sdc2
      (Remember to replace sdc2 with your actual partition name)
    7. Activate the swap partition Enable the swap partition with:
      swapon /dev/sdc2

    Making the Change Permanent

    If you want the system to automatically use this swap partition on every boot, you need to add it to the file system table:

    1. Edit the fstab file
      vi /etc/fstab
    2. Add the swap entry Press Insert to enter edit mode, then add this line to the bottom of the file:
      /dev/sdc2 swap swap defaults 0 0
    3. Save and exit Press Escape, then type :wq or press Shift+Z twice to save and quit.

    Verifying the New Swap Space

    To confirm that your new swap partition has been successfully added and is active, you can check the system’s swap status:

    cat /proc/swaps

    This will display all active swap spaces on your system, including your newly created partition.

    Final Thoughts

    Adding a dedicated swap partition is generally considered a more efficient long-term solution than using a swap file, especially for systems that regularly require swap space. The performance difference is modest on modern systems, but can be noticeable under heavy load.

    Remember that while swap space is important for system stability, it’s not a replacement for adequate RAM. If your system is consistently using large amounts of swap space, consider upgrading your physical memory for better performance.

    Adding Swap Space Without a Partition in Linux: A Quick Emergency Fix

    July 1, 2009By adminin Blog Tags: Linux, Linux commands, memory management, server management, server stability, server troubleshooting, swap file, swap space, System Administration, system resources

    Recently, we encountered a challenging issue on one of the servers I help administer. The server would occasionally max out its RAM usage, forcing it to rely on swap space. When both RAM and swap space were exhausted, the server would grind to a halt, requiring a manual restart.

    The Problem: Growing Needs, Limited Resources

    The server in question had been in operation for several years, starting with modest traffic but gradually growing as the websites it hosted gained popularity and their databases expanded. Despite this growth, it was still running with only 512MB of RAM—a limitation we’ve since addressed with an upgrade.

    However, we needed an immediate solution before the hardware upgrade could be implemented. The server already had a swap partition, but creating another one wasn’t feasible without significant downtime, as all available hard drives were in active use.

    The Solution: Adding a Swap File

    The answer turned out to be creating a swap file rather than a swap partition. This approach allows you to add additional swap space without reconfiguring your disk partitions—perfect for an emergency fix. Here’s how to do it:

    1. Navigate to a directory with plenty of available space:

      cd /home
    2. Create a swap file using /dev/zero:
      bash
      dd if=/dev/zero of=swapfile bs=1024 count=4194304
      This creates an empty file called “swapfile” with a block size of 1024 bytes and 4,194,304 blocks, resulting in a 4GB file. (To calculate the size in GB: 4,194,304 ÷ 1024 ÷ 1024 = 4GB)
    3. Set appropriate permissions on the file:

      chmod 600 swapfile
    4. Format the file as swap space:

      mkswap swapfile
    5. Activate the swap file:

      swapon swapfile

    To verify that your new swap space is active, you can run:

    cat /proc/swaps

    This command displays all active swap spaces on your system, and you should now see your newly created swap file listed alongside any existing swap partitions.

    Important Considerations

    This solution doesn’t automatically activate on system boot, which was fine for our purposes since we planned to upgrade the RAM soon. If you need a more permanent solution, you would need to add an entry to your /etc/fstab file.

    Remember that while this approach can prevent system crashes, it’s only a temporary workaround. Swap space, especially on a traditional hard drive, is significantly slower than RAM. For optimal performance, it’s always better to address the root cause by:

    1. Upgrading physical RAM
    2. Optimizing your application configurations
    3. Considering server upgrades if necessary

    That said, when you need a quick fix to keep a server stable until more permanent solutions can be implemented, adding a swap file is a valuable technique to have in your system administration toolkit.

    R-U-ON iPhone App: Essential Server Monitoring On The Go

    June 24, 2009By adminin Blog Tags: iPhone, iPhone app, IT management, IT tools, mobile monitoring, R-U-ON, server alerts, server monitoring, server status, System Administration

    Today I’m kick-starting a series of iPhone app reviews, beginning with one of the most valuable tools in my IT arsenal: the R-U-ON server monitoring app. For IT professionals or anyone managing servers, this app offers peace of mind by providing critical server status information directly on your iPhone.

    About the R-U-ON Service

    R-U-ON offers an excellent server monitoring service with both free and paid tiers. After using their free service for several years, I’ve now upgraded to the paid version for its additional features. The service works by installing a small program called an “agent” on your computers or servers, which then connects to R-U-ON’s servers to transmit monitoring data.

    Key Monitoring Features

    The service provides comprehensive monitoring of several critical system metrics:

    • Disk space usage
    • Virtual memory utilization
    • RAM usage
    • CPU statistics
    • Server load metrics

    All of these parameters can be customized with specific thresholds. When any metric exceeds these defined limits, you’ll receive an alert. For mission-critical systems, text message notifications are available for an additional fee—a feature I consider absolutely essential for responsive server management.

    The iPhone App Experience

    The iPhone app offers a simple yet effective interface that connects to your R-U-ON account and displays a comprehensive summary of your server environment. The main screens include:

    1. Alarms View: Shows which servers have exceeded notification thresholds (see screenshot below)
    2. General Server Status: Provides an at-a-glance view of all your servers—ideally showing all green indicators
    3. Trouble Tickets: Although I personally haven’t used this feature

    ruon

    Room for Improvement

    The only significant limitation of this app is its inability to run in the background—a restriction imposed by Apple’s SDK guidelines. It would be tremendously useful if the app could continue monitoring or if it could leverage some kind of background notification system (which might be possible in the new iOS 3.0, though I’m not entirely certain).

    Verdict

    For anyone responsible for server management, the R-U-ON iPhone app is an invaluable tool that brings critical monitoring capabilities to your pocket. The combination of the robust web service with this mobile interface ensures you’re never completely disconnected from your server infrastructure, even when away from your desk.

    iPhone 3.0 OS Update – Initial Thoughts

    June 17, 2009By adminin Blog Tags: Apple, first impressions, iOS 3.0, iPhone, mobile, technology

    The Long-Awaited Update

    After waiting and repeatedly hitting the “Check for Updates” button, I finally got my hands on the iPhone 3.0 OS update. Naturally, I installed it right away and took some time to explore the changes.

    First Impressions

    • Cut, Copy, Paste – Finally! It’s been a long time coming, but the new clipboard functionality works smoothly.
    • Landscape Keyboard – Much easier to type with in apps like Mail and Messages.
    • MMS Support – Not enabled on all carriers yet, but it’s a welcome feature.
    • Spotlight Search – A nice addition that makes finding emails, contacts, and apps much quicker.

    Performance & Stability

    The update seems solid so far. No major bugs, and everything runs smoothly. I’ll continue testing over the next few days, but overall, this feels like a worthwhile upgrade.

    rm Argument List Too Long… Linux Huh? Moment

    June 17, 2009By adminin Blog Tags: ARG_MAX, Linux, rm command, shell scripting, troubleshooting, xargs

    The Problem

    I recently encountered a strange issue when trying to delete a large number of files using the rm command in Linux. Instead of working as expected, I was greeted with this error:

    /bin/rm: Argument list too long

    At first, I was puzzled. How could a simple rm * command fail?

    The Cause

    The issue occurs when the number of files being passed to rm exceeds the system’s limit for command-line arguments. This is controlled by the ARG_MAX limit in Linux, which restricts the total size of arguments passed to a command.

    The Solution

    To get around this, I used find combined with xargs to delete files in batches, avoiding the argument size limit:

    find . -type f -name "*.log" -print0 | xargs -0 rm

    This method ensures that even if you have thousands of files, they are processed in manageable chunks.

    Final Thoughts

    It’s always interesting when a routine task suddenly throws an unexpected error. At least I learned something new about Linux today!

    Natural History Museum Picture Unfurled

    June 11, 2009By adminin Blog Tags: artifacts, discovery, history, museum, photography

    A Fascinating Discovery

    Iknow UK seems to have found an ancient picture in the depths of the Natural History Museum archives. It appears to have been furled up for centuries, waiting to be rediscovered.

    The Unfurling Process

    The image, once carefully unrolled and preserved, reveals intricate details that had been hidden away. It’s fascinating how artifacts like these can be tucked away in museum collections, often unnoticed until someone takes the time to explore them.

    Final Thoughts

    It’s always exciting to see historical pieces come back to life. I wonder how many other forgotten treasures are waiting to be uncovered in museums around the world.

    3600512285_a2d0eddc1c_b

    A Little Play with Some Picture Work :)

    June 9, 2009By adminin Blog Tags: creative, flickr, fun, image editing, photography

    Photo Inspiration

    Saw this on iknow-uk’s Flickr account today and thought it looked interesting. I decided to have a little fun playing around with the image, making a few tweaks here and there.

    Experimenting with Edits

    I adjusted the contrast, played with some color corrections, and tried out a couple of different effects. It’s amazing how small changes can bring out different aspects of a picture!

    Final Thoughts

    It was just a quick experiment, but I really enjoyed it. Maybe I’ll try doing more of these little edits in the future.

    nymans-gardens-mh

    Twitter Weekly Updates for 2009-06-07

    June 7, 2009By adminin Blog

    • getting annoyed at spammers trying to send spam via the company sites – go away you aren’t getting in stop annoying me! #
    • New Blog up for http://www.delicatedreams.co.uk – view it on . The start of more regular blogs! #
    • Wondering why ubuntu doesn’t like his 5 yr old laptop – I want to ditch windows on it! #
    • See our pictures, from preparing the #NationalBusinessAwards finalist presentation to the presentation, http://bit.ly/hmvah (via @iknow_uk) #

    Powered by Twitter Tools.

    Fighting the Email Battle: ASSP Anti-Spam Success and Limitations

    June 2, 2009By adminin Blog Tags: anti-spam, ASSP, email filtering, email security, server administration, spam protection

    The Search for the Perfect Anti-Spam Solution

    After years of testing various anti-spam solutions across different server environments, I’ve finally found what I consider to be the gold standard: ASSP (Anti-Spam SMTP Proxy).

    This powerful tool has consistently outperformed other anti-spam solutions I’ve implemented over the years. Its effectiveness in catching unwanted emails while minimizing false positives has made it my go-to recommendation for server administrators dealing with email spam.

    The Challenge of Diminishing Returns

    Despite ASSP’s impressive performance, I’ve noticed a concerning pattern. Over time, the effectiveness tends to diminish as spammers evolve their tactics. What starts as a rock-solid defense gradually becomes more porous.

    This isn’t a criticism of ASSP specifically – it’s the reality of the never-ending cat-and-mouse game between spam filters and spammers. As spam techniques evolve, even the best solutions need reinforcement.

    Looking for Complementary Solutions

    Rather than replacing ASSP entirely, I’m searching for complementary solutions that can work alongside it, creating multiple layers of defense against unwanted emails.

    My question to fellow IT professionals: What anti-spam systems have you successfully implemented that work well in conjunction with ASSP? I’m specifically looking for solutions that:

    • Can run in parallel with ASSP
    • Target different aspects of spam detection
    • Don’t conflict with ASSP’s functionality
    • Provide additional layers of protection

    If you’ve found a winning combination that strengthens your email security beyond what ASSP can provide alone, I’d love to hear about your experience.

    Anti-Spam on servers…

    June 2, 2009By adminin Blog

    After several years of running different solutions on different servers I have found that ASSP is one of the best anti-spam solutions around. However – after some time it still struggles and gets weaker, can anyone recommend any other systems that can work ALONGSIDE it (not replace).

    «‹ 2 3 4 5

    Personal Software Projects Portfolio

    Update Your Windows Programs with Ease: Mastering the winget upgrade Command

    Navigating Email Spam Filters: Understanding and Adjusting Sieve Scripts on Plesk Servers

    Expanding the Root Partition on Debian with LVM: A Step-by-Step Guide

    Block WordPress XML-RPC Requests on Linux Servers

    Michael Helm's Technology Blog
    Copyright Michael Helm 2025.
    The earliest version of this site available is from October 2003 - possibly viewable here: https://web.archive.org/web/20031228013629/http://www.ihelm.org.uk:80/

    ↑ Back to top