Docker Update Container

Start the Container via Container ID

root@b5855cf66908:/ docker start -a -i b5855cf669087ced669bfde4c89175c7f6d062e0e3e31d357a823189e0058044

Modify your Image, i will only the rsync software install for auto deployment and i’am done.

root@b5855cf66908:/ apt-get install rsync
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libpopt0
Suggested packages:
  openssh-server
The following NEW pa...
root@b5855cf66908:/# exit

commit the changes to docker

d8devs@root:/ docker commit b5855cf669087ced669bfde4c89175c7f6d062e0e3e31d357a823189e0058044 customer-ubuntu

PHP – Get Last 12 Months

<?php
$to = new DateTime('now');
$from = new DateTime('now');
$from->modify("-12 months");
$interval = DateInterval::createFromDateString('1 month');
$period   = new DatePeriod($from, $interval, $to);
$res = array();

foreach ($period as $start)
{
  $res[] = $start->format('m/Y');
}

echo "<pre>";
var_dump($res);
echo "</pre>";

/**
--- Output --- 
array(12) {
  [0]=>
  string(7) "02/2019"
  [1]=>
  string(7) "03/2019"
  [2]=>
  string(7) "04/2019"
  [3]=>
  string(7) "05/2019"
  [4]=>
  string(7) "06/2019"
  [5]=>
  string(7) "07/2019"
  [6]=>
  string(7) "08/2019"
  [7]=>
  string(7) "09/2019"
  [8]=>
  string(7) "10/2019"
  [9]=>
  string(7) "11/2019"
  [10]=>
  string(7) "12/2019"
  [11]=>
  string(7) "01/2020"
}
*/

SSH Connection without Password

    ~ ssh-copy-id yoursshusername@yourservername.com
/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/c/Users/USER/.ssh/id_ed25519.pub"
/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
sshyoursshusername@yourservername.com's password: <<---HERE IS YOUR SSH PASSWORD QUESTION ONE TIME -->

Number of key(s) added: 1

Now try logging into the machine, with:   "ssh 'yoursshusername@yourservername.com'"
and check to make sure that only the key(s) you wanted were added.
Continue reading “SSH Connection without Password”