Remotely shutdown/restart Windows via Linux on Debian/Ubuntu based Linux

Need samba-common package first, install via apt:

$ sudo apt-get install samba-common

Then use this command to shutdown the computer remotely(replace ip, username and password with your own):

$ net rpc shutdown --ipaddress ip --user username%password

Add -r if you want to restart, not shutdown:

$ net rpc shutdown -r --ipaddress ip --user username%password

After execution, here is the success message:

Shutdown of remote machine succeeded

If receive these messages below means something failed:

Could not connect to server 192.168.1.55
Connection failed: NT_STATUS_IO_TIMEOUT
Connection failed: NT_STATUS_RESOURCE_NAME_NOT_FOUND
Could not initialise pipe winreg. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND

There are many functions provide by net [rpc], like:

net rpc audit Modify global audit settings
net rpc info Show basic info about a domain
net rpc join Join a domain
net rpc oldjoin Join a domain created in server manager
net rpc testjoin Test that a join is valid
net rpc user List/modify users
net rpc password Change a user password
net rpc group List/modify groups
net rpc share List/modify shares
net rpc file List open files
net rpc printer List/modify printers
net rpc changetrustpw Change trust account password
net rpc trustdom Modify domain trusts
net rpc abortshutdown Abort a remote shutdown
net rpc shutdown Shutdown a remote server
net rpc samdump Dump SAM data of remote NT PDC
net rpc vampire Sync a remote NT PDC’s data into local passdb
net rpc getsid Fetch the domain sid into local secrets.tdb
net rpc rights Manage privileges assigned to SID
net rpc service Start/stop/query remote services
net rpc registry Manage registry hives
net rpc shell Open interactive shell on remote server
net rpc trust Manage trusts
net rpc conf Configure a remote samba server

Check man rpc for more details!

Microsoft Visual Studio Code Preview and .NET core on Linux

當微軟也開始擁抱開放原始碼、自由軟體、Linux,身為資訊人是該有些省思。

.NET Core如微軟先前所說支援Linux了,甚至連FreeBSD的版本都有(開發中),而目前丟在GitHub上的版本可用的.NET Core API已經有全部的45%了,相信很快就能到八成以上,詳情可參考.NET blog:
.NET Announcements at Build 2015
http://blogs.msdn.com/b/dotnet/archive/2015/04/29/net-announcements-at-build-2015.aspx

另外一件大事是Microsoft Visual Studio CodeVisual Studio的 … 兄弟?或說是一個比較初期的opensource版本,據說是based on GitHubatom editor
看來以後需要寫程式的課終於可已有一統江湖的IDE了?

官網:
https://www.visualstudio.com/en-us/products/code-vs.aspx

MicrosoftVisualStudioCodePreviewWebsite2
MicrosoftVisualStudioCodePreviewWebsite我自己裝起來玩的畫面,期待可以變得跟我們認識的Visual Studio愈來愈像XD?
MicrosoftVisualStudioCodePreview