Docker: how to sync date between a CentOs host and a Debian container?

I have a CentOs host running a docker Debian container.

The container has the wrong localtime and timezone: how can I synchronize it with the host date?

I’m trying with mounting volumes on the docker-compose with /etc/localtime but it doesn’t work.

The solution I prefer should be one of them:

  • set a particular ENV in the Dockerfile
  • mount properly volumes in the docker-compose.yml

Automatically mounting S3 bucket using s3fs on Amazon CentOS

I have tried all the answers provided in similar questions but none is helpful.

I installed S3 Fuse so that I can mount S3 bucket. After the installation, I performed the following the steps:

I created the mount point for S3 bucket; mkdir –p /var/s3fs-drive-fs

I am able to mount the S3 bucket in the new directory with the IAM role by running the following commands: s3fs myresearchdatasets /var/s3fs-drive-fs -o iam_role=EC2-to-S3-Buckets-Role -o allow_other, and it works fine.

However, I found out that the bucket disappears each time I reboot the system, which means I have to run the command above to remount the S3 bucket each time after restarting the system.

I found the steps to complete an Automatic mount at reboot by editing the fstab file with the lines below

s3fs myresearchdatasets /var/s3fs-drive-fs fuse_netdev,allow_other,iam_role=EC2-to-S3-Buckets-Role,umask=777, 0 0

To check whether the fstab is working correctly, I tried mount /var/s3fs-drive-fs/

but I got the following errors, “mount: can’t find /var/s3fs-drive-fs/ in /etc/fstab”

Can anyone help me please?

Clone Centos 7 installation – MBR to GPT

I want to clone a centos 7 installation (using LVM) from a 500GB drive (using MBR) to a new 6TB HDD.

I tried to use clonezilla to clone the the drives with no success.

fdisk -l output from clonezilla:

Disk /dev/sda: 465.8 GiB, 500107862016 bytes, 976773168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 512 bytes / 4096 bytes Disklabel type: dos Disk identifier: 0xb76941c5     Device  Boot Start       End   Sectors   Size Id  Type /dev/sda1        2048 976771071 976769024 465.8G  6 FAT16 

fdisk -l output from centos:

[root@xxx ~]# fdisk -l Disk /dev/sda: 499.9 GB, 499949502464 bytes, 976463872 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk label type: dos< Disk identifier: 0x0008eb5b     Device Boot      Start         End      Blocks   Id  System /dev/sda1   *        2048     1026047      512000   83  Linux /dev/sda2         1026048   976463871   487718912   8e  Linux LVM  Disk /dev/mapper/centos-root: 53.7 GB, 53687091200 bytes, 104857600 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes  Disk /dev/mapper/centos-swap: 8455 MB, 8455716864 bytes, 16515072 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes  Disk /dev/mapper/centos-home: 437.2 GB, 437210054656 bytes, 853925888 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes 

The LVM configuration:

[root@xxx ~]# pvdisplay   --- Physical volume ---   PV Name               /dev/sda2   VG Name               centos   PV Size               465.12 GiB / not usable 4.00 MiB   Allocatable           yes   PE Size               4.00 MiB   Total PE              119071   Free PE               16   Allocated PE          119055   PV UUID               7Hmn3i-k2N3-Mij7-i2ae-8M1A-zoTm-PXiM9V  [root@xxx ~]# vgdisplay   --- Volume group ---   VG Name               centos   System ID   Format                lvm2   Metadata Areas        1   Metadata Sequence No  4   VG Access             read/write   VG Status             resizable   MAX LV                0   Cur LV                3   Open LV               3   Max PV                0   Cur PV                1   Act PV                1   VG Size               465.12 GiB   PE Size               4.00 MiB   Total PE              119071   Alloc PE / Size       119055 / <465.06 GiB   Free  PE / Size       16 / 64.00 MiB   VG UUID               EKC98O-RtWr-DDVl-Bx2I-w5Ln-v3Q1-hhzcey  [root@xxx ~]# lvdisplay   --- Logical volume ---   LV Path                /dev/centos/swap   LV Name                swap   VG Name                centos   LV UUID                25Sbxn-slkp-mSzY-5xGI-h5cd-qhrh-VCkYj7   LV Write Access        read/write   LV Creation host, time xxx, 2016-08-03 14:55:21 +0300   LV Status              available   # open                 2   LV Size                <7.88 GiB   Current LE             2016   Segments               1   Allocation             inherit   Read ahead sectors     auto   - currently set to     256   Block device           253:1    --- Logical volume ---   LV Path                /dev/centos/home   LV Name                home   VG Name                centos   LV UUID                ybaeQV-7PIO-Te4k-61hH-JBkU-hUG7-Pas1X7   LV Write Access        read/write   LV Creation host, time xxx, 2016-08-03 14:55:22 +0300   LV Status              available   # open                 1   LV Size                407.18 GiB   Current LE             104239   Segments               1   Allocation             inherit   Read ahead sectors     auto   - currently set to     256   Block device           253:2    --- Logical volume ---   LV Path                /dev/centos/root   LV Name                root   VG Name                centos   LV UUID                cFJJ2z-kHGg-NFbo-SwtL-hw1L-MkSm-0lz5ez   LV Write Access        read/write   LV Creation host, time xxx, 2016-08-03 14:55:23 +0300   LV Status              available   # open                 1   LV Size                50.00 GiB   Current LE             12800   Segments               1   Allocation             inherit   Read ahead sectors     auto   - currently set to     256   Block device           253:0 

Any suggestions on how to proceed using clonezilla or some other cloning utility?

Fresh magento 2.3 install on fresh install of centos 7 cant start install

**Body cannot contain “kagneto”. This is a site for kagento, not an X-Men character. 😉 **

Replace k with m for the above. Is this a joke? I had to rename the directories just to post the output.

I can’t start installation from the browser. When i visit /kagneto/setup i get a 500 error.

Created permissions set per the docs. The following are the permissions of the directory getting the error:

[someuser@localhost kagento]# ls -al /var/www/html/kagento/var/ total 8 drwxrws---.  5 someuser apache   73 Jan 14 10:23 . drwxrwx---. 14 someuser apache 4096 Jan 14 09:35 .. drwxrws---.  3 someuser apache   36 Jan 14 10:21 composer_home -rwxrwxrwx.  1 someuser apache  126 Jan 14 09:35 .htaccess drwxrws---.  2 someuser apache   23 Jan 14 10:22 log drwxrws---.  3 someuser apache   23 Jan 14 10:22 page_cache 

I’m getting the following error:

PHP Fatal error:  Uncaught kagento\Framework\Exception\FileSystemException: Directory "/var/www/html/kagento/var/cache/" cannot be created Warning!mkdir(): Permission denied in /var/www/html/kagento/vendor/kagento/framework/Filesystem/Driver/File.php:226\nStack trace:\n#0 /var/www/html/kagento/vendor/kagento/framework/Filesystem/Driver/File.php(200): kagento\Framework\Filesystem\Driver\File->mkdirRecursive('/var/www/html/m...', 511)\n#1 /var/www/html/kagento/vendor/kagento/framework/Filesystem/Directory/Write.php(93): kagento\Framework\Filesystem\Driver\File->createDirectory('/var/www/html/m...', 511)\n#2 /var/www/html/kagento/vendor/kagento/framework/App/Cache/Frontend/Factory.php(294): kagento\Framework\Filesystem\Directory\Write->create()\n#3 /var/www/html/kagento/vendor/kagento/framework/App/Cache/Frontend/Factory.php(132): kagento\Framework\App\Cache\Frontend\Factory->_getBackendOptions(Array)\n#4 /var/www/html/kagento/vendor/kagento/framework/App/Cache/Frontend/Pool.php(67): kagento\Framework\App\Cache\Frontend\Factory->create in /var/www/html/kagento/vendor/kagento/framework/Filesystem/Driver/File.php on line 226 

NIC count different between CentOS 6 and CentOS 7

I’ve recently installed CentOS 7 over CentOS 6 Under CentOS 6 I had 6 (eth0 through eth5) physical NICs all working correctly After the CentOS 7 installation I now have only 5 physical NICs (enp3s0; enp5s4f0; enp5s4f1; enp5s6f0; enp5s6f1). What happened to the other one??? Under CentOS 6 the basic definitions could be found at /etc/udev/rules.d; where are they located under CentOS 7?

magento 2 on centos 7

a website on centos 7 ec2 instance and get the following error PHP Parse error: syntax error, unexpected 'foreach' (T_FOREACH) in /dir/www/html/app/code/Webkul/Marketplace/Block/Collection.php on line 145 although this line doesn’t contain foreach. and when I go to to project directory I found all files and directories deleted and only app folder with code folder and design folder. and when get into code folder I found only webkul folder.

Note: that’s happend after stop and start the instance

So what’s the problem

CENTOS 7 – Auto block IP with null routes

Whenever I notice overload on my media (videos) server, I check for ddos with this command from netstat:

netstat -ntu | awk '{print $  5}' | cut -d: -f1 | sort | uniq -c | sort -n 

It shows currently established connection number by IP.

Basically, for my server conn. number between 1-20 is OK. But very often I get IPs with over 200 connections. It means someone is downloading tons of videos from my server. What I do is just route add 0.0.0.0 reject

I have to check and block IPs manually. Is there a way I could setup it to be automatic? Automatically route any IP that reaches conn. number of ~80.