[moodle]安裝

在raspberry pi3+ 上安裝moodle
版本3.6.6 目前最新版是3.7.2(不建議,會出現不是arm64的問題,raspberry是armhf (arm hard float) )
安裝過程中會出現缺少php的某些套件,就用apt install php-* 去安裝特定的套件。

出現一些資料庫錯誤的訊息
參考:https://www.itread01.com/p/1112844.html
參考:小白球 http://dq.tieba.com/p/5427154820?lp=5028&mo_device=1&is_jingpost=0
進入linux系統,下mysql -u root -p指令
SET GLOBAL innodb_file_format=Barracuda;
SET innodb_file_per_table = ON;
SET GLOBAL innodb_large_prefix = ON;

【批次新增使用者】
檔案中的每一行只能包含一筆記錄
每筆記錄都是一系列以逗號分隔的資料
檔案的第一條記錄很特殊,它包含著欄位名稱的列表。這定義了檔案中剩下部分的格式。
必需的欄位名:這些欄位名必須包含在第一條記錄中,並且每個用戶都需要有。

username, password, firstname, lastname, email
預設的欄位名:這些是可選的——如果並未包含它們,則會使用主管理員的值作為預設值。

使用者資料匯入後,當使用者第一次登入時系統會要求更改密碼,如要取消得去設定資料表user_preferences
每個使用者auth_forcepasswordchange的值
update mdl_user_preferences set value=0 WHERE name='auth_forcepasswordchange' and (userid>=3 and userid<=19)
 

【批次新增題庫】
先建好題目的分類
匯入時選擇使用Aiken 格式
請使用純文字編輯器編寫,編碼使用UTF-8碼(檔首無BOM)。
每一試題,題幹之前"不加題號"(匯入Moodle後會自動加上題號)。在各試題之間"插入一空行",使形成段落,將試題隔開。
題幹內容不管有多長,都必須放在同一行上,中間不可使用換行標籤(在匯入Moodle後會依螢幕大小自動換行)。
每一選項都以大寫英文字母A,B,C,D當做選項的標號,緊接一個英文句點"." 或一個右括號 ")" 然後再"空一格",最後面才是選項內容
正確答案必須緊接放在最後一個選項之下,並以大寫 "ANSWER:" 開頭( : 用英文字型),"空一格",然後加上代表正確答案的大寫英文字母。

範例
What is the correct answer to this question?
A) Is it this one?
B) Maybe this answer?
C) Possibly this one?
D) Must be this one!
ANSWER: D

資料庫配置
使用者user
題庫question
測驗quiz

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

[scratch]scratch3 讀取 open data

參考網址:

transformer可以做為scratch與open data的中介程式,
但transformer的授權方式較為保守,必需註冊才能使用。

在網路上找到了WFduino
這個程式開放多了,而且是scratch 3的界面
宜蘭縣就提供這個程式給大家使用http://wfduino.ilc.edu.tw/
只可惜目前還在測試版的狀態

竹林資訊站有相關的訊息
http://blog.ilc.edu.tw/blog/blog/868/post/113127/750388

PM2 5自動監測警示系統(scratch3)
http://blog.ilc.edu.tw/blog/blog/868/post/113115/778553

發表於 軟體使用 | 發表迴響

[scratch]宇宙機器人

參考網址:https://www.kodorobot.com

Transformer former 下載

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

scratch 3 轉換成 exe檔

參考網址:
 

Project HTMLifier

Convert a Scratch project to HTML

 

Scratch 3.0文件SB3转exe可执行文件

https://nwjs.io/ 下载稳定版压缩包, 目前版本nwjs-v0.39.3-win-x64.zip. 解压后,把之前下载的project.html移动到这个解压后的目录。并在该目录下建立一个icon.png图标文件,以及配置文件package.json文件,其json内容示例:项目名字,主程序文件,图标。

{

"name": "CrazyBall",

"main": "project.html",

"icons": { "16": "icon.png"}

}

 

双击运行nw.exe,就可以打开sb3转换成的exe可执行文件了。

 

http://revocue.cz/en/make-sfx/index.php 下载makesfx.exe,可以把nw.exe所在目录所有的文件制作成一个exe文件,可以定制文件名和图标。

發表於 軟體使用 | 發表迴響

[rasp]為rasp加入USB硬碟

參考網址:
替 Linux 新增硬碟(磁碟分割、格式化與掛載)

如何在Linux跟Raspberry Pi上掛載USB硬碟

fdisk /dev/sdb

mkfs -t ext4 /dev/sda2

/etc/fstab
/dev/sda2 /usb/uc       ext4    defaults        0       2

發表於 Linux系統 | 發表迴響

[rasp]Debian 8~10 (jessie~buster) 安裝筆記 Firefox 與 Iceweasel

參考網址:http://rocksaying.tw/archives/44330768.html

2019-07-15 Debian 10 更新內容。Firefox 的商標問題解套了,所以 Debian 重新將 Firefox 瀏覽器納入主要套件清單,套件名稱為 firefox-esr 。

發表於 Linux系統 | 發表迴響

ubuntu PAE 支援

參考網址:https://forum.ubuntu.org.cn/viewtopic.php?t=461162

ERROR: PAE is disabled on this Pentium M

14.04版安装时选择“安装ubuntu”后错误提示:
ERROR: PAE is disabled on this Pentium M
( PAE can potentially be enabled with kernel parameter " forcepae " – this is unsupported, may cause unknown problems, and will taint the kernel )
This kernel requires the following features not present on the CPU: pae
Unable to boot – please use a kernel appropriate for your CPU

这个出错信息表明你的CPU不支持PAE扩展。 
PAE技术可以让32位的CPU识别大于4GB,但小于64GB的内存。在奔腾 Pro以后的所有32位CPU都是支持PAE的,所以现在Ubuntu默认安装的时候,会去检查PAE是否有效。

PS.
Ubuntu 12.04及以后的版本都需要CPU支持PAE。

可以用一些方法解決 讓舊電腦風華再現


这个最简单,你懂的。
因为Ubuntu14.04 在安装的时候支持一个选项 forceape(意思就是强制忽略PAE检查),添上这个参数之后,就可以在你的奔腾M CPU上安装最新版的Ubuntu了。
启动你那个32位的Ubuntu 14.04安装盘,在第一个界面,就是那个紫色的,屏幕下方有个键盘图标和一个圈中小人的界面,按下键盘上的Tab键,这时会弹出一个选择语言的对话框,选则你想要的语言,并回车。
之后按F6,会有一个灰色的菜单出现,接着按什么键我忘了,要么是Esc,要么是e键,反正就是进入编辑,
原始的是

代码: 全选

Boot Options file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash --

只需在末尾处添加forepae即可。

代码: 全选

Boot Options file=/cdrom/preseed/ubuntu.seed boot=casper initrd=/casper/initrd.lz quiet splash -- forcepae

之后回车,就进入正常安装了。

發表於 Linux系統 | 發表迴響

[rasp]安裝teamviewer

參考網址:http://yhhuang1966.blogspot.com/2018/01/teamviewer_98.html

問題會出在開機時無法自動啟動teamviewer

https://www.itread01.com/content/1549899921.html
https://www.itread01.com/content/1549454056.html

試著將teamviewer放在rc.local或init.d
都法正常啟動teamviewer

樹梅派RaspberryPi2 安裝 TeamViewer 由外網遠端連線控制

樹莓派開機自動執行程式
How To Autostart Apps In Rasbian LXDE Desktop
 

sudo nano /etc/xdg/lxsession/LXDE-pi/autostart

 

After the last line add a line for each application you wish to autorun. For example if I add lines for LXTerminal and Leafpad my file looks like this :

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@lxterminal
@leafpad
@xscreensaver -no-splash@

 

@lxterminal -e teamviewer

 

树莓派3-b 自动登录autologin
以root身份自动登录
vim /lib/systemd/system/getty@.service
修改 ExecStart=-/sbin/agetty –noclear %I $TERM为 ExecStart=-/sbin/agetty –noclear -a root %I $TERM
改好了似乎沒用

Raspberry Pi auto login
/usr/bin/raspi-config
if you search for "autologin" you find the commands to change that
and you will see that part of it is changes in
/etc/lightdm/lightdm.conf with the USER NAME
( correct you talk about this problem of yours?? that you are not user "pi" )
that file is to be edit by windows only via putty ssh / login / sudo nano /etc/lightdm/lightdm.conf
改好了似乎沒用,純參考

 

以上方法仍不可行

解除安裝
dpkg -r teamviewer-host
dpkg -P teamviewer-host 連設定檔也移除

安裝
先下載https://www.teamviewer.com/tw/download/linux/
teamviewer-host_14.5.5819_armhf.deb
dpkg -i teamviewer-host_14.5.5819_armhf.deb
會出現相依性錯誤
apt-get install -f  修正錯誤
teamviewer help 查看相關指令
teamviewer info 可以看到ID等相關訊息
teamviewer setup 設定要加入哪個管理帳號
teamviewer passwd ******* 設定密碼

測試結果:
rasp4 需要接螢幕才會執行開機自動登入pi ,teamviewer 的桌面程式才會開啟,遠端才能登入。
rasp3 不需接螢幕就可以連線

rasp4不需外接螢幕也啟動HDMI的設定方法:
/boot/config.txt 把hdmi_force_hotplug=1前的#拿掉

# uncomment if hdmi display is not detected and composite is being output
hdmi_force_hotplug=1

更新
下載teamviewer-host_15.10.5_armhf.deb
dpkg -i teamviewer-host_15.10.5_armhf.deb

 

 

發表於 Linux系統 | 發表迴響

[rasp]phpmyadmin 錯誤mysqli_real_connect(): (HY000/1045): Access denied for user ‘phpmyadmin’@’localhost’ (using password: YES)

參考網址:www.bos.tw

mysqli_real_connect(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: YES)

使用配置文件中定義的控制用戶連接失敗

1、打開phpmyadmin文件夾下面的config.inc.php文件並打開,找到

1

2

$cfg[‘Servers’][$i][‘controluser’] = 'pma';

$cfg[‘Servers’][$i][‘controlpass’] = '';

將其註解掉並改成你的資料庫用戶和密碼,存檔

1

2

$cfg[‘Servers’][$i][‘controluser’] = 'root';  <—- 自己資料庫的用戶名稱

$cfg[‘Servers’][$i][‘controlpass’] = '123456';  <—- 自己資料庫的用戶密碼

 

上個方法似乎無效
mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: YES)

https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7
在mysql資料庫中建立phpmyadmin使用者
 

1. Connect to mysql

sudo mysql --user=root mysql -p

2. Create a user for phpMyAdmin

Run the following commands (replacing some_pass by the desired password):

CREATE USER 'phpmyadmin'@'localhost' IDENTIFIED BY 'some_pass';
GRANT ALL PRIVILEGES ON *.* TO 'phpmyadmin'@'localhost' WITH GRANT OPTION;
FLUSH PRIVILEGES;
發表於 Linux系統 | 發表迴響

xoops campus 移機

參考網址:https://campus-xoops.tn.edu.tw/modules/tad_book3/page.php?tbdsn=1090

https://dchesmis.blogspot.com/2016/09/xoops.html

/var/www/html/campus/mainfile.php
define('XOOPS_URL', 'http://192.168.1.3/campus');

資料庫tad_themes bg_img欄位
http://192.168.1.3/campus/uploads/tad_themes/school2015/bg/dot.jpg

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