Categories
Openbsd

Creating a memory leak on Linux/Unix

I recently had to create a memory leak to do some testing, here is a snippet of code that I used to create a leak. You can adjust malloc size to allocate more memory, or adjust the usleep to adjust how aggressive it is. the code below on a machine with 500M of memory would chew up about 1% memory a second. Enjoy!

#include <stdlib.h>
#include <unistd.h>

int main(void) {
    /* An infinite loop. */
    while (1) {
       /* Try to allocate some memory. */
       malloc(8386080);
       /* sleep for a bit so its not so aggressive */
       usleep(10000);
    }
    return EXIT_SUCCESS;
}

Categories
Linux

Grant Shell access (SSH) to Root on ESX 3.5 update 2

If you’d like to allow shell access to the root account on ESX 3.5 Update 2 you need to modify the sshd_config file.

  1. Login into the console using the root account
  2. Edit the sshd_config file
     

    vi /etc/ssh/sshd_config

  3. Find "PermitRootLogin no" and change to "PermitRootLogin yes"
  4. Restart the sshd server
     

    service sshd restart