Skip to content

Instantly share code, notes, and snippets.

View potatoqualitee's full-sized avatar
big permz energy

Chrissy LeMaire potatoqualitee

big permz energy
View GitHub Profile
@potatoqualitee
potatoqualitee / sql2005logins.sql
Created June 14, 2016 10:57
sample output for Export-SqlLogin
use master
GO
CREATE LOGIN [app1] WITH PASSWORD = 0x0100782FBD65E30E772B02685C41E3F69FC1E639EC77F5F4061A HASHED, SID = 0x63F51E14DBA20942AF361A3300193A7B, DEFAULT_DATABASE = [master], CHECK_POLICY = ON, CHECK_EXPIRATION = OFF, DEFAULT_LANGUAGE = [us_english]
GO
use master
GO
Grant CONNECT SQL TO [app1] AS [sa]
GO
use master
GO
@potatoqualitee
potatoqualitee / dbatools-startmigration-transcript.txt
Created July 5, 2016 22:31
PowerShell SharePoint SQL Transcript
**********************
Windows PowerShell transcript start
Start time: 20160706002352
Username: BASE\ctrlb
RunAs User: BASE\ctrlb
Machine: SHAREPOINT2016 (Microsoft Windows NT 10.0.14300.0)
Host Application: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Process ID: 10832
PSVersion: 5.1.14300.1000
@potatoqualitee
potatoqualitee / reconnect.scpt
Created October 21, 2016 19:06
reconnect wifi
repeat
try
do shell script "ping -o -t 2 10.0.0.1"
on error
say "Couldn't connect"
do shell script "networksetup -setairportpower en1 off"
do shell script "sleep 1"
do shell script "networksetup -setairportpower en1 on"
end try
delay 5
@potatoqualitee
potatoqualitee / gist:59cde5694a719037827d513a1bf7a7c1
Created October 24, 2016 14:43
Getting AS domains and forests
<#
.SYNOPSIS
Displays list of accounts that have been locked out in AD since the last time each DC's Event Log has rolled over.
.DESCRIPTION
By default, this script displays list of accounts that have been locked out on the current domain since the last time the Event Log rolled over. Results can be filtered by using parameters.
.PARAMETER forest
Queries all DCs in the current forest
@potatoqualitee
potatoqualitee / Get-LocateCE.ps1
Created January 23, 2015 12:54
Get-LocateCE.ps1
if ($PSScriptRoot) { $location = $PSScriptRoot } else { $location = (Get-Location).Path }
$dll = "$location\System.Data.SqlServerCe.dll"
# look into SQLiteDataAdapter
if ($GetDll) {
$wc = New-Object System.Net.WebClient
$url = "https://netnerds.net/System.Data.SqlServerCe.dll"
$wc.DownloadFile($url,$dll)
}
@potatoqualitee
potatoqualitee / ad-php-kerberos-apache-bash-windows.txt
Last active November 3, 2016 11:44
Active Directory and PHP on Apache on Bash on Ubuntu on Windows
<#
In this example:
1. Active Directory domain: base.local
2. Service acct: base\ubuntuauth
3. Service acct pass: SkiAlta2009
4. Win 10 workstation name: nimy.base.local
5. Secondary DNS name: localweb.base.local
6. Firewall allows port 80
Kerberos doesn't allow you to do http://localhost if you want
@potatoqualitee
potatoqualitee / apache-kerberos-active-directory-ubuntu.txt
Last active November 3, 2016 11:45
Ubuntu 15.10 Apache SSO to Active Directory without being a Member Server
<#
In this example:
1. Active Directory domain: base.local
2. Domain controller 1: dc.base.local
3. Domain controller 2: bdc.base.local
4. Test username: base\chrissy
5. Test Ubuntu FQDN: web1.base.local
Note: Make sure your DNS servers are your AD DNS servers
#>
@potatoqualitee
potatoqualitee / kerberos-active-directory-ubuntu.txt
Last active November 3, 2016 11:45
Authenticate Ubuntu 15.10 to AD without being a Member Server
<#
In this example:
1. Active Directory domain: base.local
2. Domain controller 1: dc.base.local
3. Domain controller 2: bdc.base.local
4. Test username: base\chrissy
Note: Make sure your DNS servers are your AD DNS servers
#>
@potatoqualitee
potatoqualitee / add-ubuntu-proxies-apt-get-and-command-line.txt
Last active November 3, 2016 11:46
Add proxy environment variables to Ubuntu for apt-get and command-line tools like curl and wget
# Edit /etc/apt/apt.conf.d/95proxies
Acquire::http::proxy "http://proxy.ad.local:8080/";
Acquire::ftp::proxy "ftp://proxy.ad.local:8080/";
Acquire::https::proxy "https://proxy.ad.local:8080/";
# Edit /etc/environment
http_proxy="http://proxy.ad.local:8080/"
https_proxy="http://proxy.ad.local:8080/"
@potatoqualitee
potatoqualitee / apache-kerb-with-prompt-simple.txt
Created April 11, 2016 09:56
Apache with super simple kerb
apt-get -y install ntp ntpdate
service ntp stop
ntpdate -s 10.0.1.10
service ntp start
apt-get -y install krb5-user
echo HTTP/ubuntunew.base.local@BASE.LOCAL > /etc/httpd.keytab