Skip to content

Instantly share code, notes, and snippets.

View red-avtovo's full-sized avatar
⛩️
Zen

Aleksandr red-avtovo

⛩️
Zen
View GitHub Profile
@red-avtovo
red-avtovo / rdpKicker.vbs
Created October 13, 2017 23:03
Kick all rdp clients from Win Server
Dim serverName
serverName = InputBox("Server name to look sessions in","Server name prompt")
rem MsgBox(serverName)
Set oShell = WScript.CreateObject("WScript.shell")
rem qwinsta /server:server
Set oResult = oShell.Exec ("qwinsta /server:"&serverName)
strText = StrConv(oResult.StdOut.ReadAll(), "ibm866", "windows-1251")
Function StrConv(Text, SourceCharset, DestCharset)
Set Stream = CreateObject("ADODB.Stream")
@red-avtovo
red-avtovo / gitMigrate.sh
Created October 13, 2017 22:34
push remote git repository to other remote
#!/bin/bash
#move all branches from repo1 to repo2
repo1=origin
repo2=gogs
branches=$(git branch -r | grep -v $repo2 | grep -v $repo1/HEAD)
echo $branches | while read line ; do
branch=${line:${#repo1}+1}
git checkout $branch