Skip to content

Instantly share code, notes, and snippets.

@MarkZhangTW
MarkZhangTW / keybindings.json
Last active October 11, 2020 05:45
VS Code key bindings for termianl operation.
// VS Code key bindings for termianl operation.
[
{ "key": "ctrl+a", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0001"} },
{ "key": "ctrl+b", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0002"} },
{ "key": "ctrl+c", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0003"} },
{ "key": "ctrl+d", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0004"} },
{ "key": "ctrl+e", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0005"} },
{ "key": "ctrl+f", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0006"} },
{ "key": "ctrl+g", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0007"} },
{ "key": "ctrl+h", "command": "workbench.action.terminal.sendSequence", "whe
bcdedit /copy "{current}" /d "Hyper-V"
bcdedit /set "{current}" hypervisorlaunchtype off
@MarkZhangTW
MarkZhangTW / Win10Version.cmd.md
Last active August 30, 2020 05:41
查看 Win10 版本 / check Win10 version

Windows+R(執行): winver
CMD: ver
PowerShell: [System.Environment]::OSVersion.Version
PowerShell: Get-ComputerInfo -Property Windows*

@MarkZhangTW
MarkZhangTW / SoapUI.groovy
Last active August 14, 2020 06:09
Groovy script for SoapUI
// Random Request Script
def list = []
new File('C:/Users/HSChang/Documents/Work/AML/Requests').eachFile { list << it }
def filename = list[new Random().nextInt(list.size())]
log.info(filename)
def request = context.testCase.getTestStepByName('VaryRequest').getTestRequest()
request.setRequestContent(new File(filename.getPath()).getText("UTF-8"))
// Save Output Script
FOR /F "tokens=1,2 delims=.+" %%a in ('wmic os get localdatetime ^| findstr "+"') DO set TIME_NOW=%%a%%b
SET TIME_NOW=%TIME_NOW:~0,17%
ECHO %TIME_NOW%
Get-NetFirewallRule |
Where-Object Direction -eq Inbound |
Format-Table -Property DisplayName, Enabled, Profile, Direction, Action, `
@{Name='Protocol';Expression={($PSItem | Get-NetFirewallPortFilter).Protocol}}, `
@{Name='LocalPort';Expression={($PSItem | Get-NetFirewallPortFilter).LocalPort}}, `
@{Name='RemotePort';Expression={($PSItem | Get-NetFirewallPortFilter).RemotePort}}, `
@{Name='IcmpType';Expression={($PSItem | Get-NetFirewallPortFilter).IcmpType}}, `
@{Name='DynamicTarget';Expression={($PSItem | Get-NetFirewallPortFilter).DynamicTarget}} `
-AutoSize
Array.from(
document.querySelectorAll(
"html > body > div:nth-child(1) > div > div:nth-child(1)" +
"> div:nth-child(1) > div > div > div > div:nth-child(1)" +
"> div:nth-child(1)> div > div > div:nth-child(4) > div > div > div" +
"> div:nth-child(1) > div > div > div > div:nth-child(3) > div" +
"> div:nth-child(2) > div:nth-child(1) > a"
)
).map(tag =>
[tag.href.split("facebook.com/")[1].replace("profile.php?id=", ""), tag.querySelector("span").innerHTML]
--prefix=/usr \
--sysconfdir=/etc \
--enable-dynamic \
--enable-crypt \
--enable-spasswd \
--enable-modules \
--enable-rlookups \
--enable-backends=mod \
--disable-bdb \
--disable-hdb \
`semanage port --add --type ssh_port_t --proto tcp 1234`
`semanage port -a -t ssh_port_t -p tcp 1234`
@MarkZhangTW
MarkZhangTW / keybindings.js
Created May 22, 2020 05:31
My VS Code keybindings
[
// Clear terminal history buffer
{ "key": "ctrl+l", "command": "workbench.action.terminal.clear", "when": "terminalFocus" },
// Change ctrl+m from toggle tab focus mode to send carrage return
{ "key": "ctrl+m", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\r"} },
// Change ctrl+f from find to send acknowledgement character
{ "key": "ctrl+f", "command": "workbench.action.terminal.sendSequence", "when": "terminalFocus", "args": {"text":"\u0006"} },
]