Posts

Docker certbor autoreNEW cert cron job

Hi. If You using a Portainer for deploy yours applications with nginx, apache and Let’s Encrypt SSL you will need to auto renew the certificates when they were ended. I'm using that bash script and put it in the  /etc/cron.weekly folder (using UBUNTU 22.03)  #!/bin/bash # Set PATH PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin # Run the certbot container to renew the certs docker run -ti --rm -v certbot-webroot-VOLUME:/var/www/certbot -v certbot-data-VOLUME:/etc/letsencrypt:rw certbot/certbot renew # Restart container docker restart container-WITH-WEB-SERVER # Copy cert for Portainer cat /var/lib/docker/volumes/certbot-data-VOLUME/_data/live/YOUR.DOMAIN.COM/fullchain.pem > /opt/portainer/certs/cert.pem cat /var/lib/docker/volumes/certbot-data/_data/live/YOUR.DOMAIN.COM/privkey.pem > /opt/portainer/certs/key.pem docker restart portainer PS. When You will put script to the   /etc/cron.weekly   folder don't add an extension to the script only name. With a

Seample redirects on the .htaccess

Example simple redirect on the .htaccess using rewrite module of the APACHE (httpd) #redirects of one URL RewriteCond %{REQUEST_URI} ^/madres-subrogadas/ RewriteRule .* https://exanple.com/es/moms/ [R=301,L] #redirect all domain RewriteRule (.*)$ https://example.com/es/ [R=301,L]

IPv6 proxy on VPS

This draft article only for remembering  Host company with ipv6 /64 network https://www.vpsag.com/ Script for ganarate ipv6 on python3   #!/usr/bin/env python3 """ Generate a random IPv6 address for a specified subnet """ from random import seed, getrandbits from ipaddress import IPv6Network, IPv6Address subnet = '2001:db8:100::/64' seed() network = IPv6Network(subnet) address = IPv6Address(network.network_address + getrandbits(network.max_prefixlen - network.prefixlen)) print(address) Generate 1000 ip $ for ip in {1..1000}; do python random-ipv6-addr.py ; done add ipv6 address to interface from file cat iplist1.txt | while read ip;do ip -6 addr add $ip dev eth0; done https://ip6.sh/ can be used to ganarate IPs example https://blog.vpsville.ru/blog/howto/133.html

Schedule delete email with doveadm

 for i in $(ls /directory_with_email); do doveadm expunge -u "$i" mailbox Trash before 30d; done for i in $(ls /directory_with_email); do doveadm expunge -u "$i" mailbox Junk before 30d; done for i in $(ls /directory_with_email); do doveadm expunge -u "$i" mailbox INBOX before 365d; done

Розпакування архівів ISPmanager 5 Lite руками

Всі маніпуляції проводимо з під Лінукса. 1. Спочатку розшифровуємо кожен архів openssl enc -aes-256-cbc -d -in F2019-09-29.dotcom.tgz.aes.part1 -out F2019-09-29.dotcom.tgz.part1 -pass pass:********** 2. Потім ті частини збираємо докупи. cat F2019-09-29.dotcom.tgz.part1 F2019-09-29.dotcom.tgz.part2 > F2019-09-29.dotcom.tgz 

Configure pptp-client with static IP on Centos 7

/etc/sysconfig/network-scripts/ifcfg-pptpserver ONBOOT=yes USERCTL=yes TYPE=Modem PEERDNS=no DEVICE=ppp0 /etc/ppp/peers/pptpserver #pty "pptp 31.31.31.31 --nolaunchpppd" name site #require-mppe-128 #persist holdoff 10 maxfail 0 lcp-echo-interval 15 lcp-echo-failure 4 pty "/usr/sbin/pptp 31.31.31.31 --nolaunchpppd" #usepeerdns nodefaultroute persist holdoff 30 noauth file /etc/ppp/options.pptp /etc/ppp/option.pptp ############################################################################### # $Id: options.pptp,v 1.3 2006/03/26 23:11:05 quozl Exp $ # # Sample PPTP PPP options file /etc/ppp/options.pptp # Options used by PPP when a connection is made by a PPTP client. # This file can be referred to by an /etc/ppp/peers file for the tunnel. # Changes are effective on the next connection.  See "man pppd". # # You are expected to change this file to suit your system.  As # packaged, it requires PPP 2.4.2 or later from htt

Nginx 1.14 On UBUNTU 18.04 configure alias

This is simple example location /webmail {     alias /usr/share/roundcube;     try_files $uri $uri/ /index.php;     location ~ \.php$ {         include snippets/fastcgi-php.conf;             fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;     fastcgi_param SCRIPT_FILENAME $request_filename;     }    }