Skip to content

Instantly share code, notes, and snippets.

@ykfq
ykfq / disable-sublimetext3-portable-checking-for-update.md
Last active December 24, 2024 02:36
Disable SublimeText3 Portable from checking for update
  • Download Sublime Text 3 from official site, choose portable version

  • Unzip Sublime Text Build 3211 x64.zip

  • Open https://hexed.it, click Open file and browse to sublime_text.exe

  • In hexed.it, Ctrl+F search for license.sublimehq.com, just replace the last three ASCII 63 6F 6D with 63 63 63 or any other three ASCII code

    this will change com to ccc and so we disabled the update url.

  • In hexed.it, Ctrl+F search for www.sublimetext.com, just replace the last three ASCII 63 6F 6D with 63 63 63 or any other three ASCII code

An Ansible summary

Patterns

  • all (or *)
  • hostname: foo.example.com
  • groupname: webservers
  • or: webservers:dbserver
  • exclude: webserver:!phoenix
  • intersection: webservers:&staging
@ykfq
ykfq / kubectl-get-taints
Last active September 7, 2022 08:19
Get the taints on all nodes in one command.
root@master001:~# kubectl describe node | egrep "Taints"
Taints: gpu=yes:NoSchedule
Taints: <none>
Taints: <none>
Taints: <none>
Taints: node-role.kubernetes.io/master:NoSchedule
Taints: node-role.kubernetes.io/master:NoSchedule
Taints: node-role.kubernetes.io/master:NoSchedule
Taints: <none>
Taints: <none>
@ykfq
ykfq / Kubernetes 调度优化--重平衡策略方案整理.md
Created January 29, 2019 06:50
Kubernetes 调度优化--重平衡策略方案整理
<title>Kubernetes 调度优化--重平衡策略方案整理</title>
@ykfq
ykfq / OpenWithSublimeText3.bat
Created March 18, 2017 09:15 — forked from roundand/OpenWithSublimeText3.bat
Open folders and files with Sublime Text 3 from windows explorer context menu (tested in Windows 7)
@echo off
SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe
rem add it for all file types
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f
@reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f
rem add it for folders
@reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f
@ykfq
ykfq / latest-ffmpeg-centos6.sh
Created March 2, 2017 02:45 — forked from mustafaturan/latest-ffmpeg-centos6.sh
Installs latest ffmpeg on Centos 6
# source: https://trac.ffmpeg.org/wiki/CentosCompilationGuide
yum install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources
curl -O http://www.tortall.net/projects/yasm/releases/yasm-1.2.0.tar.gz
tar xzvf yasm-1.2.0.tar.gz
cd yasm-1.2.0
@ykfq
ykfq / CheckAllDCsForGuid.ps1
Created August 9, 2016 08:19 — forked from bill-long/CheckAllDCsForGuid.ps1
Check every GC and DC for a specific objectGUID
$guid = "bc87047d-25e8-11d3-9079-00805f31f826"
$gcs = [System.DirectoryServices.ActiveDirectory.Forest]::GetCurrentForest().GlobalCatalogs
$gcs | % {
$entry = [ADSI]("GC://" + $_.Name + "/<GUID=" + $guid + ">")
if ($entry.Guid -ne $null)
{
$entry
}
else
# 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..."
@ykfq
ykfq / Dump-MailboxSdAsSDDL.ps1
Created August 9, 2016 08:18 — forked from bill-long/Dump-MailboxSdAsSDDL.ps1
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")
$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')
}