Debian Unattended Security Updates

Follow these instructions and set your email to receive notifications.

https://wiki.debian.org/UnattendedUpgrades

apt-get install unattended-upgrades apt-listchanges

nano /etc/apt/apt.conf.d/50unattended-upgrades

Set your email to receive notificaitons:
Unattended
-Upgrade::Mail "your@email.com";

To activate unattended-upgrades, you need to ensure that the apt configuration stub /etc/apt/apt.conf.d/20auto-upgrades contains at least the following lines:

  • # editor /etc/apt/apt.conf.d/20auto-upgrades

     

    APT::Periodic::Update-Package-Lists "1";
    APT::Periodic::Unattended-Upgrade "1";
    dpkg-reconfigure -plow unattended-upgrades

 

Alternatively, you can also create the apt configuration file /etc/apt/apt.conf.d/02periodic to activate unattended-upgrades:

  • # nano /etc/apt/apt.conf.d/02periodic
    
    

     

    Below is an example /etc/apt/apt.conf.d/02periodic:

    • // Control parameters for cron jobs by /etc/cron.daily/apt-compat //
      
      
      // Enable the update/upgrade script (0=disable)
      APT::Periodic::Enable "1";
      
      
      // Do "apt-get update" automatically every n-days (0=disable)
      APT::Periodic::Update-Package-Lists "1";
      
      
      // Do "apt-get upgrade --download-only" every n-days (0=disable)
      APT::Periodic::Download-Upgradeable-Packages "1";
      
      
      // Run the "unattended-upgrade" security upgrade script
      // every n-days (0=disabled)
      // Requires the package "unattended-upgrades" and will write
      // a log in /var/log/unattended-upgrades
      APT::Periodic::Unattended-Upgrade "1";
      
      
      // Do "apt-get autoclean" every n-days (0=disable)
      APT::Periodic::AutocleanInterval "21";
      
      
      // Send report mail to root
      //     0:  no report             (or null string)
      //     1:  progress report       (actually any string)
      //     2:  + command outputs     (remove -qq, remove 2>/dev/null, add -d)
      //     3:  + trace on
      APT::Periodic::Verbose "2";
      
      Unattended-Upgrade::Mail "your@email.com";
      
      

How to shrink or compact VirtualBox .vdi images

This works for Windows 

 

You have to do the following steps:

  1. run defrag in the guest (Windows)
  2. nullify free space:

    With Linux guest run this:

    sudo dd if=/dev/zero of=/bigemptyfile bs=4096k sudo rm -rf /bigemptyfile 

    With Windows guest, download SysinternalsSuite and run this:

    sdelete –z 
  3. shutdown the guest VM

  4. now run VBoxManage’s compact command

    VBoxManage.exe modifyhd thedisk.vdi --compact 

This reduces the size.

 

This works for Mac OS X

Open Terminal

Enter the following command:

 

VBoxManage modifyhd -compact “/Users/user1/VirtualBox VMs/Windows 7/Windows 7.vdi”

 

References

http://superuser.com/questions/529149/how-to-compact-virtualboxs-vdi-file-size

Screenshot of website using php on linux using PhantomJS WebKit

Main project page

http://phantomjs.org/download.html

 

 

Setup your environment

 

Setup phantomjs on Amazon EC2 instance

 

Setup your script

 

Capture webpage screenshot using PHP and Phantomjs

 

Additional reading on the PhantomJS

 

http://pielmeier.blogspot.ca/2011/02/headless-html-page-rendering-with.html

 

http://stackoverflow.com/questions/3342966/taking-website-screenshot-server-side-on-a-linux-rented-server-free