Posts Tagged ‘howto’

Failed to set sender: EMAIL@DOMÍNIO.COM [SMTP: Failed to write to socket: not connected (code: -1, response: )]“

Thursday, October 6th, 2011

Failed to set sender: EMAIL@DOMÍNIO.COM [SMTP: Failed to write to socket: not connected (code: -1, response: )]”

Se você está recebendo este erro basta acessar seu WHM -> ir nos plugins -> CSF e  nas configurações do CSF procurar por SMTP_ALLOWLOCAL, normalmente isso está setado como 0 (zer0 = DESATIVADO), digite 1 para ativar e boa!
Abraços galera.

Como fazer tunning do Terminal Server na windows server 2003

Tuesday, July 26th, 2011


Eliminate IE Flickering: Configure this setting to force off-screen composition of Internet Explorer, which eliminates the flickering effect. In HKEY_ CURRENT_USER\Software\Microsoft\Internet Explorer\Main, set the DWORD value for Force Offscreen Composition to 1.

Disable Office 2003 Customer Experience Improvement Program: Configure this setting to prevent Office from prompting the user to participate in this program. To enable, in HKEY_ CURRENT_USER\Software\Microsoft\Office\Common, set the DWORD value for QMEnable to 1.
Disable File Locking: Configure this setting to modify the file locking behavior on the server. This will enhance performance, but it's known to have issues with some database applications. To enable, in HKEY_LOCAL_ MACHINE\System\CurrentControlSet\Services\LanmanWorkstation\Parameters, set the DWORD value for UseLockReadUnlock to 1.

Disable NTFS Last-Accessed Time Stamping: Configure this setting to prevent the system from updating the last accessed time stamp on files, which can enhance performance. Some applications require this to be accurate, so test prior to implementing. To enable, in HKEY_LOCAL_ MACHINE\System\CurrentCon trolSet\Control\FileSystem, set the DWORD value for NtfsDisable LastAccessUpdate to 1.
Turn off Lazy Writes: This setting prevents the system from caching write operations before writing them to disk. This can speed operation over the network. Configure the following two keys: In HKEY_LOCAL_MACHINE\ System\CurrentControlSet\Services\ LanmanServer\Parameters, set the DWORD value for IRPStackSize to 15. Also, in HKEY_LOCAL_MACHINE\ System\CurrentControlSet\Services\ LanmanWorkstation\Parameters, set the DWORD value for UtilizeNT Caching to 0.

Improve Windows Kernel Performance: Prevents the system from paging kernel mode drivers and system code to disk, which can decrease performance. To configure: In HKEY_LOCAL_ MACHINE\System\CurrentCon trolSet\Control\Session Manager\ Memory Management, set the DWORD value for DisablePagingExecutive to 1.

Increase the Network Request Buffer: This setting boosts performance by increasing the size of the network request buffer, which determines how much data is stored before it is sent to the client. This setting can also improve LAN Manager file writing performance. Increasing the size of this buffer will consume RAM, so adjust and monitor carefully. To enable, in HKEY_ LOCAL_MACHINE\System\Current ControlSet\Services\LanmanServer\Parameters, increase the DWORD value for SizReqBuf to a value between 1024 and 65535.

Eliminate Session Hangs During Logoff: Terminal Server sessions can sometimes hang when the user attempts to log off. One solution: Modify available network buffers and open connections. Configure the following keys: In HKEY_LOCAL_MACHINE\ System\CurrentControlSet\Services\ LanmanServer\Parameters, set the DWORD value for MaxWorkItems to 8196, MaxMpxCt to 2048, MaxRaw WorkItems to 512, MaxFreeConnections to 100, and MinFreeConnections to 32. In KEY_LOCAL_MACHINE\ System\CurrentControlSet\ Services\LanmanServer\Parameters, set the DWORD value for MaxCmds to 2048. Also, in HKEY_LOCAL_ MACHINE\System\Current ControlSet\Control\SessionManager\ ConfigurationManager, set the value for RegistryLazyFlushInterval to 60. Lastly, ensure that the Enable Advanced Performance feature is enabled when viewing device properties of all disk drives on the system.

Speed up Application Load Times: Increase the perceived performance of your Terminal Server by pre-loading commonly used files into memory. This works well on systems with plenty of available RAM. To enable, in HKEY_ LOCAL_MACHINE\System\ CurrentControlSet\Control\Session Manager\Memory Management\ PrefetchParameters, set the DWORD value for EnablePrefetcher to 3.

Disable Caching of Roaming Profiles: Excess roaming profiles on a Terminal Server can consume disk and Registry quota space. Configuring this setting can eliminate waste but increase user's login time. To enable, in HKEY_ LOCAL_MACHINE\Software\ Microsoft\Windows NT\Current Version\Winlogon, set the DWORD value for DeleteRoamingCache to 1.

Disable Unused Subsystems: Not using the POSIX subsystem on your Terminal Server? Disable it and navigate to the registry location HKEY_LOCAL_ MACHINE\System\CurrentCon trolSet\Control\Session Manager\ Subsystems and delete the Posix key. Disable the File Indexing Service: File Indexing Service is great for quickly searching for files, but your Terminal Server arguably shouldn't have that many user files on it and the indexing process can consume huge system resources. To disable it, navigate to the properties menu of each drive on your system and deselect the box for Allow Indexing Service to index this disk for fast file searching.

O registro do windows deve assemelhar-se com:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\
Main]
"Force Offscreen Composition"=dword:00000001

[HKEY_CURRENT_USER\Software\Microsoft\Office\Common]
"QMEnable"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
LanmanWorkstation\Parameters]
"UseLockReadUnlock"=dword:00000001

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\
FileSystem]
"NtfsDisableLastAccessUpdate"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Lanman Server\Parameters]
"IRPStackSize"=dword:0000000f
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Service\
Lanman WorkStation\Parameters]
"UtilizeNTCaching"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\
Session Manager\Memory Management]
"DisablePagingExecutive"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
LanmanServer\Parameters]
"SizReqBuf"=dword:0000ffff

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Lanmanserver\Parameters]
"MaxWorkItems"=dword:00002004
"MaxMpxCt"=dword:00000800
"MaxRawWorkItems"=dword:00000200
"MaxFreeConnections"=dword:00000064
"MinFreeConnections"=dword:00000020
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Lanmanworkstation\Parameters]
"MaxCmds"=dword:00000800
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\
Session Manager\Configuration Manager]
"RegistryLazyFlushInterval"=dword:0000003c

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\
SessionManager\Memory Management\PrefetchParameters]
"EnablePrefetcher"="3"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\
CurrentVersion\Winlogon]
"DeleteRoamingCache"=dword:00000001

http://redmondmag.com/articles/2006/06/01/speed-up-terminal-server.aspx

How to install yum on red hat 4 or Centos 4 – Como instalar yum no Redhat 4 ou Centos 4

Friday, April 17th, 2009

Essa é uma questão muito comum entre os sysadmins que tentam instalar o yum no red hat 4 ou centos 4 e não têm tido sucesso.

Abaixo preparei um how to com um link próprio dos arquivos para que você não tente encontrar o pacote na web e acabe se decepcionando ao ver navios.

Para instalar o yum no centos ou redhat siga exatamente o que será descrito.

Esse how to mostra como instalar o yum no RedHat 4.x (centos 4.x) de maneira simples e amigável.

O que será preciso?

1 – Estar logado como root no terminal,
2 – Criar um diretório aonde as coisas estarão armazenadas,
3 – Ter uma internet acessível para poder baixar (claro!).

Logue-se como root, em seguida, na pasta root crie algo como:

mkdir tmp
cd tmp

Agora que estamos dentro de /root/tmp nós iremos baixar todos os arquivos necessários e iremos deixar que o próprio yum dê conta do recado. Use exatamente os comandos abaixo para pegar os arquivos:

wget http://www.libphp.net/repositorio/yum-2.4.2-0.4.el4.rf.noarch.rpm
wget http://www.libphp.net/repositorio/libsqlite-2.8.15-1.i386.rpm
wget http://www.libphp.net/repositorio/python-elementtree-1.2.6-7.el4.rf.i386.rpm
wget http://www.libphp.net/repositorio/python-sqlite-0.5.0-1.2.el4.rf.i386.rpm
wget http://www.libphp.net/repositorio/python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm

Agora que já temos os arquivos (pacotes) vamos instalar os mesmos:

rpm -ivh libsqlite-2.8.15-1.i386.rpm
rpm -ivh python-elementtree-1.2.6-7.el4.rf.i386.rpm
rpm -ivh python-sqlite-0.5.0-1.2.el4.rf.i386.rpm
rpm -ivh python-urlgrabber-2.9.7-1.2.el4.rf.noarch.rpm
rpm -ivh yum-2.4.2-0.4.el4.rf.noarch.rpm

Vamos ajustar o repositório:

wget http://www.libphp.net/repositorio/rpmforge-release-0.3.6-1.el4.rf.i386.rpm

Após

rpm -ivh rpmforge-release-0.3.6-1.el4.rf.i386.rpm

Depois disto somente faça:

yum update

Pronto!

Abração a todos e bom trabalho.

Zoneminder no Ubuntu ou Debian – Serviço de Câmeras Web (cftv)

Wednesday, February 4th, 2009

Bom, vamos falar sobre a instalação do Zoneminder e algumas dicas e truques para o mesmo funcionar adequadamente.

Como tudo começou:

Meu chefe me passou a url do programa dizendo que seria uma boa solução para o controle das imagens geradas pelas câmeras internas. Pediu pra eu testar.

Equipamentos:

Placa de Captura com chipset bttv. Como já havia visto uma funcionando, indiquei a Pico2000. Que pode ser encontrada em média de 50 reais no mercado livre (http://www.mercadolivre.com.br).

Computador com slot pci, e os cabos para ligar as câmeras a placa.

E o sistema operacional usado será o Linux, distribuição Ubuntu.

A escolha da distribuição pesou devido ao fato de que todos os desktops da empresa rodarem Ubuntu, então pra não ficar inventando moda resolvi usar a mesma coisa para padronizar. E provavelmente o servidor que vamos colocar em produção vai ser Debian, não vai haver grandes mudanças na hora da instalação para produção.

Vamos ao que interessa.

ara fazer a verificação se o sistema detectou a placa, faça o seguinte procedimento:

# dmesg | grep bttv

Deve aparecer a seguinte saída:

Com isso já guarde as seguintes informações:

[ 82.180611] bttv0: registered device video0
[ 82.180792] bttv0: registered device vbi0

Instalações

Agora vamos a parte boa, instalar o que é necessário.

Vamos fazer a instalação por partes:

1. Apache, MySQL e PHP:

# apt-get update
# apt-get install apache2 mysql-server mysql-client php5-mysql php5-gd php5-cgi php-pear libgd-tools php5-dev libmysql++-dev libmysqlclient15-dev

Depois dessa instalação, já vai estar com seu servidor web pronto para o serviço.

2. Codecs de vídeo:

# apt-get update
# apt-get install libavcodec-dev libavcodec1d libavformat-dev libavformat1d libavutil-dev libavutil1d ffmpeg libavifile-0.7c2

3. As demais dependências:

# apt-get update
# apt-get install g++ make netpbm libssl-dev libjpeg62-dev libmime-perl libwww-perl libarchive-tar-perl libdate-manip-perl libarchive-zip-perl libmime-lite-perl libdbi-perl libdbd-mysql-perl libpcre3-dev libgnutls-dev

Feito isso seu sistema já vai estar pronto para receber o Zoneminder, após claro a pequena compilação dele.

Instalação do Zoneminder

Tendo instalado todos os programas anteriores, essa parte é mais simples pois provavelmente não vai dar erro agora.

Baixe o source pelo site:

# wget -c http://www2.zoneminder.com/downloads/ZoneMinder-1.23.2.tar.gz
# tar czf ZoneMinder-1.23.2.tar.gz
# cd ZoneMinder-1.23.2

Agora vem o pulo do gato, se você fizer sem alterar nada vai dar erro no make, se quiser testar, fique a vontade, se quiser fazer o trem funcionar de primeira edite o arquivo src/zm_mpeg.cpp e na linha 280 altere de:

#if ZM_FFMPEG_SVN

Para:

#if !ZM_FFMPEG_SVN

Isso mesmo, só adicionar um “!” ali depois do if.

Agora proceda com a instalação:

# ./configure –with-webdir=/var/www/zm –with-cgidir=/usr/lib/cgi-bin –with-webuser=www-data –with-webgroup=www-data
# make
# make install

Agora vamos usar o script para criar o banco de dados:

# mysql mysql < db/zm_create.sql -p

E agora logar no mysql para dar permissão ao usuário criado:

# mysql -u root -p
mysql> grant select,insert,update,delete on zm.* to ‘zmuser’@localhost identified by ‘zmpass’;
mysql> flush privileges;

Prontinho, prontinho, prontinho…

Script de inicialização

Crie um arquivo chamado zoneminder e coloque dentro dele as seguintes linhas para a criação de um script de inicialização “automágica”:

#!/bin/sh
# description: Control ZoneMinder as a Service
# chkconfig: 2345 35 15

# Source function library.
#. /etc/rc.d/init.d/functions

prog=ZoneMinder
ZM_PATH_BIN=”/usr/bin”
command=`which zmpkg.pl`

start() {
echo -n “Starting $prog: ”
$command start
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
echo
[ $RETVAL = 0 ] && touch /var/lock/zm
return $RETVAL
}
stop() {
echo -n $”Stopping $prog: ”
#
# Why is this status check being done?
# as $command stop returns 1 if zoneminder
# is stopped, which will result in
# this returning 1, which will stuff
# dpkg when it tries to stop zoneminder before
# uninstalling . . .
#

result=`$command status`
if [ ! "$result" = "running" ]; then
echo “Zoneminder already stopped”
echo
RETVAL=0
else
$command stop
RETVAL=$?
[ $RETVAL = 0 ] && echo success
[ $RETVAL != 0 ] && echo failure
echo
[ $RETVAL = 0 ] && rm -f /var/lock/zm
fi
}
status() {
result=`$command status`
if [ "$result" = "running" ]; then
echo “ZoneMinder is running”
RETVAL=0
else
echo “ZoneMinder is stopped”
RETVAL=1
fi
}

case “$1″ in
‘start’)
start
;;
‘stop’)
stop
;;
‘restart’ | ‘force-reload’)
stop
start
;;
‘status’)
status
;;
*)
echo “Usage: $0 { start | stop | restart | status }”
RETVAL=1
;;
esac
exit $RETVAL

De acordo com sua distribuição, coloque o script no local adequado, dê permissão 775 para ele ser executado e reinicie sua máquina para fazer o teste.

Se for no Ubuntu também:

- copie para o diretório /etc/init.d
- faça os links simbólicos:

# ln -s /etc/init.d/zoneminder /etc/rc0.d/K20zoneminder
# ln -s /etc/init.d/zoneminder /etc/rc1.d/K20zoneminder
# ln -s /etc/init.d/zoneminder /etc/rc2.d/S20zoneminder
# ln -s /etc/init.d/zoneminder /etc/rc3.d/S20zoneminder
# ln -s /etc/init.d/zoneminder /etc/rc4.d/S20zoneminder
# ln -s /etc/init.d/zoneminder /etc/rc5.d/S20zoneminder
# ln -s /etc/init.d/zoneminder /etc/rc6.d/K20zoneminder

- pronto, ele irá iniciar sozinho.

Depois de feito todo o procedimento anterior, verifique se o apache está rodando, se sim acesse:

http://localhost/zm

Agora o resto é simples, para as configurações iniciais só clicar em Opções (ou Options se ele não pegar o idioma pt-br). Como na imagem abaixo:

Na primeira tela você pode escolher a linguagem da forma que achar melhor:

Na aba caminhos você edita onde deseja salvar os arquivos capturados:

Na aba imagens você escolhe como deseja que seja feito o streaming de vídeo e também o caminho do ffmpeg.

O resto das opções são bem intuitivas, basta ler. Isso vou deixar com você.

Dicas e conclusão

Dicas (Onde eu tropecei):

  • Verificar o padrão da câmera se é PALM ou NTSC.
  • Colocar pra gravar os dados em outra partição separada.
  • Ler os manuais

Conclusões

Esse artigo foi escrito com a finalidade de dar uma luz pra quem esta ralando nessa área e não quer mexer com esses GEOVISION. Então está aí pra mostrar o caminho, o resto depende de cada um. Qualquer dúvida, estamos aqui pra saná-la.

fonte: http://www.vivaolinux.com.br/artigo/Ubuntu-+-Zoneminder-=-Solucao-Livre-para-CFTV/?pagina=1