[portablesoft]綠色便攜軟件

參考網址:https://www.portablesoft.org/

發表於 Windows系統, 軟體使用 | 發表迴響

分辨 Linux 系統是 32 位元還是 64 位元的方法

參考網址:GTW

uname -m

如果是 32 位元的系統,就會顯示 i686 或 i386,而如果是 64 位元的系統就會顯示 x86_64

發表於 Linux系統 | 發表迴響

[tello]DJI Tello 開箱.迷你空拍機

參考網址:http://www.cg.com.tw/DJITello/

發表於 程式設計 | 發表迴響

[碁峯]gotop書籍範例下載

網址: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/

 

發表於 程式設計, 軟體使用 | 發表迴響

VirtualBox虛擬機 Ubuntu解析度太小的解決方案

參考網址:

https://kknews.cc/zh-tw/code/rygrn8o.html

裝置->插入Guest Additions CD 映像檔
cd /media
執行./VBboxLinuxAdditions.run
重啟後 進入系統設定螢幕解析度

發表於 Linux系統, Windows系統 | 發表迴響

[ubuntu]在 Ubuntu 18.04.1 的 IBus 上安裝大易輸入法

參考網址: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

 

發表於 Linux系統 | 發表迴響

[PowerShell][Proxy]用PowerShell設定Proxy 完成版

參考網址: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

 

發表於 Windows系統 | 發表迴響

[PowerShell][Proxy]用PowerShell設定Proxy – 模擬鍵盤

參考網址:
福別問的部落格 一鍵開啟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}')

 

發表於 Windows系統 | 發表迴響

[PowerShell]ps1 to exe Generator

參考網址:https://gallery.technet.microsoft.com/PS1-To-EXE-Generator-d39e8be2

發表於 Windows系統 | 發表迴響

[PowerShell]用PowerShell設定proxy

參考網址: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

 

發表於 Windows系統 | 發表迴響