Skip to content

Instantly share code, notes, and snippets.

@dinhchi27
dinhchi27 / Key Sublime Text 3.2.1 Build 3207 - Sublime Text 3 License Key
Last active April 24, 2024 23:37
Key Sublime Text 3.2.1 Build 3207 - Sublime Text 3 License Key
Key Sublime Text 3.2.1 Build 3207
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
@kekru
kekru / 01nginx-tls-sni.md
Last active May 6, 2024 14:59
nginx TLS SNI routing, based on subdomain pattern

Nginx TLS SNI routing, based on subdomain pattern

Nginx can be configured to route to a backend, based on the server's domain name, which is included in the SSL/TLS handshake (Server Name Indication, SNI).
This works for http upstream servers, but also for other protocols, that can be secured with TLS.

prerequisites

  • at least nginx 1.15.9 to use variables in ssl_certificate and ssl_certificate_key.
  • check nginx -V for the following:
    ...
    TLS SNI support enabled
@willwhui
willwhui / 将路由器刷为OpenWrt
Created July 3, 2018 01:43
将路由器刷为OpenWrt
将路由器刷为OpenWrt
@renkin
renkin / KeePass_URL_Overrides_for_MobaXterm.bat
Created January 4, 2018 16:12
KeePass URL Overrides for SSH Scheme using MobaXterm
cmd://"C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe" -newtab "ssh {USERNAME}@{URL:RMVSCM}"
@iAugur
iAugur / ansible-add-string-to-line.yml
Last active February 22, 2024 14:25
Ansible: Add a String to an existing line in a file
# Adapted from solution provided by http://stackoverflow.com/users/57719/chin-huang http://stackoverflow.com/a/31465939/348868
# Scenario: You want to add a group to the list of the AllowGroups in ssh_config
# before:
# AllowGroups Group1
# After:
# AllowGroups Group1 Group2
- name: Add Group to AllowGroups
replace:
backup: yes
$filter = "(proxyAddresses=SMTP:foo@contoso.com)"
$gcs = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs
$gcs | % {
$searcher = $_.GetDirectorySearcher()
$searcher.Filter = $filter
$results = $searcher.FindAll()
if ($results.Count -gt 0)
{
$results
$searcher = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().FindGlobalCatalog()
$searcher.Filter = "(&(objectClass=user)(msExchMailboxMoveFlags=10))"
$results = $searcher.FindAll()
"Found " + $results.Count.ToString() + " results:"
foreach ($result in $results)
{
$dn = $result.Properties["distinguishedName"][0].ToString()
$dn
$entry = [ADSI]("LDAP://" + $dn)
$entry.Properties["msExchMailboxMoveFlags"].Clear()
$path = '\\server\path\'
$mailboxes = get-mailbox somemailboxfilter
$mailboxes | % {
$folders = Get-MailboxFolderStatistics $_.Alias -archive
$folders = $folders | ? {$_.Name -ne "Top of Information Store"}
$excludeFolders = $folders | % { $_.FolderPath.Substring(1) }
New-MailboxExportRequest -Mailbox $_.Alias -ExcludeFolders $excludeFolders -ExcludeDumpster -IsArchive -FilePath ($path + $_.Alias + '.pst')
}
@bill-long
bill-long / Dump-MailboxSdAsSDDL.ps1
Created March 21, 2016 23:58
Dump msExchMailboxSecurityDescriptor as SDDL format. Useful if you need to inspect the raw ACL.
param($alias)
$searcher = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().FindGlobalCatalog().GetDirectorySearcher()
$searcher.Filter = "(mailnickname=$alias)"
$user = $searcher.FindOne()
$mbxSd = $user.Properties["msExchMailboxSecurityDescriptor"][0]
$sd = New-Object System.Security.AccessControl.RawSecurityDescriptor([byte[]]$mbxSd, 0)
$sd.GetSddlForm("All")
# Save-AllExchangeLogs.ps1
$timeString = (Get-Date).ToString("yyyyMMddHHmm")
$machineName = [Environment]::MachineName
$targetFolder = "$home\desktop\ExchangeLogs-$machineName-$timeString"
md $targetFolder | Out-Null
"Saving $targetFolder\Application.evtx..."
wevtutil epl Application "$targetFolder\Application.evtx"
"Saving $targetFolder\System.evtx..."