This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-InstalledModule | Get-InstalledModule -AllVersions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| s.name as [schema], | |
| v.name, | |
| v.type_desc, | |
| format(dateadd(hour, 9, v.create_date), 'yyyy-MM-dd HH:mm') as created, | |
| case when v.create_date = v.modify_date | |
| then null | |
| else format(dateadd(hour, 9, v.modify_date), 'yyyy-MM-dd HH:mm') | |
| end as modified, | |
| m.definition |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| t.name, | |
| i.rows | |
| from sys.tables t | |
| join sys.sysindexes i | |
| on t.object_id = i.id and i.indid < 2 | |
| order by t.name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| reg add HKCU\Software\Policies\Microsoft\Windows\Explorer /v DisableSearchBoxSuggestions /t REG_DWORD /d 0x00000001 /f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| reg add HKCU\Software\Policies\Microsoft\OneDrive /v DownloadBandwidthLimit /t REG_DWORD /d 0x000fffff /f | |
| reg add HKCU\Software\Policies\Microsoft\OneDrive /v UploadBandwidthLimit /t REG_DWORD /d 0x000fffff /f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'logger' | |
| l = Logger.new($stderr) | |
| l.formatter = lambda {|sev, time, prog, msg| | |
| line = [] | |
| line << "[#{time.strftime('%H:%M:%S.%02N')}]" | |
| line << "#{prog}:" unless prog.nil? || prog.empty? | |
| line << case sev | |
| when 'DEBUG' then "\033[34m#{msg.strip}\033[0m" | |
| when 'INFO' then msg.strip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| echo -n 'server1 server2 server3 server4' | \ | |
| xargs -ot -d' ' -n1 -I{} ssh -t {} 'sudo apt -y clean && sudo apt -yqq update && sudo apt -y full-upgrade && sudo apt -yqq autoremove && cat /var/run/reboot-required* && sudo shutdown --reboot +1' 2> >(while read line; do echo -e "\e[01;31m${line}\e[0m" >&2; done) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| history -c | |
| unset HISTFILE | |
| # zsh executor http://blog.kenichimaehashi.com/?article=12851025960 | |
| if [ -z "${BASH_EXECUTION_STRING}" ]; then | |
| ZSH="/bin/zsh" | |
| [ -x "${ZSH}" ] && SHELL="${ZSH}" exec "${ZSH}" -l | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'thread' | |
| WORKERS=3 | |
| q = Queue.new | |
| [5,6,7,8,9].each {|r| q.push(r) } | |
| threads = [] | |
| WORKERS.times do | |
| threads << Thread.start do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| setlocal | |
| chcp 65001 | |
| set targetdir=%~dp0\csv.sql.%date:~0,4%%date:~5,2%%date:~8,2% | |
| mkdir "%targetdir%" | |
| for /f %%T in (%~dp0\tablesU.txt) do call :sqlexport "%%T" | |
| :: pause |