FIX ERROR – Exportfs requires FSID = for NFS Export

When attempting to mount the file system, the following error occurs:

exportfs requires fsid= for nfs export

Solution

It is necessary to set the value "fsid" any in the range from 1 to 255, and for each such mount point it must be unique.

In the file "/etc/exports" we describe our ball:

/run 192.168.1.0/24(rw,fsid=1,sync,no_root_squash,no_all_squash)

Rereading it:

exportfs -a

Now this directory can be mounted.

BackupPC 3 – Nginx

 

Install "fcgiwrap"

Deb system:
apt install fcgiwrap

CentOS:

yum install fcgiwrap

 

Add to autorun and run:

systemctl enable fcgiwrap
systemctl start fcgiwrap
backuppc.conf
server {
    listen 80;
    server_name backuppc.artem.services;
    root  /usr/share/backuppc;
 
    index cgi-bin/index.cgi;
 
    access_log  /var/log/nginx/backuppc.access.log;
    error_log   /var/log/nginx/backuppc.error.log;
 
    location / {
        location /backuppc {
            alias /usr/share/backuppc;
        }

        auth_basic "Backup";
        auth_basic_user_file /etc/backuppc/htpasswd;
 
        location ~ \.cgi$ {
            include fastcgi_params;
            fastcgi_pass unix:/run/fcgiwrap.socket;
 
            fastcgi_param REMOTE_ADDR     $remote_addr;
            fastcgi_param REMOTE_USER     $remote_user;
            fastcgi_param SCRIPT_FILENAME /usr/share/backuppc/cgi-bin/index.cgi;
        }
    }
}

 

Kubernetes – Ingress access from certain IP

ingress.yml

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: artem-services-ing
  namespace: staging
  annotations:
    kubernetes.io/ingress.class: ingress-staging
    certmanager.k8s.io/cluster-issuer: letsencrypt-staging
    certmanager.k8s.io/acme-challenge-type: dns01
    certmanager.k8s.io/acme-dns01-provider: dns
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/server-snippet: |
      if ($remote_addr !~ "^(1.1.1.1|2.2.2.2|3.3.3.3)$") {
        return 403;
      }

spec:
  tls:
  - hosts:
    - artem.services
    secretName: artem.services-secret-tls
  rules:
  - host: artem.services
    http:
      paths:
      - path: /
        backend:
          serviceName: artem-services-svc
          servicePort: 80

Heroku – Ruby on Rails

System preparation

apt install curl git gnupg2 nodejs

Install RVM

Go to the site rvm.io and look at the installation commands:

gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
curl -sSL https://get.rvm.io | bash -s stable

Add a user to the group:

vim /etc/group
rvm:x:1001:ubuntu

My username in the systemubuntu

 

Then from the user:

source /etc/profile.d/rvm.sh

Continue reading "Heroku – Ruby on Rails"

Jenkins – Fastlane build iOS and Android apps

Using Jenkins and Fastlane, we will build applications on iOS and Android, send artifacts to Slack, and also automatically send an iOS application to Testflight. The build is configured from the develop and release branches, and reads the release version (major and minor) from them, and adds the build number.

For example: the branch is release/1.0 and the Jenkins number of build 25, then the application version will be 1.0.25

For the building will be needed:

For convenience, my application is everywhere called: "my_mobile_app"

Continue reading "Jenkins – Fastlane build iOS and Android apps"

Kubernetes – Installing and creating a cluster

First you need to install Docker.

For Kubernetes to work correctly, you must disable SWAP

swapoff -a

Also check delete it with fstab

Add Kubernetes repository and install

Ubuntu:

apt update && apt install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -

cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
deb http://apt.kubernetes.io/ kubernetes-xenial main
EOF

apt update
apt install -y kubelet kubeadm kubectl

CentOS 7:

cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF

setenforce 0

yum install -y kubelet kubeadm kubectl

Continue reading "Kubernetes – Installing and creating a cluster"

AWStats – Nginx

 

AWStats is by default tuned to work with the Apache log, in this article I will show how to get statistics from Nginx logs.

Install Awstats and the GeoIP module

yum install awstats htmldoc GeoIP perl-Geo-IP

Install the Perl handler

yum -y install spawn-fcgi fcgi-devel wget
yum -y groupinstall "Development Tools"
mkdir /tmp/perl && cd /tmp/perl && wget http://github.com/gnosek/fcgiwrap/tarball/master -O fcgiwrap.tar.gz
tar -xf fcgiwrap.tar.gz && cd gnosek-fcgiwrap-*

autoreconf -i
./configure
make
make install

Continue reading "AWStats – Nginx"

Terraform – Installation

Installing Terraform is quite simple, since it is written in Go, just download the archive with the binary file.

Go to the download page:

https://www.terraform.io/downloads.html

Download the archive, extract the binary file and move it to "/usr/bin/" (or write it to PATH)

Check:

terraform --version

If you use the "bash" or "zsh" shell, you can add autocompletion for Terraform with the following command:

terraform -install-autocomplete