BackupPC – Installation

Installation

Deb systems:

apt install backuppc

CentOS:

yum install backuppc

 

Select in the “Postfix Configuration” “No configuration“, if you do not need notifications by mail.

Then they write to us, at what URL BackupPC will be available, as well as login/password for access.

Password can be changed:

htpasswd /etc/backuppc/htpasswd backuppc

If you change the user, then the Web interface may have no fields for configuring BackupPC, since such a user must be in the system and specified in the file: “/etc/backuppc/config.pl

Continue reading “BackupPC – Installation”

AWS – Send a file to S3 Bucket using CURL

# AWS S3 Credentials
S3_BUCKET="YOUR_S3_BUCKET_NAME"
S3_ACCESS_KEY="YOUR_ACCESS_KEY"
S3_SECRET_KEY="YOUR_SECRET_KEY"

FILE_NAME="test.tar.gz"

# SENDING

date="$(date +%Y%m%d)"
dateFormatted="$(date -R)"
relativePath="/${S3_BUCKET}/${FILE_NAME}"
contentType="application/octet-stream"
stringToSign="PUT\n\n${contentType}\n${dateFormatted}\n${relativePath}"
signature="$(echo -en ${stringToSign} | openssl sha1 -hmac ${S3_SECRET_KEY} -binary | base64)"
curl -X PUT -T "${FILE_NAME}" \
-H "Host: ${S3_BUCKET}.s3.amazonaws.com" \
-H "Date: ${dateFormatted}" \
-H "Content-Type: ${contentType}" \
-H "Authorization: AWS ${S3_ACCESS_KEY}:${signature}" \
http://${S3_BUCKET}.s3.amazonaws.com/${FILE_NAME}

 

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”