viernes, 30 de octubre de 2020

Mikrotik Hotspot

 http://cotswoldpc.blogspot.com/p/mikrotik-routerboard-rb750up-simple.html

https://datoweb.com/post/433-validar-correo-electrnico-con-javascript 

https://blog.reaccionestudio.com/validar-email-con-javascript-y-html-5/

https://stackoverflow.com/questions/8389646/send-post-data-on-redirect-with-javascript-jquery

viernes, 23 de octubre de 2020

Mikrotik Capsman

 https://mum.mikrotik.com//presentations/AR15/presentation_2731_1447746341.pdf

 https://www.mikrotiklabs.com/2020/03/30/que-es-capsman-de-mikrotik/

 https://siemlab.com/capsman-mikrotic-espanol-tutorial-1/

https://forum.mikrotik.com/viewtopic.php?t=108199 

https://wiki.mikrotik.com/wiki/Manual:Simple_CAPsMAN_setup

https://forum.mikrotik.com/viewtopic.php?t=136476

https://wiki.mikrotik.com/wiki/Manual:CAPsMAN_with_VLANs

https://mum.mikrotik.com/presentations/BR14/Uldis.pdf

jueves, 22 de octubre de 2020

Test de velocidad para mikrotik

 

Para acceder a la herramienta de prueba de ancho de banda desde Webmin o Winbox hay que dirigirse a System > Bandwidth Test. Su uso es bastante simple: se ingresa la IP (v4 o V6), si descarga, envía o ambos (dirección de datos) y las credenciales (usuario y contraseña) correspondientes al servidor.

Prueba de ancho de banda mikrotik

Para utilizar esta herramienta desde la terminal utilizamos el comando bandwidth-test. En el siguiente comando vamos a hacer una prueba por 15 segundos en ambas direcciones.

/tool bandwidth-test address=207.32.194.24 direction=both duration=15s user="btest" password="btest"

Servidores públicos Mikrotik.

Si sólo se cuenta con un router Mikrotik, existen un par de servidores públicos para hacer las pruebas correspondientes. ⚠️ NO ABUSAR

IPv4: 207.32.194.24
IPv6: 2605:4e40:0:1fe::
Usuario: btest
Contraseña: btest

IPv4: 87.121.0.45
Usuario: neterra
Contraseña: neterra

 

Fuente:

https://logico.ar/blog/2019/09/9/probar-la-velocidad-de-internet-desde-un-router-mikrotik

martes, 13 de octubre de 2020

Git exclude some files

 

.gitignore is for ignoring untracked files, but you need to ignore changes in the tracked one. you could use git update-index --skip-worktree /path/to/config.php

See https://git-scm.com/docs/git-update-index#_skip_worktree_bit

 

 

https://git-scm.com/docs/gittutorial

 

jueves, 8 de octubre de 2020

Purge bacula

 

I’ve been using bacula for a couple of months now in conjunction with puppet to make automated backups of all servers that are managed by puppet. My bacula setup labels a volume for every job it runs with a unique name:

Bacula Label Format
1
Label Format = "${Job}.${Year}${Month:p/2/0/r}${Day:p/2/0/r}.${Hour:p/2/0/r}${Minute:p/2/0/r}"

These volumes are automatically purged once the retention of all files contained on the volume expires (which is configured per-pool). Due to the unique names however, the volumes cannot be recycled. The result of this is that the volumes that have been marked as purged in the catalog remain as-is on the disk. After some time this ultimately resulted in a full disk, thus halting all backups performed on that pool. Not good. Not good at all.

I thought volumes would be truncated at the time they are marked as purged, but I probably made some configuration error somewhere along the road or I don’t quite understand how the truncating process works, because all of my purged disks are using their original disk space.

Because I’m pressed for time and can’t be bothered with old backups anyway, I’ve decided to just delete all purged volumes (which were beyond their retention date anyway). Perhaps the steps I took to delete these volumes can help others (Or others can recommend me a better way to deal with old volumes), so here goes:

Pruning all clients

Before you start cleaning old volumes, it might be wise to ensure that all volumes are pruned before cleaning, so you maximize the number of volumes you are going to delete.

Pruning all clients
1
2
3
4
5
6
7
#!/bin/bash
clients=`mysql -e'select Name from Client ORDER BY Name ASC;' bacula | tail -n+2`
  
for client in `echo $clients`
do
  echo "prune files client=${client} yes" | bconsole
done

Checking the number of volumes to be purged

Using list volumes in bconsole you can check the status of all volumes known to bacula. I’m merely interested in the number of volumes that are currently marked as purged:

Listing the number of Purged Volumes
1
echo "list volumes" | bconsole | grep "Purged" | awk {'print $4'} | wc -l

This resulted in a list of thousands of volumes. (We’re running, full, incremental and diff backups, so the numbers stack up). Time to get rid of them.

Removing purged volumes from the catalog and deleting them

Using this script I’ve removed all purged volumes from the catalog, after which they were physically deleted from the disk, freeing up precious space for more recent backups.

Deleting all Purged Volumes
1
2
3
4
5
#!/bin/bash
for f in `echo "list volume" | bconsole | grep Purged | cut -d ' ' -f6`; do
  echo "delete volume=$f yes" | bconsole;
  rm -rf /mnt/bacula/default/$f;
done

Removing volumes that are missing from the catalog

Somehow I also ended up with some volumes on the disk that were not present in the bacula catalog at all. In my opinion these could be cleaned up as well, hence:

Deleting volumes that are not present in the catalog
1
2
3
4
5
6
7
8
9
#!/bin/bash

cd /mnt/bacula/default
for i in `find . -maxdepth 1 -type f -printf "%f\n"`; do
  echo "list volume=$i" | bconsole | if grep --quiet "No results to list"; then
        echo "$i is ready to be deleted"
        rm -f /mnt/bacula/default/$i
  fi
done

Finishing up

To prevent full disks these tasks should be scheduled using cron and run daily (or at least weekly) to keep your disks and catalog lean & clean.

 

Other script

for volname in $(echo "list media pool=File" |bconsole | cut -f 3 -d '|' | tail -3 | tr -d " " | grep -v -e "+-----"); do echo purge volume=$volname |bconsole; done

 

 Fuente:

https://rem.co/blog/2015/01/15/bacula-purging-and-deleting-old-volumes/

 

viernes, 2 de octubre de 2020

Cómo configurar un Hotspot con MikroTik y RouterOS

Capturing email address in hotspot login

https://forum.mikrotik.com/viewtopic.php?t=33952

 

https://mum.mikrotik.com//presentations/US15/michael.pdf

 https://wiki.mikrotik.com/wiki/HotSpot_external_login_page

 Template de mikrotik

https://mikrotikthemes.airpoint.club/2017/02/free-wifi-zone.html

 

Cómo configurar un Hotspot con MikroTik y RouterOS

https://www.raulprietofernandez.net/blog/mikrotik/como-configurar-un-hotspot-con-mikrotik-y-routeros

jueves, 9 de julio de 2020

BBB server behind the NAT

If your BBB server behind the NAT uncomment the line
externalAddress=10.20.30.40
in the /etc/kurento/modules/kurento/WebRtcEndpoint.conf.ini file and replace ip with your external IP address. This is worked for me!
Fuente:
https://github.com/bigbluebutton/bigbluebutton/issues/6797

jueves, 25 de junio de 2020

Certificado y virtualhost con centos 8

Necesitaba tener configurado httpd para que utilice https con un certificado, y encontre este articulo:
https://comoinstalar.me/como-instalar-apache-en-centos-8/

Tambien para obtener un certificado utilice estas dos webs:
https://letsencrypt.org/es/getting-started/

https://certbot.eff.org/lets-encrypt/centosrhel8-apache

  1. SSH into the server SSH into the server running your HTTP website as a user with sudo privileges.
  2. Enable EPEL repo You'll need to enable the EPEL (Extra Packages for Enterprise Linux) repository and make sure you follow all instructions for your system, including enabling any other recommended repositories that may be required.
    Follow these instructions at the Fedora wiki to enable EPEL.
  3. Install Certbot Run this command on the command line on the machine to install Certbot.
    sudo dnf install certbot python3-certbot-apache
  4. Choose how you'd like to run Certbot
    • Either get and install your certificates... Run this command to get a certificate and have Certbot edit your Apache configuration automatically to serve it, turning on HTTPS access in a single step.
      sudo certbot --apache
    • Or, just get a certificate If you're feeling more conservative and would like to make the changes to your Apache configuration by hand, run this command.
      sudo certbot certonly --apache
  5. Set up automatic renewal We recommend running the following line, which will add a cron job to the default crontab.
    echo "0 0,12 * * * root python -c 
    'import random; import time; time.sleep(random.random() * 3600)' 
    && certbot renew -q" | sudo tee -a /etc/crontab > /dev/null
  6. Confirm that Certbot worked To confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar. If you want to check that you have the top-of-the-line installation, you can head to https://www.ssllabs.com/ssltest/.