Showing posts with label How TO. Show all posts
Showing posts with label How TO. Show all posts

3/27/2019

How to execute commands inside of docker


First, need list all active containers


docker ps

Get the container ID

1ab2c3d4.....


docker exec -it /bin/bash



11/04/2015

Wsus 3.0 como ter acesso ao banco SQL

"How to connect to WSUS SQL SERVER"

Como acessar o banco de dados do Windows Internal Database com o Management Tools

11/01/2015

Como limpar a partição de boot ubuntu



Quando você tentar fazer a instalação de algum programa no ubuntu e ele diz que não é possível execute apt-get -f install para forçar ou continuar a instalar os pacotes etc, e fica em um loop eterno, o servidor deve estar com a partição de boot cheia, verifique o volume dando o comando df -h caso esteja em 100% execute o comando abaixo para limpar.








uname -r


verifique o KERNEL que o servidor tem instalado







sudo dpkg --list 'linux-image*'




removendo as versões não desejáveis.







sudo dpkg -r linux-image-3.2.0-23-generic

or

sudo dpkg --force-depends --purge linux-image-3.2.0-23-generic




10/27/2015

Otimizando banco de dados do WSUS ou Otimizando o WSUS

Como otimizar e limpar o banco de dados. ( se for servidor de produção lembre de fazer backup do banco ( HOW TO BACKUP MS SQL SERVER )

Acesse o banco de dados (HOW TO ) abra uma query.

Gerar um report de TOP Tables,



Escolha as que tenham mais # Records, abra a tabela, com mais records, clique com o direito e clique rebuild ALL ou reorganize ALL se for a segunda vez que estiver executando este procedimento.



Feito pode acompanha o processo que pode demorar muito (depende do servidor) mas o banco SQL 2005 é lento mesmo.

Escolha indexes que vai iniciar o rebuild e de OK, execute este procedimento em todas as tabelas, limpe as logs do banco para finalizar.



Ou outra opção para executar um re index global , por Query copie e execute.







DECLARE @TableName VARCHAR(255)
DECLARE @sql NVARCHAR(500)
DECLARE @fillfactor INT
SET @fillfactor 80
DECLARE TableCursor CURSOR FOR
SELECT OBJECT_SCHEMA_NAME([object_id])+'.'+name AS TableName
FROM sys.tables
OPEN TableCursor
FETCH NEXT FROM TableCursor INTO @TableName
WHILE @@FETCH_STATUS 0
BEGIN
SET @sql 'ALTER INDEX ALL ON ' @TableName +' REBUILD WITH (FILLFACTOR = ' CONVERT(VARCHAR(3),@fillfactor) + ')'
EXEC (@sql)
FETCH NEXT FROM TableCursor INTO @TableName
END
CLOSE TableCursor
DEALLOCATE TableCursor
GO


Enquanto executa o servidor pode travar ou não responder, aguarde observando o gerenciador de tarefas, ou abaixo da Query, vide figura abaixo.


10/25/2015

Munin Ubuntu 12.04

Munin



Para instalar







sudo apt-get install munin


Configurar







sudo vim /etc/munin/munin.conf


Arquivo do munin.conf







# Example configuration file for Munin, generated by 'make build'

# The next three variables specifies where the location of the RRD

# databases, the HTML output, logs and the lock/pid files. They all

# must be writable by the user running munin-cron. They are all

# defaulted to the values you see here.

#

dbdir /var/lib/munin

htmldir /var/www/munin

logdir /var/log/munin

rundir /var/run/munin

#

# Where to look for the HTML templates

# tmpldir /etc/munin/templates

# (Exactly one) directory to include all files from.

#

includedir /etc/munin/munin-conf.d

# Make graphs show values per minute instead of per second

#graph_period minute

# Graphics files are normaly generated by munin-graph, no matter if

# the graphs are used or not. You can change this to

# on-demand-graphing by following the instructions in

# http://munin.projects.linpro.no/wiki/CgiHowto

#

#graph_strategy cgi

# munin-cgi-graph is invoked by the web server up to very many times at the

# same time. This is not optimal since it results in high CPU and memory

# consumption to the degree that the system can thrash. Again the default is

# 6. Most likely the optimal number for max_cgi_graph_jobs is the same as

# max_graph_jobs.

#

#munin_cgi_graph_jobs 6

# If the automatic CGI url is wrong for your system override it here:

#

#cgiurl_graph /cgi-bin/munin-cgi-graph

# munin-graph runs in parallel, the number of concurrent processes is

# 6. If you want munin-graph to not be parallel set to 0. If set too

# high it will slow down munin-graph. Some experiments are needed to

# determine how many are optimal on your system. On a multi-core

# system with good SCSI disks the number can probably be quite high.

#

#max_graph_jobs 6

# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime

# something changes (OK -> WARNING, CRITICAL -> OK, etc)

#contact.someuser.command mail -s "Munin notification" somejuser@fnord.comm

#contact.anotheruser.command mail -s "Munin notification" anotheruser@blibb.comm

#

# For those with Nagios, the following might come in handy. In addition,

# the services must be defined in the Nagios server as well.

#contact.nagios.command /usr/bin/send_nsca nagios.host.comm -c /etc/nsca.conf

# a simple host tree

[localhost.localdomain]

address 127.0.0.1

use_node_name yes

#

# A more complex example of a host tree

#

## First our "normal" host.

# [fii.foo.com]

# address foo

#

## Then our other host...

# [fay.foo.com]

# address fay

#

## Then we want totals...

# [foo.com;Totals] #Force it into the "foo.com"-domain...

# update no # Turn off data-fetching for this "host".

#

# # The graph "load1". We want to see the loads of both machines...

# # "fii=fii.foo.com:load.load" means "label=machine:graph.field"

# load1.graph_title Loads side by side

# load1.graph_order fii=fii.foo.com:load.load fay=fay.foo.com:load.load

#

# # The graph "load2". Now we want them stacked on top of each other.

# load2.graph_title Loads on top of each other

# load2.dummy_field.stack fii=fii.foo.com:load.load fay=fay.foo.com:load.load

# load2.dummy_field.draw AREA # We want area instead the default LINE2.

# load2.dummy_field.label dummy # This is needed. Silly, really.

#

# # The graph "load3". Now we want them summarised into one field

# load3.graph_title Loads summarised

# load3.combined_loads.sum fii.foo.com:load.load fay.foo.com:load.load

# load3.combined_loads.label Combined loads # Must be set, as this is

# # not a dummy field!

#

## ...and on a side note, I want them listen in another order (default is

## alphabetically)

#

# # Since [foo.com] would be interpreted as a host in the domain "com", we

# # specify that this is a domain by adding a semicolon.

# [foo.com;]

# node_order Totals fii.foo.com fay.foo.com

#


Arquivo apache.conf







sudo vim /etc/munin/apache.conf


Configurações do arquivo.







Alias /munin /var/www/munin

<Directory /var/www/munin>

Order allow,deny

# Allow from localhost 127.0.0.0/8 ::1

Allow from all

Options None

# This file can be used as a .htaccess file, or a part of your apache

# config file.

#

# For the .htaccess file option to work the munin www directory

# (/var/cache/munin/www) must have "AllowOverride all" or something

# close to that set.

#

# AuthUserFile /etc/munin/munin-htpasswd

# AuthName "Munin"

# AuthType Basic

# require valid-user

# This next part requires mod_expires to be enabled.

#

# Set the default expiration time for files to 5 minutes 10 seconds from

# their creation (modification) time. There are probably new files by

# that time.

#

<IfModule mod_expires.c>

ExpiresActive On

ExpiresDefault M310

</IfModule>

</Directory>


Criar a pasta e dar a permissão correta a pasta








sudo mkdir /var/www/munin

sudo chown munin:munin /var/www/munin



Reiniciar os serviços








sudo service munin-node restart

sudo service apache2 restart



Instalação Plugins

Check os plugins quem servidor tem ativo







ls /etc/munin/plugins


Confira os plugins que o servidor tem disponível







ls /usr/share/munin/plugins/









Plugin | Used | Suggestions

------ | ---- | -----------

acpi | no | no [cannot read /proc/acpi/thermal_zone/*/temperature]

amavis | no | no

apache_accesses | yes | yes

apache_processes | no | no

apache_volume | yes | yes

apc_envunit_ | no | no [no units to monitor]

bonding_err_ | no | no [No /proc/net/bonding]

courier_mta_mailqueue | no | no [spooldir not found]

courier_mta_mailstats | no | no [could not find executable]

courier_mta_mailvolume | no | no [could not find executable]

cps_ | no | no

cpu | yes | yes

cpuspeed | no | no [missing /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state]

cupsys_pages | no | no [could not find logdir]

df | yes | yes

df_inode | yes | yes

diskstats | yes | yes

entropy | yes | yes

exim_mailqueue | no | no [no exiqgrep]

exim_mailstats | no | no [logdir does not exist]

fail2ban | no | no [/usr/bin/fail2ban-client not found]

forks | yes | yes

fw_conntrack | no | yes

fw_forwarded_local | no | yes

fw_packets | yes | yes

hddtemp_smartctl | no | no [smartctl not found]

http_loadtime | yes | yes

if_ | yes | yes (eth0 eth1)

if_err_ | yes | yes (eth0 eth1)

interrupts | yes | yes

iostat | yes | yes

iostat_ios | yes | yes

ip_ | no | yes

ipmi_ | no | no [no /usr/bin/ipmitool]

irqstats | yes | yes

jmx_ | no | no [java runtime not found at /usr/bin/java]

load | yes | yes

lpstat | no | no [lpstat not found]

memory | yes | yes

munin_stats | yes | yes

mysql_ | no | no

netstat | no | no

nfs4_client | no | no [no /proc/net/rpc/nfs]

nfs_client | no | no

nfsd | no | no [no /proc/net/rpc/nfsd]

nfsd4 | no | no [no /proc/net/rpc/nfsd]

nginx_request | no | no [no nginx status on http://srv205/nginx_status]

nginx_status | no | no [no nginx status on http://localhost/nginx_status]

ntp_kernel_err | no | no

ntp_kernel_pll_freq | no | no

ntp_kernel_pll_off | no | no

ntp_offset | no | no [no ntpq program]

nvidia_ | no | no [no nvclock executable at /usr/bin/nvclock, please configure]

open_files | yes | yes

open_inodes | yes | yes

postfix_mailqueue | no | no

postfix_mailvolume | no | no [postfix not found]

postgres_bgwriter | no | no

postgres_cache_ | no | no

postgres_checkpoints | no | no

postgres_connections_ | no | no

postgres_connections_db | no | no

postgres_locks_ | no | no

postgres_querylength_ | no | no

postgres_scans_ | no | no

postgres_size_ | no | no

postgres_transactions_ | no | no

postgres_tuples_ | no | no

postgres_users | no | no

postgres_xlog | no | no

proc_pri | yes | yes

processes | yes | yes

ps_ | no | no

qmailqstat | no | no

selinux_avcstat | no | no [missing /selinux/avc/cache_stats file]

sendmail_mailqueue | no | no

sendmail_mailstats | no | no [no mailstats command]

sendmail_mailtraffic | no | no [no mailstats command]

slapd_ | no | no [Net::LDAP not found]

slapd_bdb_cache_ | no | no [Can't execute db_stat file '/usr/bin/db4.6_stat']

slony_lag_ | no | no [DBD::Pg not found, and cannot do psql yet]

smart_ | no | no [smartmontools not found]

snort_alerts | no | no [/var/snort/snort.stats not readable]

snort_bytes_pkt | no | no [/var/snort/snort.stats not readable]

snort_drop_rate | no | no [/var/snort/snort.stats not readable]

snort_pattern_match | no | no [/var/snort/snort.stats not readable]

snort_pkts | no | no [/var/snort/snort.stats not readable]

snort_traffic | no | no [/var/snort/snort.stats not readable]

squeezebox_ | no | no [no connection on localhost port 9090]

squid_cache | yes | no [could not connect: Connection refused]

squid_objectsize | yes | no [could not connect: Connection refused]

squid_requests | yes | no [could not connect: Connection refused]

squid_traffic | yes | no [could not connect: Connection refused]

swap | yes | yes

threads | yes | yes

tomcat_ | no | no

uptime | yes | yes

users | no | no

varnish_ | no | no [which varnishstat returns blank]

vmstat | yes | yes

vserver_cpu_ | no | no [/proc/virtual/info not found]

vserver_loadavg | no | no [/proc/virtual/info not found]

vserver_resources | no | no [/proc/virtual/info not found]

yum | no | no

zimbra_ | no | no [No Text::CSV_XS]


Para instalar os plugins basta fazer um atalho a pasta de plugin







sudo ln -s /usr/share/munin/plugins/nome de plugin /etc/munin/plugins/ nome de plugin


Instalando os plugins







sudo ln -s /usr/share/munin/plugins/mysql_ /etc/munin/plugins/mysql_

sudo ln -s /usr/share/munin/plugins/squid_cache /etc/munin/plugins/squid_cache

sudo ln -s /usr/share/munin/plugins/squid_icp /etc/munin/plugins/squid_icp

sudo ln -s /usr/share/munin/plugins/traffic /etc/munin/plugins/traffic

sudo ln -s /usr/share/munin/plugins/openvpn /etc/munin/plugins/openvpn

sudo ln -s /usr/share/munin/plugins/squid_objectsize /etc/munin/plugins/squid_objectsize


Após a instalação execute o restart.







sudo /etc/init.d/munin-node restart

sudo /etc/init.d/apache2 restart



5/18/2015

VPN Cisco / Kaspersky problens

Most common after install kaspersky antivirus, cisco vpn doens't works.

Depois de instalar o Kaspersky antivirus a vpn da cisco não funciona corretamente.

1. In Kaspersky, you must first disable Self-Defense

pic1
2. Go to your registry by typing regedit in the run menu
3. Navigate to \HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\klwfp (note: for older Kaspersky versions it might be kltdi instead of klwfp)
4. There will be a key called "Start" and should have a default of "1". Change that to "4"

pic2
5. Enable Self-Defense again and restart
6. Once restarted when you connect via the VPN, you should be working again.

4/02/2015

Manual LG Nortel LNGS8MP

Manual Switch LNGS8MP  LG-Nortel

LNGS8MP






Hardware Reset links the simple cable port 1 and 2, connect the power wait for the switch to start when the LEDs blinks, and turn off the power.



To have access to the manual please contact me.

Manual Switch LG-Nortel GS24M

Manual do Switch LG-Nortel model GS24M

Hardware Reset link the simple cable port 1 and 2, conect the power wait the switch start when the leds blinks turn off the power.





LG-Nortel GS24M User Guide
Buy Now


12/30/2014

Switch Nortel Device Manager

Caso você se depare com um velho Nortel e deseja reconfigurar ele, segue o gerenciador,

Java Device Manager v6.2.1.5


Link do atual do "Fabricante"   do equipamento https://support.avaya.com/downloads/download-details.action?contentId=C2011610151483870_4&productId=P0910

Para Windows o programa tem 197MB

 ISO do CD 
Buy Now
Windows 7

feita a instalação o diretório que ele vai salvar os arquivos é em C:\Program Files (x86)\Avaya\JDM

Execute o APLICATIVO JAVA .

Lembre de adicionar no painel de controle / java / segurança o IP do switch que deseja acessar.



Como resetar (deixar no modo original o Switche Nortel)

  1. Conectar na porta serial "console" do  switch  configurações 9600 -  8 - N - 1

  2.  Reinicie o SW

  3.  Na primeira linha de diagnostico execute um CTRL-C acesse o MENU.

  4. Escolha a opção  “i”  para voltar ao padrão de fabrica.

  5. Confirme “a” para executar o comando.

No próximo boot ele vai estar como original.

12/23/2014

Como aumentar o tamanho do upload no phpmyadmin

"How to" aumentando o tamanho máximo de upload para base SQL no phpmyadmin.

Ambiente Ubuntu Server 14.04 php5 apache2 e Mysql5.6.

Como o phpmyadmin está ligado as configurações web do PHP, o aumento do tamanho máximo de upload é geral para todos os itens que trabalha junto com o PHP5.



Abra o arquivo php.ini

sudo vim /etc/php5/apache2/php.ini



Procure a linha max file

*(para procurar dentro do arquivo de configuração utilize a /"oque procura" e enter)

; Maximum allowed size for uploaded files.

; http://php.net/upload-max-filesize

upload_max_filesize = 2M



No nosso exemplo aumentamos de 2MB para 50MB (sim tem clientes com base maiores que 2MB)

Procure a linha post e edite!

post_max_size = 8M










Salve a configuração saia do arquivo, execute o restart do apache

sudo service apache2 restart



Verifique dentro do phpmyadmin









8/21/2014

Como instalar e configurar o Mailenable



Ambiente

1 Servidor Windows 2008 r2

1 MailEnable Premiun



Antes de iniciar a instalação configure o IIS com os serviços básicos, e não tenha nenhum site configurado preferencialmente, O serviço de DNS deve estar corretamente configurado.





Next

Neste primeiro laboratório vamos instalar todos os recursos em apenas em um servidor.





Escolha o diretório de instalação, para grandes instalações recomenda diretórios diferentes e servidores diferentes para cada função.







Diretorio das contas de e-mail, é importante que seja um disco separado e performático, caso seja um servidor real recomendo RAID 5 ou RAID 10, e caso tenha condições financeiras experimente utilizar storage com disco solido SSD



Coloque o domínio padrão primário, caso seja multi domínio use aquele que você usa como padrão para serviços internos e não queira expor.



Na instalação da parte WEB preste atenção em qual diretório do IIS você vai instalar recomendo o padrão, já que o servidor é dedicado.





No ambiente de teste vamos utilizar a versão de teste





Instalação completa