Skip to content

Instantly share code, notes, and snippets.

View nidr0x's full-sized avatar
🎯
💭

Carlos nidr0x

🎯
💭
  • Abbott
  • Valencia (Spain)
View GitHub Profile
[Appearance]
ColorScheme=86353-Oxygen
Font=Source Code Pro for Powerline,11,-1,5,50,0,0,0,0,0,Regular
UseFontLineChararacters=true
[General]
Name=nidr0x
Parent=FALLBACK/
[Scrolling]
- name: Install misc packages
apt: name={{item}} state=present
with_items:
- curl
- git
- zip
- unzip
- vim
- logrotate
- ufw
@nidr0x
nidr0x / gist:0a44c4850643c024ec3503aa084c2490
Created June 11, 2018 07:33
Ansible enable TCP SQL Server (Windows)
- name: Enable TCP socket in SQL Server
win_regedit:
path: HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQLServer\SuperSocketNetLib\Tcp
name: Enabled
data: 1
type: dword
tags:
- mssql
@nidr0x
nidr0x / gist:6a104040e2344fdef930736574b03e05
Created June 11, 2018 07:32
Powershell enable TCP SQL Server
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql13.SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpdynamicports -value '' ; \
set-itemproperty -path 'HKLM:\software\microsoft\microsoft sql server\mssql13.SQLEXPRESS\mssqlserver\supersocketnetlib\tcp\ipall' -name tcpport -value 1433 ; \
# Don't be scared, wget is an alias for Invoke-WebRequest
wget https://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1 -Outfile ConfigureRemotingForAnsible.ps1
.\ConfigureRemotingForAnsible.ps1
winrm quickconfig -transport:https
Enable-WSManCredSSP -Role Server -Force
Set-Item -Path "WSMan:\localhost\Service\Auth\CredSSP" -Value $true
#Needed for installing SQL Server via Chocolatey in Win2012
- name: Download Hotfixes
win_get_url:
url: "{{ item.url }}"
dest: "C:/{{ item.kb }}.msu"
with_items:
- { kb: KB2919442, url: "https://download.microsoft.com/download/D/6/0/D60ED3E0-93A5-4505-8F6A-8D0A5DA16C8A/Windows8.1-KB2919442-x64.msu" }
- { kb: KB2919355, url: "https://download.microsoft.com/download/2/5/6/256CCCFB-5341-4A8D-A277-8A81B21A1E35/Windows8.1-KB2919355-x64.msu" }
#Needed to avoid provision stop in W2016 because is not needed
when: ansible_distribution == "Microsoft Windows Server 2012 R2 Datacenter" or ansible_distribution == "Microsoft Windows Server 2012 R2"
# Redis configuration file example
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
# 1k => 1000 bytes
# 1kb => 1024 bytes
# 1m => 1000000 bytes
# 1mb => 1024*1024 bytes
# 1g => 1000000000 bytes
- name: Download Hotfixes
win_get_url:
url: "{{ item.url }}"
dest: "C:/{{ item.kb }}.msu"
with_items:
- { kb: KB2919442, url: "https://download.microsoft.com/download/D/6/0/D60ED3E0-93A5-4505-8F6A-8D0A5DA16C8A/Windows8.1-KB2919442-x64.msu" }
- { kb: KB2919355, url: "https://download.microsoft.com/download/2/5/6/256CCCFB-5341-4A8D-A277-8A81B21A1E35/Windows8.1-KB2919355-x64.msu" }
- name: Install KB2919442 Hotfix
win_hotfix:
netsh advfirewall firewall add rule name="Open Zabbix agentd port 10050 inbound" dir=in action=allow protocol=TCP localport=10050
netsh advfirewall firewall add rule name="Open Zabbix agentd port 10050 outbound" dir=out action=allow protocol=TCP localport=10050
netsh advfirewall firewall add rule name="Open Zabbix trapper port 10051 inbound" dir=in action=allow protocol=TCP localport=10051
netsh advfirewall firewall add rule name="Open Zabbix trapper port 10051 outbound" dir=out action=allow protocol=TCP localport=10051