понедельник, 18 марта 2019 г.

UniFi Controller Setup for Ubiquiti Access Points

How to set up a UniFi controller and add WiFi Access Points to it.
Controller is available for Windows, as well as for Linux.

Install UniFi controller


Download and install the controller for you OS
https://www.ui.com/download/unifi

Setup you Access Point

Before you start the access point, you have to setup special DHCP settings on your router or DHCP server you have. You´ll need the MAC-address of your Access Point. On the Acccess Point's back you'll find smth linke 1709KF09FC27CEF1E-IZSvX6 - the MAC part is: F09F C27C EF1E
Convert it into Cisco format:
just add 01 + MAC (and place the dots in the proper positions) - 01f0.9fc2.7cef.ef

Cisco DHCP setup for your Access Points.
ip dhcp pool UniFi411
   host 192.168.4.11 255.255.255.0 - IP Адрес для ваше точки доступа
   client-identifier 01f0.9fc2.7cef.ef   - MAC точки доступа
   client-name UniFi411                    - Имя, на ваше усмотрение
   option 43 hex 0104.c0a8.033a     - Адрес UniFi контроллера

Convert the IP into HEX format (for 43 dhcp option):

After the Access Point will appear in your UniFi controller - click Adopt.

Reset to Factory Defaults

1) Connecto over SSH to the Access Point and execute:
     syswrapper.sh restore-default
OR
2) Press Reset button on AP's back more than 5 sec. Sometimes you need firstly shutdown the access point, press Reset, turn on the AP back, wait more than 5 seconds, then release Reset button.

воскресенье, 10 марта 2019 г.

Install Docker on Ubuntu/Debian

Installation steps Ubuntu/Debian
#apt-get install apt-transport-https ca=certificates curl software-properties-common

Configure repository
#curl -fsSL https://download.docker./com/linux/ubuntu/gpg | sudo apt-key add -

#sudo add-apt-repository "deb {arch+amd64} https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

#apt-get update

Install Docker
#apt-get install docker-ce

пятница, 8 марта 2019 г.

Get a Dockerfile from an Image

docker history --no-trunc [IMAGE]| tac | tr -s ' ' | cut -d " " -f 5- | sed 's,^/bin/sh -c #(nop) ,,g' | sed 's,^/bin/sh -c,RUN,g' | sed 's, && ,\n  & ,g' | sed 's,\s*[0-9]*[\.]*[0-9]*[kMG]*B\s*$,,g' | head -n -1

воскресенье, 3 марта 2019 г.

Install Docker Compose

yum install epel-release
yum -y install python-pip
pip install --upgrade-pip
pip install --upgrade pip
pip install docker-compose

воскресенье, 24 февраля 2019 г.

Docker installation CentOS 7


yum -y install yum-utils lvm2
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum -y update
yum -y install docker-ce
systemctl enable docker && systemctl start docker && systemctl status docker

docker images

ls -al /var/run/docker.sock
srw-rw---- 1 root docker 0 Feb 22 06:10 /var/run/docker.sock

adding a user a right to work with docker
usermod -aG docker user


All Docker files:
/var/lib/docker


Error on Registry Deployment (IPtables):
 docker run -d -p 5000:5000 -v /root/certs:/certs -e REGISTRY_HTTP_TLS_CERTIFICATE=/certs/dockerrepo.crt -e REGISTRY_HTTP_TLS_KEY=/cert/dockerrepo.key -v /root/auth:/auth -e REGISTRY_AUTH=htpasswd -e REGISTRY_AUTH_HTPASSWD_REALM="Registry Realm" -e REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd registry:2
0e38a074708e3113cd207fa83d72d90e41374b7643e73e21dbb3cf6d88abd3fa
docker: Error response from daemon: driver failed programming external connectivity on endpoint elegant_hugle (6f83023f4c9f4cf2910b77ddd1c3227e29988e3dfb16f850d4dc7e74c8304638):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 5000 -j DNAT --to-destination 172.17.0.2:5000 ! -i docker0: iptables: No chain/target/match by that name.
 (exit status 1)).

Solution:
iptables -t filter -F
iptables -t filter -X
systemctl restart docker


Run Ansible in VSCode on Windows 10 (via WSL + Terminal + pip)

Short instruction how to setup VSCode to execute Ansible playbooks directly from Terminal

воскресенье, 13 января 2019 г.

воскресенье, 6 января 2019 г.

Virtual Host for OwnCloud SSL LetsEncrypt (Dehydrated, Apache)



/etc/httpd/conf.d/owncloud.conf

<VirtualHost *:80>
    ServerName DOMAIN.COM
        DocumentRoot /var/www/html/owncloud

        <Directory /var/www/html/owncloud>
                AddDefaultCharset UTF8
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/disk-error.log
        CustomLog /var/log/disk-requests.log combined

        Alias /.well-known/acme-challenge/ /var/www/html/le/.well-known/acme-challenge/