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 "
jueves, 5 de mayo de 2016
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:
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
2015>
#!/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 '
echo -e "\t
# 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
echo -e "\t\t\t
echo -e "\t\t\t
echo -e "\t\t\t
echo -e "\t\t
done
# Write file endings
echo -e "\t
echo -e "
miércoles, 22 de abril de 2015
Install g729 Elastix
Fuente: http://wiki.kolmisoft.com/index.php/G723/G729_Codec_installation
Download and execute the register utility to generate a valid license.
Change the permissions of the /root/register file to r-x------.
Run the register utility and follow the interactive instructions. The registration utility will prompt you for your G.729 license key.
Download and execute the benchg729 utility to determine the optimum build.
Change the permissions of the /root/benchg729 file to r-x------
Run the benchg729 utility and record the build that it recommends should be used for your platform.
Download and install the codec_g729 binary that is built for your platform from
http://downloads.digium.com/pub/telephony/codec_g729/asterisk-1.8.4/x86-64/
NOTE: Asterisk 1.8.23 requires binaries from exactly this download directory.
Extract downloaded file and copy codec_g729a.so to /var/lib/asterisk/modules.
Move original codec_g729.so to another directory for backup purposes.
Restart Asterisk and check if license is found:
G729 license installation
These instructions works with Asterisk 1.8.23Download and execute the register utility to generate a valid license.
cd /root wget http://downloads.digium.com/pub/register/x86-64/register
Change the permissions of the /root/register file to r-x------.
chmod 500 /root/register
Run the register utility and follow the interactive instructions. The registration utility will prompt you for your G.729 license key.
/root/register
Download and execute the benchg729 utility to determine the optimum build.
cd /root wget http://downloads.digium.com/pub/telephony/codec_g729/benchg729/x86-64/benchg729-1.0.8-x86_64 -O benchg729
Change the permissions of the /root/benchg729 file to r-x------
chmod 500 /root/benchg729
Run the benchg729 utility and record the build that it recommends should be used for your platform.
/root/benchg729
Download and install the codec_g729 binary that is built for your platform from
http://downloads.digium.com/pub/telephony/codec_g729/asterisk-1.8.4/x86-64/
NOTE: Asterisk 1.8.23 requires binaries from exactly this download directory.
Extract downloaded file and copy codec_g729a.so to /var/lib/asterisk/modules.
Move original codec_g729.so to another directory for backup purposes.
Restart Asterisk and check if license is found:
asterisk -rvvv *CLI> g729 show licenses 0/0 encoders/decoders of 26 licensed channels are currently in use Licenses Found: Key: G729-EXAMPLE1 -- Host-ID: ex:am:pl:e0:ex:am:pl:e0:ex:am:pl:e0:ex: am:pl:e0:ex:am:pl:e0 -- Channels: 2 (Expires: 2026-09-26) (OK) Key: G729-EXAMPLE2 -- Host-ID: ex:am:pl:e0:ex:am:pl:e0:ex:am:pl:e0:ex: am:pl:e0:ex:am:pl:e0 -- Channels: 24 (Expires: 2026-09-26) (OK)
jueves, 16 de abril de 2015
Rsync Examples
Origen: http://www.tecmint.com/rsync-local-remote-file-synchronization-commands/
1- Copy/Sync Files and Directory Locally
This following command will sync a single file on a local machine from one location to another location. Here in this example, a file name backup.tar needs to be copied or synced to /tmp/backups/ folder.
Copy Files
[root@tecmint]# rsync -zvh backup.tar /tmp/backups/
Copy Directory
[root@tecmint]# rsync -avzh /root/rpmpkgs /tmp/backups/
2- Copy/Sync Files and Directory to or From a Server
This command will sync a directory from a local machine to a remote machine. For example: There is a folder in your local computer “rpmpkgs” which contains some RPM packages and you want that local directory’s content send to a remote server, you can use following command.
Copy a Directory from Local Server to a Remote Server
[root@tecmint]$ rsync -avz rpmpkgs/ root@192.168.0.101:/home/
Copy/Sync a Remote Directory to a Local Machine
[root@tecmint]# rsync -avzh root@192.168.0.100:/home/tarunika/rpmpkgs /tmp/myrpms
1- Copy/Sync Files and Directory Locally
This following command will sync a single file on a local machine from one location to another location. Here in this example, a file name backup.tar needs to be copied or synced to /tmp/backups/ folder.
Copy Files
[root@tecmint]# rsync -zvh backup.tar /tmp/backups/
Copy Directory
[root@tecmint]# rsync -avzh /root/rpmpkgs /tmp/backups/
2- Copy/Sync Files and Directory to or From a Server
This command will sync a directory from a local machine to a remote machine. For example: There is a folder in your local computer “rpmpkgs” which contains some RPM packages and you want that local directory’s content send to a remote server, you can use following command.
Copy a Directory from Local Server to a Remote Server
[root@tecmint]$ rsync -avz rpmpkgs/ root@192.168.0.101:/home/
Copy/Sync a Remote Directory to a Local Machine
[root@tecmint]# rsync -avzh root@192.168.0.100:/home/tarunika/rpmpkgs /tmp/myrpms
martes, 20 de enero de 2015
Install Wine on Debian
Fuente: http://ask.xmodulo.com/install-wine-linux.html
Since Wine is included in the default repository of Debian, you can install it with apt-get. However, if you are using 64-bit Debian, you need to enable multi-architecture, as Wine is a 32-bit application.
On 64-bit Debian:
On 32-bit Debian:
Since Wine is included in the default repository of Debian, you can install it with apt-get. However, if you are using 64-bit Debian, you need to enable multi-architecture, as Wine is a 32-bit application.
On 64-bit Debian:
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install wine-bin:i386
$ sudo apt-get update
$ sudo apt-get install wine-bin:i386
$ sudo apt-get install wine
Suscribirse a:
Entradas (Atom)