viernes, 28 de junio de 2019

Asterisk SIP & IAX2 Reload CRONTAB


En consola del Linux entramos a:

# cd /etc/cron.daily

Creamos script para recargar SIP y IAX2

# nano sip_iax_reload y adicionamos lo siguiente:

#!/bin/bash
/usr/sbin/asterisk -rx "sip reload"
/usr/sbin/asterisk -rx "iax2 reload"
# you may need to change full path to the Asterisk binary

 
Asignamos permisos de Ejecución

# chmod 755 sip_iax_reload


Mikrotik Bandwidth Test

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





En Consola de Mikrotik

/tool bandwidth-test 87.121.0.45 user=neterra password=neterra direction=both

q para terminar

lunes, 20 de junio de 2016

Captura de Paquetes


tethereal -a duration:10000 -i eth0 -f "host 192.168.10.10"

jueves, 5 de mayo de 2016

Mikrotik - Blockeo de Videos Youtube

Fuente: http://www.ryohnosuke.com/foros/index.php?threads/14042/


Limitar ancho de banda por contenido en Mikrotik

Ejemplo con Videos de Youtube


/ip firewall mangle

add action=mark-connection chain=prerouting comment="Block Youtube" content=\ youtube new-connection-mark=youkill passthrough=yes
add action=mark-packet chain=prerouting connection-mark=youkill \ new-packet-mark=youdown passthrough=no

/queue tree

add limit-at=1k max-limit=1k name=you_bad packet-mark=youdown parent=LAN03 queue=default




Esto limita la carga de videos " MUY LENTA "

lunes, 10 de agosto de 2015

Generar Claves SSH

Fuente: https://www.digitalocean.com/community/tutorials/how-to-use-ssh-keys-with-digitalocean-droplets

Create the RSA Key Pair

The first step is to create the key pair on the client machine (there is a good chance that this will just be your computer):


ssh-keygen -t rsa
 
 
 

Copy to Server

cat ~/.ssh/id_rsa.pub | ssh root@[your.ip.address.here] "cat >> ~/.ssh/authorized_keys"

 

 

 
 
 
 

 

lunes, 15 de junio de 2015

Upgrade/iRedAdmin-Pro/LDAP to 2.1.2

Fuente: http://www.iredmail.org/wiki/index.php?title=Upgrade/iRedAdmin-Pro/LDAP/2.1.1-2.1.2

nano upgrade_iredadmin.sh

# Debian
        export DISTRO='DEBIAN'
        export HTTPD_SERVERROOT='/opt/www'
        export RC_SCRIPT_HTTPD='/etc/init.d/apache2'



Terminal: 
 
# tar xjf /root/iRedAdmin-Pro-LDAP-2.1.2.tar.bz2 -C /tmp/
# cd /tmp/iRedAdmin-Pro-LDAP-2.1.2/tools/
# bash upgrade_iredadmin.sh
# rm -rf /tmp/iRedAdmin-Pro-LDAP-2.1.2/

sábado, 9 de mayo de 2015

Generate Polycom XML directory file from FreePBX DB

Fuente: https://www.snip2code.com/Snippet/388850/Generate-Polycom-XML-directory-file-from


#!/bin/bash

# Author: Thyrus Gorges
# Date: 2015/03/04

#The MIT License (MIT)

#Copyright (c) <2015>

#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
#furnished to do so, subject to the following conditions:

#The above copyright notice and this permission notice shall be included in
#all copies or substantial portions of the Software.

#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
#THE SOFTWARE.


# Build a Polycom Directory XML file
# by pulling the usernames and extensions of all SIP users

# Set so we can loop on newlines instead of spaces
IFS=$'\n'

# MySQL Creds
SQLUSER=
SQLPASS=

# Declare our file
FILE=/tftpboot/000000000000-directory.xml

# Remove old file
rm $FILE

# ReCreate our file
touch $FILE


# Write the header of the file
# Passing the -e option to echo allows us to use tabs
echo -e '' >> $FILE
echo -e '' >> $FILE
echo -e '' >> $FILE
echo -e "\t" >> $FILE


# Query Database
# We pass -N to MySQL so it doens't print headers
for i in $( mysql -u $SQLUSER -p$SQLPASS -N -e "use asterisk; select extension, name from users;" ); do
        # Assign Variables to each field
        EXTEN=`echo $i | cut -f1`
        FN=`echo $i | cut  -f2 | cut -d" " -f1`
        LN=`echo $i | cut -d" " -f2`
        # The item tag is the beginning of a contact
        echo -e "\t\t" >> $FILE
        echo -e "\t\t\t $LN " >> $FILE
        echo -e "\t\t\t $FN " >> $FILE
        echo -e "\t\t\t $EXTEN " >> $FILE
        echo -e "\t\t
" >> $FILE
done

# Write file endings
echo -e "\t
" >> $FILE
echo -e "
" >> $FILE