Postagens

Mostrando postagens de 2017

How to resolve "The trust relationship between this workstation..."

How to resolve "The trust relationship between this workstation and the primary domain failed" # Enter a Command Prompt (Local admin) C:\> netdom.exe resetpwd /s:<server> /ud:<username> /pd:* Where: <server> = a domain controller in the joined domain <user> = DOMAIN\User format with rights to change the computer password # Powershell Reset-ComputerMachinePassword [-Credential <PSCredential>] [-Server <String>]

Change TFS Database to other server

To change TFS Database to other server: # Preview Note: You can use the /preview at the end to display the actions that you must take to update the configuration. This just shows a preview of what is to be done. # Stop IIS/TFS iisreset /stop -> Stop IIS net stop TfsJobAgent -> Stop TFS Job Agent # Backup SQL Databases # Restore SQL Databases # Prepare SQL Server for Team Foundation Server - For Old versions TFSConfig PrepSQL /SQLInstance: ServerName\InstanceName # Remap DB to other server   TFSConfig RemapDBs /DatabaseName:ServerName\ Instance;Tfs_Configuration /SQLInstances:ServerName\ Instance # Change the Ownership of the Restored Databases TFSConfig Accounts /ResetOwner /SQLInstance:ServerName\ Instance /DatabaseName:Database # Register the Location of the Restored Databases if You Are Not Restoring the Application Tier TfsConfig registerDB /SQLInstance:ServerName\ Instance /DatabaseName:Database # Start IIS

SharePoint - ADD Solution

To add soluiton to your website, do: # ADD Solution - Command Line "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\stsadm" -o addsolution -filename c:\temp\solution.wsp # ADD Solution - Powershell Add-SPSolution "c:\temp\solution.wsp" Install-SPSolution -Identity solution.wsp -Force -GACDeployment -AllWebApplications

SharePoint Backup & Restore Command Line

Backup & Restore Command Line # Backup Sharepoint Site "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\stsadm" -o backup -url http://site:port/ -filename "\\server\share\Backup_Site.bak" # Restore Sharepoint Site "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\stsadm" -o restore -url http://server:port/ -filename "\\server\share\Backup_Site.bak" The "-filename" can be put to local disk "c:\temp\Backup_Site.bak"

Zabbix 3.0 Proxy Install

 To install Zabbix Proxy do: $ sudo apt install zabbix-proxy-sqlite3 $ sudo vi /etc/zabbix/zabbix_proxy.conf    Server=<Zabbix Server IP>    Hostaname=<name>   ->  same in the Zabbix Server    DBName=<Name of SQLite Database Name> $ sudo service zabbix-proxy restart $ sudo systemctl enable zabbix-proxy

Install SharePoint with local account

To install a SharePoint without using domain account (AD), close the wizard and in the powershell type the command: # New-SPConfigurationDatabase

Zabbix 3.0 Agent Install

Install Zabbix 3.0 Agent # Add Zabbix Repository on Ubuntu $ wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-2+trusty_all.deb $ sudo dpkg -i zabbix-release_3.0-2+trusty_all.deb $ sudo apt update # Install Zabbix agent $ sudo apt install zabbix-agent # Config Zabbix agent $ sudo vi /etc/zabbix/zabbix_agentd.conf Server=IP ServerActive=IP-do-Servidor   -> If Agent is Active mode Hostname=NomedoServidor   -> If Agent is Active mode $ sudo service zabbix-agent restart

How to export mailbox to PST

$name = Read-Host 'Digite o nome do usuário' New-MailboxExportRequest -Mailbox $name -FilePath \\Servidor\share\$name.pst

Powershell - Obter os logs de eventos do Windows

Como obter os logs de eventos do Windows através do Powershell # Para obter os últimos 50 eventos do log Get-EventLog -LogName Application -Newest 50 # Para obter os logs das últimas 24 horas Get-EventLog Application -After (Get-Date).AddDays(-1) # Para obter os logs das últimas 2 horas Get-EventLog Application -After (Get-Date).AddHours(-2) # Para filtrar o log por um serviços específico Get-EventLog -LogName Application -Newest 50 | where {$_.Source -like "*aaaa*"} # Para enviar os logs para um arquivo html Get-EventLog -LogName Application -Newest 50 | ConvertTo-Html | Out-File C:\Temp\EventViewerLog.html

How to Resize a Linux Swap Partition

# Resize Linux Partition root@linux:~# fdisk -l /dev/das  Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 sectors  Units: sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disklabel type: dos  Disk identifier: 0x0041f8a8  Device     Boot    Start       End  Sectors Size Id Type  /dev/vda1           2048  96471039 96468992  46G 83 Linux  /dev/vda2       96471040 104857599  8386560   4G 82 Linux swap / Solaris root@linux:~# swapoff -a root@linux:~# fdisk /dev/das  Command (m for help): d  Partition number (1,2, default 2):  Partition 2 has been deleted.  Command (m for help): d  Selected partition 1  Partition 1 has been deleted.  Command (m for help): n  Partition type     p   primary (0 primary, 0 extended, 4 free)     e   extended (container for logical partitions)  Select (default p): p  Partition number (1-4, default 1): 1  First sector (2048-209715199, default 2048):  Last

How to Install or Upgrade Nagios Core

1) Backup mkdir /backup-nagios cp -p /etc/init.d/nagios  /usr/local/nagios/ tar czf /backup-nagios/nagios-pro.tar.gz /usr/local/nagios 2) Atualização S.O. sudo apt-get update && apt-get ugprade sudo apt-get install build-essential apache2 apache2-utils libapache2-mod-php5 php5 make php5-gd libgd2-xpm-dev libperl-dev libssl-dev 3) Download wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.1.1.tar.gz wget https://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz 4) Descompactar tar zxvf nagios-4.0.2.tar.gz tar zxvf nagios-plugins-1.5.tar.gz 5) Configurar sudo useradd nagios sudo groupadd nagcmd sudo usermod -a -G nagcmd nagios 6) Compilar e Instalar Nagios Core cd nagios-4.0.2 sudo ./configure --with-command-group=nagcmd sudo make all sudo make install sudo make install-init sudo make install-config sudo make install-commandmode sudo make install-webconf (*** sudo /usr/bin/install -c -m 644 sample-config/httpd.conf /etc/apache2/sites-enabled/

Add the Exchange 2013 PowerShell module into a standard PowerShell session

Add the Exchange 2013 PowerShell module into a standard PowerShell session: Add-PSSnapin Microsoft . Exchange . Management . PowerShell . SnapIn

Zabbix 3.0 Install

Install Zabbix 3.0 LTS for Ubuntu 14.04 LTS # Add Zabbix Repository $ wget http://repo.zabbix.com/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-2+trusty_all.deb $ sudo dpkg -i zabbix-release_3.0-2+trusty_all.deb $ sudo apt update # Install Zabbix server, frontend, agent $ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-agent # Create Database Schema $ mysql -u root -p mysql> create database zabbix character set utf8 collate utf8_bin; mysql> GRANT ALL on zabbix.* to zabbix@localhost IDENTIFIED BY 'zabbix'; mysql> quit; # Import Schema and Data $ zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -u zabbix -p zabbix # Edit Zabbix Configuration File $ sudo vi /etc/zabbix/zabbix_server.conf DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=password # Config PHP $ sudo vi /etc/zabbix/apache.conf php_value date.timezone America/Sao_Paulo # Config Apache $ sudo apache2ctl configtest $ sudo vi /

Zabbix - Backup Script

Example of Script for backup database Zabbix # Variável com a data do dia DATA=$(date +%Y-%m-%d) # Parar o serviço do Zabbix service zabbix_server stop # Faz um Dump do banco de dados MySQL para um arquivo .sql mysqldump -uzabbix -pzabbix zabbix > backup_Zabbix_$DATA.sql # Iniciar o serviço do Zabbix service zabbix_server start # Montar uma pasta do Windows Windows mount -t cifs "//IP-do-Servidor/Share" /mnt/bkp -o username=”usuario”,password=”senha”,uid=1000,gid=1000 # Copiar o arquivo para a pasta cp ‘backup_Zabbix_’$DATA.sql” ‘/mnt/bkp/’ # Desmontar pasta umount /mnt/bkp

Quatro premisssas para o bom uso do Blockchain

Compreender claramente os incentivos e os fatores econômicos por trás de cada opção de Blockchain pode poupar muitos problemas futuros, de escolhas erradas Antes só havia Bitcoin...uma moeda virtual, libertária, que prometia acabar com o atual sistema financeiro. Começou meio escondida, circulando apenas no meio nerd (a primeira compra de Bitcoin conhecida ocorreu em 2010, quando o hacker Laszlo Hanyecz comprou duas pizzas no Papa John's com 10.000 Bitcoins), até que por volta de 2015 os bancos a descobriram. Mas, ao estudar o Bitcoin, viu-se que havia algo muito maior por trás dele, a tecnologia Blockchain. Os bancos, que antes olhavam Bitcoin com desconfiança viram uma oportunidade de redução de custos, uma vez que Blockchain permite transações financeiras sem intermediários para validá-las.