參考網址:GTW
uname -m
如果是 32 位元的系統,就會顯示 i686
或 i386
,而如果是 64 位元的系統就會顯示 x86_64
。
網址:http://books.gotop.com.tw/download/AEZ020100
Scratch 3.0 多媒體遊戲設計 & Tello無人機 http://gogo123.com.tw/?page_id=10787
https://gogo123.com.tw/scratch-3-0/
參考網址:
https://kknews.cc/zh-tw/code/rygrn8o.html
裝置->插入Guest Additions CD 映像檔
cd /media
執行./VBboxLinuxAdditions.run
重啟後 進入系統設定螢幕解析度
參考網址:https://github.com/Alger23/ubuntu_dayi_for_ibus
下載安裝腳本 $ wget https://raw.githubusercontent.com/Alger23/ubuntu_dayi_for_ibus/master/dayisetup.sh 下載大易三碼字根檔 $ wget https://raw.githubusercontent.com/Alger23/ubuntu_dayi_for_ibus/master/dayi3.cin 執行安裝腳本 $ chmod u+x dayisetup.sh $ sudo ./dayisetup.sh
參考網址:https://github.com/majkinetor/posh/blob/master/MM_Network/Update-Proxy.ps1
# Author: Miodrag Milic <miodrag.milic@gmail.com> # Last Change: 14-Aug-2015. #requires -version 2.0 <# .SYNOPSIS Get or set system proxy properties. .DESCRIPTION This function implements unified method to set proxy system wide settings. It sets both WinINET ("Internet Options" proxy) and WinHTTP proxy. Without any arguments function will return the current proxy properties. To change a proxy property pass adequate argument to the function. .EXAMPLE Update-Proxy -Server "myproxy.mydomain.com:8080" -Override "" -ShowGUI Set proxy server, clear overrides and show IE GUI. .EXAMPLE Update-Proxy | Export-CSV proxy; Import-CSV proxy | Update-Proxy -Verbose Save and restore proxy properties .EXAMPLE $p = Update-Proxy; $p.Override += $p.Override += "*.domain.com" ; $p | proxy Add "*.domain.com" to the proxy override list .NOTES The format of the parameters is the same as seen in Internet Options GUI. To bypass proxy for a local network specify keyword ";<local>" at the end of the Overide values. Setting the winhttp proxy requires administrative prvilegies. .OUTPUTS [HashTable] #> function Update-Proxy() { [CmdletBinding()] param( # Proxy:Port [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [string] $Server, # Semicollon delimited list of exlusions [Parameter(ValueFromPipelineByPropertyName=$true)] [string] $Override, # 0 to disable, anything else to enable proxy [Parameter(ValueFromPipelineByPropertyName=$true)] [string] $Enable, # Show Internet Options GUI [switch] $ShowGUI ) $key = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" $r = gp $key Write-Verbose "Reading proxy data from the registry" $proxy=@{ Server = if ($PSBoundParameters.Keys -contains 'Server') {$Server} else { $r.ProxyServer } Override = if ($PSBoundParameters.Keys -contains 'Override') {$Override} else { $r.ProxyOverride } Enable = if ($PSBoundParameters.Keys -contains 'Enable') {$Enable} else { $r.ProxyEnable } } $set = "Server","Override","Enable" | ? {$PSBoundParameters.Keys -contains $_ } if ($set) { #if (!(test-admin)) { throw "Setting proxy requires admin privileges" } Write-Verbose "Saving proxy data to registry" sp $key ProxyServer $proxy.Server sp $key ProxyOverride $proxy.Override sp $key ProxyEnable $proxy.Enable if (!(refresh-system)) { Write-Warning "Can not force system refresh after proxy change" } Write-Verbose "Importing winhttp proxy from IE settings" $OFS = "`n" [string]$res = netsh.exe winhttp import proxy source=ie if ($res -match 'Access is denied') {Write-Warning $res} else { Write-Verbose $res.Trim()} } New-Object PSCustomObject -Property $proxy if ($ShowGUI) { start control "inetcpl.cpl,,4" } } # The registry changes aren't seen until system is notified about it. # Without this function you need to open Internet Settings window for changes to take effect. See http://goo.gl/OIQ4W4 function refresh-system() { $signature = @' [DllImport("wininet.dll", SetLastError = true, CharSet=CharSet.Auto)] public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength); '@ $INTERNET_OPTION_SETTINGS_CHANGED = 39 $INTERNET_OPTION_REFRESH = 37 $type = Add-Type -MemberDefinition $signature -Name wininet -Namespace pinvoke -PassThru $a = $type::InternetSetOption(0, $INTERNET_OPTION_SETTINGS_CHANGED, 0, 0) $b = $type::InternetSetOption(0, $INTERNET_OPTION_REFRESH, 0, 0) return $a -and $b } Set-Alias proxy Update-Proxy proxy -Server "120.116.22.209:3128" -Override "59.127.219.48" -Enable 1
上面的程式碼存成 proxy_enable.ps1
proxy_enable.bat
@echo off powershell.exe -ExecutionPolicy Bypass -File "s:\bat\ps\proxy_enable.ps1" REM pause
參考網址:
福別問的部落格 一鍵開啟proxy代理伺服器、顯示隱藏檔案副檔名、新增刪除輸入法
網路上大部分的教學是修改登錄檔, 但是實際上是行不通的, 修改登錄檔只能"表面上"把開啟代理伺服器的選項打勾, 並沒有真正地開啟代理伺服器。 這就是為什麼你可能按照網路上的方法寫了一個修改登錄檔的批次檔, 執行之後仍然不能夠從校外連線, 但是進到設定代理伺服器的頁面時, 卻又可以看到其代理伺服器已經被打勾啟動, 這時候又突然可以校外連線了。 (當你"檢視"啟動代理伺服器到底有沒有打勾時, 這時候windows後台又會做一些動作, 來"真正地"啟動代理伺服器。)
本腳本的原理就只是很簡單地模擬鍵盤的動作。
# 註解 # 開啟[網際網路 - 內容] control inetcpl.cpl # 如果是要開啟[資料夾選項],顯示隱藏檔案的副檔名,可以用RunDll32.exe shell32.dll,Options_RunDLL 7 # 如果是要開啟[地區及語言],新增或刪除輸入法,可以用control intl.cpl # 更多進入控制台下的項目的指令,參考https://support.microsoft.com/en-us/help/192806/how-to-run-control-panel-tools-by-typing-a-command # 讓系統取得title叫做[開啟網際網路 - 內容]的視窗 # 並讓該視窗變成當前視窗 $wshell = New-Object -ComObject wscript.shell; $wshell.AppActivate('開啟網際網路 - 內容') #停頓1秒,避免delay造成下一步無法順利進行 Sleep 1 # 按下鍵盤上的各鍵 # ' '表示按下space鍵, +表示搭配Shift, %表示搭配Alt # 各鍵的對應表參考https://msdn.microsoft.com/en-us/library/office/aa202943(v=office.10).aspx # 注意,每個電腦的按鍵組合可能不相同, # 請自行做相應的修改 $wshell.SendKeys('+{TAB}') For ($i=1; $i -le 4; $i++) {$wshell.SendKeys('{RIGHT}')} $wshell.SendKeys('%l') $wshell.SendKeys('{TAB}') $wshell.SendKeys('{TAB}') $wshell.SendKeys(' ') $wshell.SendKeys('{ENTER}') $wshell.SendKeys('{ENTER}')
參考網址:https://github.com/majkinetor/posh/blob/master/MM_Network/Update-Proxy.ps1
# Author: Miodrag Milic <miodrag.milic@gmail.com> # Last Change: 14-Aug-2015. #requires -version 2.0 <# .SYNOPSIS Get or set system proxy properties. .DESCRIPTION This function implements unified method to set proxy system wide settings. It sets both WinINET ("Internet Options" proxy) and WinHTTP proxy. Without any arguments function will return the current proxy properties. To change a proxy property pass adequate argument to the function. .EXAMPLE Update-Proxy -Server "myproxy.mydomain.com:8080" -Override "" -ShowGUI Set proxy server, clear overrides and show IE GUI. .EXAMPLE Update-Proxy | Export-CSV proxy; Import-CSV proxy | Update-Proxy -Verbose Save and restore proxy properties .EXAMPLE $p = Update-Proxy; $p.Override += $p.Override += "*.domain.com" ; $p | proxy Add "*.domain.com" to the proxy override list .NOTES The format of the parameters is the same as seen in Internet Options GUI. To bypass proxy for a local network specify keyword ";<local>" at the end of the Overide values. Setting the winhttp proxy requires administrative prvilegies. .OUTPUTS [HashTable] #> function Update-Proxy() { [CmdletBinding()] param( # Proxy:Port [Parameter(ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] [string] $Server, # Semicollon delimited list of exlusions [Parameter(ValueFromPipelineByPropertyName=$true)] [string] $Override, # 0 to disable, anything else to enable proxy [Parameter(ValueFromPipelineByPropertyName=$true)] [string] $Enable, # Show Internet Options GUI [switch] $ShowGUI ) $key = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings" $r = gp $key Write-Verbose "Reading proxy data from the registry" $proxy=@{ Server = if ($PSBoundParameters.Keys -contains 'Server') {$Server} else { $r.ProxyServer } Override = if ($PSBoundParameters.Keys -contains 'Override') {$Override} else { $r.ProxyOverride } Enable = if ($PSBoundParameters.Keys -contains 'Enable') {$Enable} else { $r.ProxyEnable } } $set = "Server","Override","Enable" | ? {$PSBoundParameters.Keys -contains $_ } if ($set) { #if (!(test-admin)) { throw "Setting proxy requires admin privileges" } Write-Verbose "Saving proxy data to registry" sp $key ProxyServer $proxy.Server sp $key ProxyOverride $proxy.Override sp $key ProxyEnable $proxy.Enable if (!(refresh-system)) { Write-Warning "Can not force system refresh after proxy change" } Write-Verbose "Importing winhttp proxy from IE settings" $OFS = "`n" [string]$res = netsh.exe winhttp import proxy source=ie if ($res -match 'Access is denied') {Write-Warning $res} else { Write-Verbose $res.Trim()} } New-Object PSCustomObject -Property $proxy if ($ShowGUI) { start control "inetcpl.cpl,,4" } } # The registry changes aren't seen until system is notified about it. # Without this function you need to open Internet Settings window for changes to take effect. See http://goo.gl/OIQ4W4 function refresh-system() { $signature = @' [DllImport("wininet.dll", SetLastError = true, CharSet=CharSet.Auto)] public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength); '@ $INTERNET_OPTION_SETTINGS_CHANGED = 39 $INTERNET_OPTION_REFRESH = 37 $type = Add-Type -MemberDefinition $signature -Name wininet -Namespace pinvoke -PassThru $a = $type::InternetSetOption(0, $INTERNET_OPTION_SETTINGS_CHANGED, 0, 0) $b = $type::InternetSetOption(0, $INTERNET_OPTION_REFRESH, 0, 0) return $a -and $b } Set-Alias proxy Update-Proxy
參考網址:平凡的幸福
PowerShell Scripts 檔案,附檔名為 .ps1。(數字的1)
PowerShell與一般直譯式語言一樣,直接以文字檔編輯,也不用編譯。
如果想要執行.ps1 的檔案,必須在PowerShell的介面下或直接以powershell指令執行
1、在PowerShell介面下
在CMD底下或「開始」–>「執行」,輸入powershell,會出現下列的提示(前面會有PS的識別字)
PS C:\>
再將Script檔案以./執行,如
PS C:\> ./test.ps1
或是以完整路徑+Script檔案來執行,如
PS C:\> d:\test.ps1
2、以powershell指令來執行
在CMD底下或「開始」–>「執行」,輸入powershell + script檔案,例如:
C:\> powershell "D:\test.ps1" 或是 C:\> powershell -command "D:\test.ps1"
註:如果資料夾名稱有「空白字元」,則必須以「單引號」來區別。例如:D:\'test ps'\test01.ps1
如何查詢所有指令:
PS C:\> get-command
如何查詢指令用法,例如要查詢get-process:
PS C:\> get-help get-process 或是 PS C:\> help get-process 或是 PS C:\> get-process -?
(說明的文件是中文的,而且也有範例可以查詢)
線上查詢所有的 Windows PowerShell 指令和說明文件,可使用「*」萬用字元或是「?」單一字元。例如:
get-help *:列出所有的主題,包括指令和概念。
get-help * | more:列出所有的主題,包括指令和概念,more表示當資料已顯示整個視窗就暫停。
get-help about*:列出所有的概念主題。
get-help about_???:列出所有about_後面最多三個字元的概念主題,如about_do、about_for
get-help get*:列出所有 get 開頭的主題。
get-help {<指令名稱或主題名稱>}:列出指定的指令或主題的說明,例如 get-help dir
教學網址:
http://www.pstips.net/
http://technet.microsoft.com/zh-tw/scriptcenter/dd742419.aspx