VBA – MID – MID – Cannot find project or Library

Tentei rodar uma planilha Excel com um script VBA e apareceu o seguinte erro ao tentar usar a função MID(): “MID – Can’t find project or Library”.

Solução: No menu da tela do VBA scritp, selecione: Tools > References e desmarque a opção que contenha o prefixo ‘MISSING’.

Ref: http://support.microsoft.com/kb/283806

Como merolhar a aparência do site do Estadão

A página original (www.estadao.com.br) usa a fonte Arial na cor cinza, que, na minha opinião, dificulta a leitura.

Este script modifica a fonte para Georgia na cor preta, que é a mesma fonte usada nos sites do NY Times, El Pais e tantos outros por aí.

O script só funciona no Firefox e é necessário instalar o ‘addon’ Greasemonkey: https://addons.mozilla.org/pt-BR/firefox/addon/748

Após instalar o Greasemonkey e reiniciar o browser, basta instalar o meu script e voltar ao site do Estadão para ver o resultado: http://userscripts.org/scripts/show/36597

Abaixo, um exemplo de como fica o site com o uso deste script:

exemplo

Boa leitura.

Cisco – RED and WRED

Congestion Avoidance
Introducing RED and WRED

http://www.cisco.com/comm/applications/ecomm/qlm/ccvp/qos/congestion-avoidance-introducing-red-and-wred/player.html

Curso rápido da Cisco sobre RED e WRED, muito bom.

Cálculo com endereço IP no Excel – parte 3

Para separar a rede 10.11.12.34/17 (por ex.) em rede e mascara (ou wildcard), use as seguintes fórmulas:

Considerando a informação da rede/máscara na célula A1, segue a fórmula para a conversão da máscara:

=HEX2DEC(MID(DEC2HEX(2^32-(2^(32-A1));8);1;2)) &"."&
HEX2DEC(MID(DEC2HEX(2^32-(2^(32-A1));8);3;2)) &"."&
HEX2DEC(MID(DEC2HEX(2^32-(2^(32-A1));8);5;2)) &"."&
HEX2DEC(MID(DEC2HEX(2^32-(2^(32-A1));8);7;2))

Resultando em 255.255.128.0. Para converter em wildcard:

=HEX2DEC(RIGHT(DEC2HEX(-HEX2DEC(MID(DEC2HEX(2^32-(2^(32-Masks));8);1;2))-1);2)) &"."&
HEX2DEC(RIGHT(DEC2HEX(-HEX2DEC(MID(DEC2HEX(2^32-(2^(32-Masks));8);3;2))-1);2)) &"."&
HEX2DEC(RIGHT(DEC2HEX(-HEX2DEC(MID(DEC2HEX(2^32-(2^(32-Masks));8);5;2))-1);2)) &"."&
HEX2DEC(RIGHT(DEC2HEX(-HEX2DEC(MID(DEC2HEX(2^32-(2^(32-Masks));8);7;2))-1);2))

Resultado: 0.0.127.255

Cisco – Filtro de community (BGP)

Para filtrar uma community no BGP:

ip community-list 1 permit 65000:1234
!
route-map filter_community deny 10
 match community 1
!
route-map filter_community permit 20
!
router bgp 65000
 neighbor 10.10.10.2 route-map filter_community in
!

Cisco: domain-lookup

Para disabilitar o domain-lookup apenas para a sessão atual, use

terminal no domain-lookup

Cisco: Guia de Comandos

Um guia para cada modo de configuração: basta usar o comando show parser dump. Digite show parser dump <mode>, usando um dos modos de configuração (ex., interface, router…):

RouterA#sh parser dump router
 Mode Name :router
0 no protocol shutdown
0 no mpls ldp sync
0 no mpls ldp autoconfig area <address>
0 no mpls ldp autoconfig area <0-4294967295>
0 no mpls ldp autoconfig
0 no mpls traffic-eng router-id
0 no mpls traffic-eng multicast-intact
0 no mpls traffic-eng area <0-4294967295>
0 no mpls traffic-eng scanner interval
0 no mpls traffic-eng scanner max-flash
0 no mpls traffic-eng scanner
0 no mpls traffic-eng level-1
0 no mpls traffic-eng level-2
0 no mpls traffic-eng
0 no max-area-addresses
0 no net <address>
0 no is-type
...

Para um maior detalhe, use o parametro extend.

fonte: http://www.ciscoblog.com/archives/2008/06/cisco_command_r.html

Cisco: show ip bgp com expressões regulares (regexp)

Para exibir rotas BGP com filtro, basta utilizar o comando show ip bgp regexp [regexp].

Exemplo (exibindo apenas as rotas originadas no AS local):

RouterA#sh ip bgp regexp ^$
BGP table version is 33242, local router ID is 10.1.0.134
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
              r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
* i10.50.16.0/24    10.5.0.98                0    100      0 i
*>                  0.0.0.0                  0         32768 i
*> 10.1.0.134/32    0.0.0.0                  0         32768 i
*>i10.1.0.135/32    10.5.0.98                0    100      0 i

Mais exemplos aqui.

Cálculo com endereço IP no Excel – parte 2

Para conversão da notação em barra (/23) para máscara (255.255.254.0), copie e cole o bloco abaixo no Excel na célula A1:

192.168.32.160/23
Mask Calculation
=RIGHT(A1;LEN(A1)-FIND("/";A1))
=2^32-(2^(32-A3))
=DEC2HEX(A4;8 )
=MID($A$5;1;2)
=MID($A$5;3;2)
=MID($A$5;5;2)
=MID($A$5;7;2)
=HEX2DEC(A6)&"."&HEX2DEC(A7)&"."&HEX2DEC(A8)&"."&HEX2DEC(A9)
=-HEX2DEC(A6)-1
=-HEX2DEC(A7)-1
=-HEX2DEC(A8)-1
=-HEX2DEC(A9)-1
=RIGHT(DEC2HEX(A11);2)
=RIGHT(DEC2HEX(A12);2)
=RIGHT(DEC2HEX(A13);2)
=RIGHT(DEC2HEX(A14);2)
=HEX2DEC(A15)&"."&HEX2DEC(A16)&"."&HEX2DEC(A17)&"."&HEX2DEC(A18 )

A célula A10 mostrará a máscara correspondente e a célula 19, o wildcard.

Cisco: Key Sequences for Command Edit and Recall

Keyboard Command What You Get
Up arrow or Ctrl-p This displays the most recently used command. If it is pressed again, the next most recent command appears until the history buffer is exhausted. (The p stands for previous.)
Down arrow or Ctrl-n If you have gone too far back into the history buffer, these keys will go forward to the more recently typed commands. (The n is for next.) Left arrow or Ctrl-b This moves the cursor backward in the currently displayed command without deleting characters. (The b stands for back.)
Right arrow or Ctrl-f This moves the cursor forward in the currently displayed command without deleting characters. (The f stands for forward.)
Backspace This moves the cursor backward in the currently displayed command, deleting characters.
Ctrl-a This moves the cursor directly to the first character of the currently displayed command.
Ctrl-e This moves the cursor directly to the end of the currently displayed command.
Esc-b This moves the cursor back one word in the currently displayed command.
Esc-f This moves the cursor forward one word in the currently displayed command.
Ctrl-r This creates a new command prompt, followed by all the characters typed since the last command prompt was written. This is particularly useful if system messages confuse the screen and it is unclear what you have typed so far.

Próxima Página »