發表文章

目前顯示的是 2月, 2019的文章

Windows 10 VPN Client連線設定

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 本文介紹Windows 10設定VNP Client的連線方式 一、開啟【設定】中的【網路和網際網路】 二、選擇【新增VPN連線】   輸入VPN連線的資訊 VPN提供者:選Windows(內建) 連線名稱:Your_TestVPN_Name 伺服器名稱或位址:Your_VPN_Server_IP VPN類型:自動 登入資訊的類型:使用者名稱與密碼 使用者名稱:User_Account 密碼:Your_User_Account_Password 設定好後點選【儲存】 三、點選 TestVPN 的【連線】 若設定正確的話,會在網路連線資訊看到VPN的連線。

Linux 遠端桌面環境建立

若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 在本部落格的「 在Ubuntu上安裝 Lubuntu Desktop ( Install Lubuntu Desktop on Ubuntu ) 」一文中,是用VNC的方式來登入Linux Desktop。若要使用Windows系統內建的遠端桌面連線程式來連Linux Desktop的話,要怎麼做呢?有下列幾個步驟: 安裝 xfce 桌面環境 安裝 xrdp 建立sudo user 1. 安裝 xfce 桌面環境 sudo apt-get update sudo apt-get install xfce4-goodies apt-get install xfce4 2. 安裝 xrdp sudo apt-get install xrdp 3. 建立sudo user 以有root權限的使用者登入後,使用底下指令來新增 username ,請將 username 替換成要建立的使用者名稱。 sudo adduser username 將此使用者 username 加到 sudo 群組裡: usermod -aG sudo username 以底下指令切換到此 user: su - username 測試此 user 是否有 root 權限: sudo ls -la /root 這三個步驟完成後,就可以用Windows的 遠端桌面用戶端 來登入Linux Desktop了。

在Ubuntu 18.04 安裝 WordPress

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 在安裝 WordPress 之前,要先建立好LAMP或LEMP環境,此部份請參考【 Ubuntu 18.04 LAMP(Linux+Apache+Mysql+PHP)環境建立 】或【 Ubuntu 18.04 LEMP(Linux+Nginx+Mysql+PHP)環境建立 】文章。 步驟一: Create a MySQL Database and User for WordPress 登入 mysql: mysql -u root -p 建立給 wordpress 使用的資料庫: CREATE DATABASE wordpress ; 建立 database 的帳戶: CREATE USER wordpressuser @localhost IDENTIFIED BY ' password '; 設定DB帳戶權限: GRANT ALL PRIVILEGES ON wordpress .* TO wordpressuser @localhost; 更新目前MySQL的登入狀態: FLUSH PRIVILEGES; 離開DB: exit 步驟二: Download WordPress 切換到home目錄: cd ~ 下載WordPress: 英文 wget http://wordpress.org/latest.tar.gz 中文 wget https://tw.wordpress.org/wordpress-5.0-zh_TW.zip 解壓縮: tar xzvf latest.tar.gz 更新系統並安裝 php 與 libssh sudo apt-get update sudo apt-get install php5-gd libssh2-php 步驟三:設定WordPress 切換到WordPress目錄: cd ~/wordpress 複製WordPress設定檔的範本: cp wp-config-sample.php wp-config.php 產生安全金...

PyGame 2D繪圖

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 農曆新年到了,於是筆者幾天前用Python做了個文字小動畫, 程式碼在此 。 做完後,心想也來發一篇和PyGame有關的2D繪圖吧。 基本繪圖 在PyGame要如何繪製直線、矩形、圓形、多邊形等常見的圖形呢?這些基本功能當然要先查API囉,所以來看一下PyGame Drawing API: http://www.pygame.org/docs/ref/draw.html  有提供那些功能。(底下文字取自  http://www.pygame.org/docs/ref/draw.html ) pygame.draw pygame module for drawing shapes pygame.draw.rect — draw a rectangle shape pygame.draw.polygon — draw a shape with any number of sides pygame.draw.circle — draw a circle around a point pygame.draw.ellipse — draw a round shape inside a rectangle pygame.draw.arc — draw a partial section of an ellipse pygame.draw.line — draw a straight line segment pygame.draw.lines — draw multiple contiguous line segments pygame.draw.aaline — draw fine antialiased lines pygame.draw.aalines — draw a connected sequence of antialiased lines 簡短說明一下,rect是矩形、polygon是多邊形、circle是圓形、ellipse是橢圓形、arc是弧形、line是直線、lines是連續的直線線段、aaline是抗鋸齒的直線、aalines是抗鋸齒的直線線段。這些function呼叫的前兩個參數都是 Surface與Color。Su...

Tinkercad Circuits:光控自走車 Light-Controlled Car

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much. 本文將使用TinkerCAD Circuits來示範光感測器(Photoresistor)的應用:「光控自走車」。讀者也可參考本部落格的文章 mBlock 單元十五:追光自走車 。 This tutorial uses the light brightness to control a car. This car could be implemented by a Arduino with photoresistors. Before assembling the hardware, the simulation could be done with TinkerCAD circuits. The reader could read this article:" mBlock Unit 15: Light-Tracking Car " later. 材料(Materials): 1. Arduino UNO R3 板子 x 1 2. 光感測器模組 Photoresistor x 2 3. 直流馬達 DC motor x 2 4. 杜邦線 jumper wire x 10 5. 麵包板 small breadboard x 1 6. 10K 電阻 resistor x 2 電路(Circuit): Photoresistor is connected to Arduino UNO A2 and A0. DC motor is connected to Arduino UNO pin 5 and pin 3. 程式碼(The Code): 示範影片(Demo Video): 範例連結(Example Link): https://www.tinkercad.com/things/e26raWWttD7

Tinkercad Circuits:Ultrasonic 自動照明

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much. 本文使用TinkerCAD Circuits來示範距離感測器(Ultrasonic)的應用:「自動照明」,距離越遠燈泡就越亮。 This is an application: "Distance-trigged light blub system". The application uses ultrasonic sensor to measure distance. And the light bulb's brightness is becoming higher when the distance is getting farther. 材料(Materials): 1. Arduino UNO R3 板子 x 1 2. 距離感測器模組 Ultrasonic x 1 3. 燈泡 light bulb x 1 4. 杜邦線 jumper wire x 5 電路(Circuit): 程式碼(The Code): 示範影片(Demo Video): 範例連結(Example Link): https://www.tinkercad.com/things/0wvwVcvzDrx

刪除Windows 10 下的 Windows.old 資料夾

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 Windows 10在更新後,有時會出現 Windows.old 資料夾,於是筆者就參考 Youtube上的影片: 來進行刪除的動作。以 系統管理者 的權限開啟 命令提示字元 ,使用底下三個指令來處理: takeown /F C:\Windows.old\* /R /A  cacls C:\Windows.old\*.* /T /grant administrators:F rmdir /S /Q C:\Windows.old\ 這樣子就可以刪除 Windows.old 資料夾了。

Tinkercad Circuits:生氣指數 LED 燈 Sound triggered LEDs

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much. 本文使用TinkerCAD Circuits來示範聲音感測器的應用:「生氣指數」,聲音越大LED就越亮也越多顆。 Sound sensor application: "Sound triggered LED". This sound level to control the number of LEDs. The higher the sound level, the more LEDs are on. 材料(Materials): 1. Arduino UNO R3 板子 x 1 2. 聲音感測器模組 Sound sensor x 1 3. LED 燈 x 4 4. 杜邦線公對公 male/male jumper wire x 8 5. 220歐姆電阻 220 ohm resistor x 4 6. 麵包板 Breadboard x 1 電路(Circuit): 上圖是用Photentiometer表示聲音感測器模組。 Sound sensor signal pin is wired to Arduino UNO A0. The LEDs' anodes are wired to Arduino UNO pin 3, 5, 6, 9, respectively. 程式碼(The Code):   示範影片(Demo Video): 範例連結(Example Link): https://www.tinkercad.com/things/508wK2VaSjGx

Python in Visual Studio Code

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much. This tutorial will focus on the setting of Python in Visual Studio Code. Step 1: Download The Required Software Python Installer  https://www.python.org/downloads/ Visual Studio Code Installer  https://code.visualstudio.com/ Step 2: Installing Visual Studio Code & Python By click the installers to install Python and Visual Studio Code. Then choose the default configuration(next, next, and next) Step 3:  Install the  Python extension for VS Code . Click Extension icon. And input "Python extension for VS Code" to search the extension. Then, install(or reload) it. Step 4: Creating a VS Code project folder Creating a folder to your preferred path. Open this folder from VS Code. File ==> Open Folder Step 5: Checking the Python Open a New Terminal,  Type the command "py -V" to chec...

Tinkercad Circuits:大聲公

圖片
若您覺得文章寫得不錯,請點選文章上的廣告,來支持小編,謝謝。 If you like this post, please click the ads on the blog or  buy me a coffee . Thank you very much. 本文使用TinkerCAD Circuits來示範聲音感測器的應用:「大聲公」,聲音越大LED就越亮。 Sound sensor application: "Sound triggered LED". This sound sensor controls the brightness of a LED with its' sound level. 材料(Materials): 1. Arduino UNO R3 板子 x 1 2. 聲音感測器模組 x 1 3. LED 燈 x 1 4. 杜邦線公對公 male/male jumper wire x 6 5. 220歐姆電阻 220 ohm resistor x 1 電路(Circuit): 上圖是用Photentiometer表示聲音感測器模組。 Sound sensor signal pin is wired to Arduino UNO A0. The LED's anode is wired to Arduino UNO pin 9. 程式碼(The Code): 示範影片(Demo Video): 範例連結(Example Link): https://www.tinkercad.com/things/4RDpugLYGE8