Skip to content

Instantly share code, notes, and snippets.

. { Invoke-WebRequest -UseBasicParsing http://boxstarter.org/bootstrapper.ps1 } | Invoke-Expression
Get-Boxstarter -Force
Install-BoxstarterPackage `
-PackageName https://gist.githubusercontent.com/jrotello/b7ea60809e5a0afac4a6c3cc7936ca9a/raw/Windows10-Setup.ps1 `
-Credential (Get-Credential -Message "Please provide login credentials for Boxstarter reboots")
@jrotello
jrotello / .gitignore
Last active September 25, 2019 09:18
Side load Team Foundation Server Power Tools 2015 without the need to have Visual Studio 2015 installed
work/
InstallUtil.InstallLog
@jrotello
jrotello / SetOfficeSigningTimestampServer.reg
Created July 23, 2017 06:05
Registry settings to enable timestamps for document signatures in Office 2016
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Common\Signatures]
"XAdESLevel"=dword:00000002
"MinXAdESLevel"=dword:00000002
"TSALocation"="http://timestamp.comodoca.com"
@jrotello
jrotello / deploy-unifi-cert.sh
Created March 14, 2017 03:30
Deploy dehydrated generated certificate to Unifi controller
#!/bin/bash
# Setup your Domain
DOMAIN="<domain_name_here>"
DEHYDRATED_CERTS="/home/dehydrated/certs/$DOMAIN"
# Stop the services
echo "Stopping services..."
service nginx stop
service unifi stop
@jrotello
jrotello / Rowversion.sql
Created January 31, 2017 21:09
TSQL Rowversion
/*
DROP TABLE IF EXISTS [dbo].[MyTab]
GO
CREATE TABLE [dbo].[MyTab](
[ID] [int] IDENTITY(1,1) PRIMARY KEY NOT NULL,
[Value] [nvarchar](50) NOT NULL,
[Version] [rowversion] NOT NULL,
)
*/
@jrotello
jrotello / DateTable.sql
Created January 24, 2017 00:18
TSQL to Generate a date table
DECLARE @StartDate DATE = '20000101', @NumberOfYears INT = 100;
-- prevent set or regional settings from interfering with
-- interpretation of dates / literals
SET DATEFIRST 7;
SET DATEFORMAT mdy;
SET LANGUAGE US_ENGLISH;
DECLARE @CutoffDate DATE = DATEADD(YEAR, @NumberOfYears, @StartDate);
@jrotello
jrotello / New-Cert.ps1
Created January 23, 2017 05:03
Generate a new self-signed certificate using OpenSSL
"Generating new key pair..."
openssl.exe req -x509 -sha256 -newkey rsa:2048 -keyout cert.key -out cert.cer -days 365
"Generating .pfx container..."
openssl.exe pkcs12 -export -in cert.cer -inkey cert.key -out cert.pfx
$x509 = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$x509.Import((Resolve-Path .\cert.cer))
$x509 | Format-List
[System.Convert]::ToBase64String($x509.GetRawCertData())
@jrotello
jrotello / gist:e9dffc0dfae312ae63f93935cc7ae856
Created January 18, 2017 07:18
DAX Calendar Table Generator
Calendar = ADDCOLUMNS (
CALENDAR (DATE(2016,1,1), DATE(2018,12,31)),
"DateAsInteger", FORMAT ( [Date], "YYYYMMDD" ),
"Year", YEAR ( [Date] ),
"MonthNo", FORMAT ( [Date], "MM" ),
"YearMonthNo", FORMAT ( [Date], "YYYY/MM" ),
"YearMonth", FORMAT ( [Date], "YYYY/mmm" ),
"MonthShort", FORMAT ( [Date], "mmm" ),
"MonthLong", FORMAT ( [Date], "mmmm" ),
"WeekDayNo", WEEKDAY ( [Date] ),
@jrotello
jrotello / web.config
Created December 7, 2016 06:39
slackin web.config update to allow Let's Encrypt challenges to succeed
<!-- Allow Let's Encrypt ACME challange requests -->
<rule name="LetsEncryptAcmeChallange" stopProcessing="true">
<match url="^\.well-known.*$" />
<action type="None" />
</rule>
@jrotello
jrotello / gist:20b76ed3084776751b84a86b02f0f31a
Created November 5, 2016 02:28
USG IP Camera Firewall Rules
set firewall name WAN_OUT default-action accept
set firewall name WAN_OUT description "packets from intranet to internet"
set firewall name WAN_OUT rule 5 action accept
set firewall name WAN_OUT rule 5 description "Allow NTP on IP Cameras"
set firewall name WAN_OUT rule 5 log enable
set firewall name WAN_OUT rule 5 protocol tcp_udp
set firewall name WAN_OUT rule 5 source group address-group ip_cameras
set firewall name WAN_OUT rule 5 source port 123
set firewall name WAN_OUT rule 10 action drop
set firewall name WAN_OUT rule 10 description "Block IP Cameras"