ubuntu 19.10 安裝Scratch 2

之前有裝過SCRATCH 2在18.04.但是在19.10中好像這個元件不見了.

Scratch 2 安裝在18.04

libgnome-keyring/libgnome-keyring0_

所以把他補上就可以正常的運作了.

wget http://mirrors.kernel.org/ubuntu/pool/universe/libg/libgnome-keyring/libgnome-keyring0_3.12.0-1build1_amd64.deb
mkdir tmp
dpkg-deb -R libgnome-keyring0_.deb tmp/ sudo mv tmp/usr/lib/x86_64-linux-gnu/libgnome-keyring.so.0 /usr/lib/x86_64-linux-gnu/
rm -rf tmp

Piper Computer platform 樹苺派-組合電腦平台

樹苺派-組合電腦平台

樹苺派-組合電腦平台

樹苺派-組合電腦平台看起來是一個木頭的電腦組成器,讓小朋友可以了解電腦的構造,透過其中的感測組件了解各項運作的原理.

裡面只有幾個電燈和,麵包板和一些小組小,感測器的元件可能需要外購.

原購買網址:

Piper Computer platform

Minecaft 伺服器安裝程和設定和重點注意事項(使用SPIGOT 1.14.4) WINDOWS

最新的MINECRAFT 1.14.4 已經推出了一陣子了,前一陣子己經在許多的YOUTUBE網站上已經有很多的直播主也播過了這個版本。但我在安裝時發現了好多的問題,所以把整個流程寫成這篇教學。

安裝流程:

1.下載JAVA 8版 64位元
2.安裝JAVA
3.下載SPIGOT .jar檔
4. 執行 JAVA 安裝spigot
5.咖啡時間(約15分鐘)
6.執行首次安運作 (同意EULA)
7. 設定一個BAT的啟動檔
8.開啟 MINECRAFT 登入帳號並設置OP

結論

1.下載JAVA 8 (64位元)

MINECRAFT 的伺服器版本必須使用64位元版本的才能使用較高的記憶體.



網址: https://www.java.com/zh_TW/download/manual.jsp
2019年資料,如變更位置需自己找到

2.安裝JAVA

3.下載SPIGOT

先在電腦的C槽C:中建立一個版本目錄,因為可以在下次安裝新版本的時候保留原來舊版本.

建立版本目錄

下載BuildTools到這個目錄中.

spigot 官方網站: https://www.spigotmc.org/
spigot 下載頁: https://hub.spigotmc.org/jenkins/job/BuildTools/

4. 執行 JAVA 安裝spigot

windows 系統只要點選BuildTools就可以了

產生檔案中…

5.咖啡時間(….)

一直到生出spigot-1.14.4.jar就算安裝完成了

6. 執行首次安運作 (同意EULA)

編輯 eula.txt

把EULA的參數改成true

設置為TURE

By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula).

eula=true



7. 設定一個BAT的啟動檔

start.bat 啟動檔

@ECHO OFF
java -Xms1024M -Xmx2048M -jar spigot-1.14.4.jar nogui
pause

上列的文字存start.bat放在同目錄中

然後執行他.

伺服器小黑框就會出現-還有防火牆同意項目

懶人包下載: eula.txt 和 start.bat

8. 開啟 MINECRAFT 登入帳號並設置OP

在進伺服器管畫面中 op 管理者

變成了管理者:

STOP 關閉伺服器





找到自己的IP


在WINDOWS設定
網際網路選項中 > 找到網路設定


然後加入到MINCRAFT 伺服器

加入你的IP

試一下自己是不是管理者

再來就可以和朋友一起同樂了!


結論:

Minecratft版本進化的很快,2019己經又進化到了蜜蜂的時代

EX: 如何開放家裡的伺服器給朋友連過來.

開放MINECRAFT 預設的伺服器是使用IP: 25565 PORT
所以你要在家裡的FIREWALL 中開放你的內部對應IP到真實的IP的25565
但你必須要有固定的IP.才能給朋友.

一般解法有3個
1.去中華電信申請設定一個固定的IP
2.使用動態IP例如NOIP
3.使用hamachi的VPN方法

在FIREWALL中設定IP對外

這些都要變經過許多的測試XD.







Ubuntu 18.04/19.04 安裝Draw.io 好用的繪圖軟體 (也有WINDOWS和MAC)

draw.io 是一個非常好用的繪圖軟體.他提供了非常多常用的ICON用來設計圖,使用上非常的直覺.他也提供了離線版本:
https://github.com/jgraph/drawio-desktop/releases
這裡有持續更新的最新版本 /你可以在這裡下載到 Windows Installer, Window No Installer, Mac, Linux – deb, snap, AppImage or rpm 的幾種安裝格式.

Ubuntu提供snap版本的

在 snap 上安裝--

sudo snap install drawio --edge

uBuntu 19.04 /rc.local 重建手術

最近把家裡的centos 7伺服器改成了新19.04版本的,但是發現完全找不到開機執行的RC.LOCAL 檔,只好自行重建了

1.建立一個rc.local 服務

sudo vi /etc/systemd/system/rc-local.service

[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99

[Install]
WantedBy=multi-user.target

完成後存檔記錄.

1.建立一個/etc/rc.local 檔

sudo touch /etc/rc.local
sudo chmod +x /etc/rc.local

sudo vi /etc/rc.local

加入預設的啟動SHELL內容:
#!/bin/sh -e

exit 0;

3.建立開機時的執行服務啟動

sudo systemctl enable rc-local

重新啟動電腦就完成設置了.


樹苺派BUSTER (DEBIAN 10) 安裝PHP7.3 +LARAVEL+RASPBERRYPI

樹苺派在2019年升級到了新的debian 10 也提供了新版本的php 使用,所以我們今天就針對php版本重新進行安裝,基本的laravel的環境.

安裝 php-7.3 及php_fpm

sudo apt install php7.3 php7.3-curl php7.3-gd php7.3-imap php7.3-json php7.3-mysql php7.3-opcache php7.3-xmlrpc php7.3-xml php7.3-fpm php7.3-zip php7.3-mbstring php7.3-sqlite3 php7.3-cli php7.3-readline -y



修改PHP7.3-FPM 使用者改為PI

vi /etc/php/7.3/fpm/pool.d/www.conf
#—-以下內容修改
#把 www-data 改成pi
;user = www-data
;group = www-data

user = pi
group = pi

###
;listen.owner = www-data
;listen.group = www-data
改成
listen.owner = pi
listen.group = pi

啟動PHP7.3-FPM

service php7.3-fpm start
systemctl enable php7.3-fpm


安裝Composer

sudo apt-get install composer




安裝 nodejs 和 npm

sudo apt-get install nodejs
sudo apt-get install npm


因為laravel需要用到nodejs所以安裝這些套件

安裝NIGNX HTTPD 伺服器

sudo apt-get install nginx


設定 nginx 的使用者為pi

sudo vi /etc/nginx/nginx.conf

#user www-data;
user pi;


修改預設的伺服器的php

sudo vi /etc/nginx/sites-available/default

    #
    #location ~ \.php$ {
    #       include snippets/fastcgi-php.conf;
    #
    #       # With php-fpm (or other unix sockets):
    #       fastcgi_pass unix:/run/php/php7.3-fpm.sock;
    #       # With php-cgi (or other tcp sockets):
    #       fastcgi_pass 127.0.0.1:9000;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #       deny all;
    #}
#
location ~ \.php$ {
       include snippets/fastcgi-php.conf;
#
#       # With php-fpm (or other unix sockets):
       fastcgi_pass unix:/run/php/php7.3-fpm.sock;
#       # With php-cgi (or other tcp sockets):
#       fastcgi_pass 127.0.0.1:9000;
}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
       deny all;
}

啟動NGINX

sudo serivce nginx start
sudo systemctl enable nginx

安裝laravel

composer create-project laravel/laravel laravel –prefer-dist
生成的laravel目錄會放置於/home/pi/laravel

設定nginx目錄指向laravel

sudo vi /etc/nginx/sites-available/default

#原始內容
    root /var/www/html;

    # Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;
#更改為以下內容    
root /home/pi/laravel/public;

    # Add index.php to the list if you are using PHP
    index index.php index.html index.htm index.nginx-debian.html;

重新啟動NGINX

sudo serivce nginx start


打完收功

Raspberrypi 樹苺派設定固定IP

前言

樹苺派設定固定IP的方式:

啟動eth0的網路

vi /etc/network/interfaces.d/eth0

#auto eth0 是啟動!!!
auto eth0
iface eth0 inet static
address 192.168.1.222
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 168.95.1.1 8.8.8.8

DNS 設定: (一般首次設定時會)

vi /etc/reslove.conf

nameserver 168.95.1.1
nameserver 8.8.8.8

多重網路開啟時:

如果要同時開立無線網路/及有線網路時要指定default gateway

sudo route add default gw 192.168.1.1









UBUNTU 18.04/19.10 安裝 PHP7.2 +Composer +nginx+Laravel+nodejs+github專案流程建立

PHP7.2+Composer+Larave+nodejs+github流程建立,從無到有的建立出一個php程式開發的環境,並加入GITHUB 上傳的專案流程

1.INSTALL PHP

sudo apt-get install php7.2 php7.2-cli php7.2-common php7.2-fpm php7.2-json php7.2-mbstring php7.2-mysql php7.2-readline php7.2-sqlite3 php7.2-xml php7.2-zip



2.INSTALL Composer

sudo apt-get install composer



3.Install Node.JS & npm

sudo apt-get install npm



4.Create First Laravel project

#composer create-project laravel/laravel [專案名] --prefer-dist composer create-project laravel/laravel laravel --prefer-dist





5.start npm & webpack

#cd [專案名]
cd laravel
npm install




6.RUN NPM

npm run watch




7.new Screen: Start Laravel http service:

php artisan serve


打完收工:
測試網址:http://127.0.0.1:8000
對外測試:
php artisan serve host 0.0.0.0

8.Install php-fmp & enable php7.2-fpm

sudo systemctl enable php7.2-fpm
service php7.2-fpm start


8. Install Nginx

sudo apt-get install nginx


10.edit nginx config file

sudo vi /etc/nginx/sites-enabled/default

################################
#root /var/www/html;
root /home/pi/laravel/public;

#Add index.php to the list if you are using PHP
#index index.html index.htm index.nginx-debian.html;
index index.php index.html index.htm index.nginx-debian.html;
 
location ~ .php$ {
     include snippets/fastcgi-php.conf; 
     fastcgi_pass unix:/var/run/php/php7.2-fpm.sock; 
}
location ~ /\.ht {             
    deny all;     
}



11.啟動nginx 並設定開機重啟

sudo service nginx restart
sudo systemctl enable nginx

http://localhost/index.php

終於完成了這篇好長的過程~ 謝謝大家的收看。

番外篇:

Github :https://github.com

i.在github 建立[你的專案]

mkdir temp
cd temp
git clone https://github.com/[你的帳號]/[你的專案]
mv [你的專案]/.git ../
cd ../
rm -rm temp




ii.建立上傳的過濾資料:.gitignore

vi .gitignore

以下是.gitignore的內容.這裡面的東西不會被git 傳上server

#內容:
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
#結束


iii.加入/COMMIT/然後上傳GIT

git.add .
git commit -m "init project"
git push

打完虛脫…..GG ….


Conclustion:

我們使用LINUX平台設定出php環境,開始開發PHP程式.




關於我:

JACCH SCRATCH 教學

JACCH是一個長期教自己小朋友的爸爸,在某個小小的工廠擔任資訊管理人員,編寫公司的ERP系統. 平時喜觀研究PYTHON,PHP,LINUX 等等的技術,也喜歡購買分享和開箱.
Facebook: https://www.facebook.com/twmakers
Discord 群: https://discord.gg/GPXbgqa






























Raspberry Pi Install Laravel php Nginx

安裝樹苺派的PHP+LARAVEL+NGINX

Install PHP 7.0

sudo apt install php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-mysql php7.0-opcache php7.0-xmlrpc php7.0-xml php7.0-fpm php7.0-zip php7.0-mbstring php7.0-sqlite3 php7.0-cli php7.0-readline -y


START php7.0-fpm

sudo systemctl enable php7.0-fpm
sudo service php7.0-fpm start


Install Composer

sudo apt-get install composer



Install NODEJS

sudo apt-get install npm


INSTALL NGINX

sudo apt-get install nginx


Create laravel

composer create-project laravel/laravel laravel –prefer-dist

sudo vi /etc/nginx/sites-enabled/default

################################
#root /var/www/html;
root /home/pi/laravel/public;

#Add index.php to the list if you are using PHP#index index.html index.htm index.nginx-debian.html;
index index.php index.html index.htm index.nginx-debian.html;
 
location ~ .php$ {
     include snippets/fastcgi-php.conf; 
     fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; 
}
location ~ /\.ht {             
    deny all;     
}

SETUP SERVICE

sudo service nginx restart
sudo systemctl enable nginx

打完收功