nm-connection- editor
viernes, 10 de octubre de 2014
Ubuntu Gnome Edit Network Connection
Con este comando editamos las Conecciones de Red y se configuran los clientes VPN.
martes, 23 de septiembre de 2014
Creating an Application Launcher for GNOME 3 in Ubuntu
Origen: http://stackoverflow.com/questions/12964512/creating-an-application-launcher-for-gnome-3-in-ubuntu
create a file called intellij.desktop in the directory /usr/share/applications/
my file looks like this
create a file called intellij.desktop in the directory /usr/share/applications/
my file looks like this
[Desktop Entry]
Name=IntelliJ IDEA Community Edition
Comment=Free Java, Groovy, Scala and Android applications development
Exec=/path/to/your/bin/idea.sh
Path=/path/to/your/bin
Terminal=false
Icon=intellij-idea-ce
Type=Application
Categories=Development;IDE
viernes, 22 de agosto de 2014
LDAP Replication with syncrepl on Linux
Fuente Original: http://wiki.unixh4cks.com/index.php/OpenLDAP_:_LDAP_Replication_with_syncrepl_on_Centos_5.x
Configure master (provider)
[root@openldap_a ~]# tail -n 5 /etc/openldap/slapd.conf overlay syncprov syncprov-checkpoint 1 10 syncprov-sessionlog 100
Configure slave (consumer)
[root@openldap_c ~]# tail -n 10 /etc/openldap/slapd.conf syncrepl rid=1 provider=ldap://openldap_a.unixh4cks.com type=refreshAndPersist searchbase="dc=unixh4cks,dc=com" schemachecking=off bindmethod=simple binddn="cn=Manager,dc=unixh4cks,dc=com" credentials=secret updateref ldap://openldap_a.unixh4cks.com.com/ [root@openldap_c ~]#
martes, 22 de julio de 2014
COMO CALCULAR LA CANTIDAD DE BLOCK
Fuente: http://todo-sobre-construccion.blogspot.com/2011/02/como-calcular-la-cantidad-de-block.html
En este artículo vas a aprender como calcular la cantidad de block que te llevaras en la construcción de un muro.
Primero que nada debes tener o más bien saber cuantos metros cuadrados de muro vas a construir, esto es fácil es solo sacar el área del muro. Por ejemplo:
tenemos 2 muros de 2.5 mts. de largo con una altura de 2 mts. por lo tanto:
Metros de muro:
A1= 2.5 x 2= 5 m2 (m2=metros cuadrados)
A2= 2.5 x 2= 5 m2
Total =10 m2
Ya teniendo los metros cuadrados de muro entonces debemos conocer el área que abarca el block contemplando la junta de mortero.
Por ejemplo para un block de 15x20x40
Son las medidas del block, el 15 te indica el espesor del block
El 20 te indica el alto del block
Y el 40 te indica el largo del block.
Por lo que si vas a construir con este block las medidas que vas a contemplar para saber cuantos blocks te vas a llevar son el largo y el alto, agregándole 1cm. De más por la junta que lleva en los costados y en la unión de las filas del block. Por lo que tenemos
A block = 0.41x0.21 =0.0861m2/pza.
Entonces divides el área total del muro entre el área del block y obtendrás el número de piezas que vas a necesitar.
Piezas= 10/0.0861 = 116.144 pzas.
Ahora lo que te falta contemplar es el porcentaje de desperdicio que se ocupa entre un 3 y un 5%.
Ahora ocupando un 5% de desperdicio tenemos:
116.144 x 1.05 = 121.95 pzas. Aproximando son 122 pzas.
Y listo tienes la cantidad de piezas a ocupar.
En este artículo vas a aprender como calcular la cantidad de block que te llevaras en la construcción de un muro.
Primero que nada debes tener o más bien saber cuantos metros cuadrados de muro vas a construir, esto es fácil es solo sacar el área del muro. Por ejemplo:
tenemos 2 muros de 2.5 mts. de largo con una altura de 2 mts. por lo tanto:
Metros de muro:
A1= 2.5 x 2= 5 m2 (m2=metros cuadrados)
A2= 2.5 x 2= 5 m2
Total =10 m2
Ya teniendo los metros cuadrados de muro entonces debemos conocer el área que abarca el block contemplando la junta de mortero.
Por ejemplo para un block de 15x20x40
Son las medidas del block, el 15 te indica el espesor del block
El 20 te indica el alto del block
Y el 40 te indica el largo del block.
Por lo que si vas a construir con este block las medidas que vas a contemplar para saber cuantos blocks te vas a llevar son el largo y el alto, agregándole 1cm. De más por la junta que lleva en los costados y en la unión de las filas del block. Por lo que tenemos
A block = 0.41x0.21 =0.0861m2/pza.
Entonces divides el área total del muro entre el área del block y obtendrás el número de piezas que vas a necesitar.
Piezas= 10/0.0861 = 116.144 pzas.
Ahora lo que te falta contemplar es el porcentaje de desperdicio que se ocupa entre un 3 y un 5%.
Ahora ocupando un 5% de desperdicio tenemos:
116.144 x 1.05 = 121.95 pzas. Aproximando son 122 pzas.
Y listo tienes la cantidad de piezas a ocupar.
jueves, 26 de junio de 2014
Prevent DoS/Brute-Force attacks with Apache’s mod_evasive
FUENTE: http://www.rosehosting.com/blog/prevent-dosbrute-force-attacks-by-installing-and-configuring-apaches-mod_evasive-in-gentoo-debian-centos-arch-linux-and-ubuntu/#ubuntu-debian
What is mod_evasive?
mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, etc. mod_evasive presently reports abuses via email and syslog facilities.
UBUNTU / DEBIAN
Next, install Apache’s module mod_evasive by executing:
Once the installation is finished, execute the following commands to configure Apache to use mod_evasive module:
What is mod_evasive?
mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, etc. mod_evasive presently reports abuses via email and syslog facilities.
UBUNTU / DEBIAN
=> Installation on Debian / Ubuntu
The installation of mod_evasive in a Debian / Ubuntu based VPS is identical. Before we go any steps further with the installation, make sure you have an up-to date system by issuing:# apt-get update && apt-get upgrade --show-upgraded |
# apt-get install libapache2-mod-evasive -y |
# cat >> /etc/httpd/conf.d/mod_evasive.conf <
DOSHashTableSize 3097 DOSPageCount 5 DOSSiteCount 50 DOSPageInterval 1 DOSSiteInterval 1 DOSBlockingPeriod 60 DOSEmailNotify your@email.com DOSLogDir /var/log/apache2/evasive < /IfModule > EOF |
# chown www-data: -R /var/log/apache2/ |
# /etc/init.d/apache2 restart
viernes, 23 de mayo de 2014
lunes, 12 de mayo de 2014
Mikrotik Wan FailOver
Texto extraido de: http://www.arg-wireless.com.ar/index.php?topic=1226.0
Failover (Conmutación por error) cuando un enlace deja de funcionar por cualquier motivo y automáticamente cambia al enlace de backup o redundancia para seguir funcionando.
En este caso tendríamos dos proveedores de servicio (Por ejemplo Arnet+Fibertel), y por un X motivo el primer servicio deja de funcionar, automáticamente se redireccionara todo al servicio secundario o backup.
Configuración Funcional a partir de Mikrotik RouterOS v3.30 (Versión Actual v5.24)
Paso a Paso:
Para iniciar con la configuración correspondiente vamos a primero crear reglas de salidas de Internet en IP ► Firewall ► NAT, configuraremos las interfaces correspondientes con las direcciones IP correspondientes.
Failover (Conmutación por error) cuando un enlace deja de funcionar por cualquier motivo y automáticamente cambia al enlace de backup o redundancia para seguir funcionando.
En este caso tendríamos dos proveedores de servicio (Por ejemplo Arnet+Fibertel), y por un X motivo el primer servicio deja de funcionar, automáticamente se redireccionara todo al servicio secundario o backup.
Configuración Funcional a partir de Mikrotik RouterOS v3.30 (Versión Actual v5.24)
Paso a Paso:
Para iniciar con la configuración correspondiente vamos a primero crear reglas de salidas de Internet en IP ► Firewall ► NAT, configuraremos las interfaces correspondientes con las direcciones IP correspondientes.
/ip firewall nat
add chain=srcnat out-interface="1-DIGICEL" action=masquerade comment="Internet - Proveedor Principal"
add chain=srcnat out-interface="2-CABLEONDA" action=masquerade comment="Internet - Proveedor Secundario (Backup)"
Luego podemos por ejemplo llevar un conteo de las caídas de conexión con
la opción de enviar un mail si se encuentra la misma (Mails de Alerta),
configuración para:
Hotmail:
/tool e-mail
set server=65.55.96.11 username="MAIL HOTMAIL" password="CONTRASEÑA" from=
Gmail:
/tool e-mail
set server=74.125.134.108 username="MAIL GMAIL" password="CONTRASEÑA" from=
Luego continuaremos creando una serie de script, vamos a ir a System ► Scripts ► "+"
Name= ISP1-UP
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=no
/ip firewall nat set [find comment="Internet - ISP2"] disabled yes
: log info "::::::::::::::: TRAFICO SALIENDO POR PROVEEDOR PRINCIPAL 1 :::::::::::::::"
Name= ISP2-UP
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=yes
/ip firewall nat set [find comment="Internet - ISP2"] disabled=no
: log info "::::::::::::::: TRAFICO SALIENDO POR PROVEEDOR SECUNDARIO :::::::::::::::"
Name= ISP1-DOWN
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=yes
/ip firewall nat set [find comment="Internet - ISP2"] disabled=no
: log info "::::::::::::::: TRAFICO SALIENDO POR PROVEEDOR SECUNDARIO, PROVEEDOR PRIMARIO FUERA DE SERVICIO :::::::::::::::"
/tool netwatch set [find comment="SALIDA ISP1"] disabled=yes
/tool netwatch set [find comment="SALIDA ISP2"] disabled=no
/tool e-mail send to="DIRECCION DE MAIL" subject="Proveedor 1 Fuera de Servicio" body="Proveedor principal dejo de funcionar"
:log info "::::::::::::::: ALERTA ENVIADA :::::::::::::::"
Name= ISP2-DOWN
Policy= read,write,policy,test
Source=
/ip firewall nat set [find comment="Internet - ISP1"] disabled=no
/ip firewall nat set [find comment="Internet - ISP2"] disabled=yes
: log info "::::::::::::::: TRAFICO SALIENDO POR PROVEEDOR PRINCIPAL, PROVEEDOR SECUNDARIO FUERA DE SERVICIO :::::::::::::::"
/tool netwatch set [find comment="SALIDA ISP2"] disabled=yes
/tool netwatch set [find comment="SALIDA ISP1"] disabled=no
/tool e-mail send to="DIRECCION DE MAIL" subject="Proveedor 2 Fuera de Servicio" body="Proveedor 2 Dejo de funcionar"
:log info "::::::::::::::: ALERTA ENVIADA :::::::::::::::"
Luego para terminar creamos las reglas de Netwatch:
/tool netwatch
add comment="SALIDA ISP1" host=74.125.47.104 down-script="ISP1-DOWN" up-script="ISP1-UP"
add comment="SALIDA ISP2" host=98.139.183.24 down-script="ISP2-DOWN" up-script="ISP2-UP"
viernes, 11 de abril de 2014
Mikrotik Dynamic DNS Update Script for No-IP DNS
1. Create a new script named no-ip_ddns_update
The following permissions are required for this script to run:
- write
- test
- read
2. Paste the source code that appears below. Edit the user, password, hostname and interface info to match your setup.
# No-IP automatic Dynamic DNS update #--------------- Change Values in this section to match your setup ------------------ # No-IP User account info :local noipuser "your_no-ip_user" :local noippass "your_no-ip_pass" # Set the hostname or label of network to be updated. # Hostnames with spaces are unsupported. Replace the value in the quotations below with your host names. # To specify multiple hosts, separate them with commas. :local noiphost "hostname.no-ip.net" # Change to the name of interface that gets the dynamic IP address :local inetinterface "your_external_interface" #------------------------------------------------------------------------------------ # No more changes need :global previousIP :if ([/interface get $inetinterface value-name=running]) do={ # Get the current IP on the interface :local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address] # Strip the net mask off the IP address :for i from=( [:len $currentIP] - 1) to=0 do={ :if ( [:pick $currentIP $i] = "/") do={ :set currentIP [:pick $currentIP 0 $i] } } :if ($currentIP != $previousIP) do={ :log info "No-IP: Current IP $currentIP is not equal to previous IP, update needed" :set previousIP $currentIP # The update URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands. :local url "http://dynupdate.no-ip.com/nic/update\3Fmyip=$currentIP" :local noiphostarray :set noiphostarray [:toarray $noiphost] :foreach host in=$noiphostarray do={ :log info "No-IP: Sending update for $host" /tool fetch url=($url . "&hostname=$host") user=$noipuser password=$noippass mode=http dst-path=("no-ip_ddns_update-" . $host . ".txt") :log info "No-IP: Host $host updated on No-IP with IP $currentIP" } } else={ :log info "No-IP: Previous IP $previousIP is equal to current IP, no update needed" } } else={ :log info "No-IP: $inetinterface is not currently running, so therefore will not update." }
3. Create a new scheduler entry to run this script every 5 mins.
/system scheduler add comment="Update No-IP DDNS" disabled=no interval=5m \ name=no-ip_ddns_update on-event=no-ip_ddns_update policy=read,write,test
martes, 18 de marzo de 2014
Comprobar Conecciones SIP
Para comprobar conecciones SIP con NMAP utilizamos el siguiente comando en Linux
$ sudo nmap -v -sU 192.168.5.9 -p 5060
Starting Nmap 6.40 ( http://nmap.org ) at 2014-03-18 15:22 EST
Initiating Ping Scan at 15:22
Scanning 192.168.5.9 [4 ports]
Completed Ping Scan at 15:22, 0.11s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 15:22
Completed Parallel DNS resolution of 1 host. at 15:22, 0.06s elapsed
Initiating UDP Scan at 15:22
Scanning 192.168.5.9 [1 port]
Completed UDP Scan at 15:22, 0.77s elapsed (1 total ports)
Nmap scan report for 192.168.5.9
Host is up (0.074s latency).
PORT STATE SERVICE
5060/udp open|filtered sip
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 1.01 seconds
Raw packets sent: 6 (208B) | Rcvd: 1 (28B)
$ sudo nmap -v -sU 192.168.5.9 -p 5060
Starting Nmap 6.40 ( http://nmap.org ) at 2014-03-18 15:22 EST
Initiating Ping Scan at 15:22
Scanning 192.168.5.9 [4 ports]
Completed Ping Scan at 15:22, 0.11s elapsed (1 total hosts)
Initiating Parallel DNS resolution of 1 host. at 15:22
Completed Parallel DNS resolution of 1 host. at 15:22, 0.06s elapsed
Initiating UDP Scan at 15:22
Scanning 192.168.5.9 [1 port]
Completed UDP Scan at 15:22, 0.77s elapsed (1 total ports)
Nmap scan report for 192.168.5.9
Host is up (0.074s latency).
PORT STATE SERVICE
5060/udp open|filtered sip
Read data files from: /usr/bin/../share/nmap
Nmap done: 1 IP address (1 host up) scanned in 1.01 seconds
Raw packets sent: 6 (208B) | Rcvd: 1 (28B)