2018年1月9日

scratch2 無法輸入中文?

scratch 2.0 之前成功安裝在 Ubuntu 10.04 的 PlayOnLinux 下, wine 版本用 1.7.5,可以正確運做無誤。

但發現在 sprite 和 stage backdrop 下都不能輸入中文。經網搜之後, 看到以下文章修改的 Scratch.swf (下載)。

將此 Scratch.swf 替換掉原來安裝好的, 字型要選Donegal, 這樣就可以了... :)

==引原文==

source: http://wdpsestea.blogspot.tw/2017/05/scratch2.html

2018年1月8日

ubuntu 10.04 聲音沒了

下指令, 重新 alsa 啟動音效裝置

sudo /sbin/alsa force-reload

2018年1月5日

如何修改SSH預設的22連接埠改走其他Port?

refer to: https://coder.tw/?p=5020
1.登入你的主機,然後進入到【/etc/ssh】資料夾。
指令:
cd /etc/ssh

2.開啟sshd_config這個設定擋。
指令:

vi sshd_config

3.應該是在蠻上面的地方,會有一行【Port 22】,把22改成其他你想使用的連接埠就可以了,需要注意的是80、20、21、25等連接埠可能有其他服務使用,要改成沒有服務使用的Port才能。
將Port改好之後,記得要把該行前方的#號拿掉,不然SSH的程式讀不到這行設定

4.把【sshd_config】這個設定擋存好,然後重新啟動sshd這個服務。
指令:

service sshd restart

5.之後你要進行ssh連線就不能再走預設的22Port囉~ 要改走你剛剛設定的port,
例如:

ssh -p 55 xxx@127.1.1.1



2017年11月3日

dpkg:無可挽回的致命錯誤,中止操作 ubuntu 10.04 lucid

很久沒新裝套件, 但在 ubuntu 10.04 停止長期支援 LTS 後, 竟然無法使用 synaptic, 用指令模式也出現錯誤如下。查了很久, 也試了很多, 都失敗... 終於在這一篇找到解決問題的方法 (see ubuntu forum)

簡單地說, 把 /var/lib/dpkg/status 這個檔備份後, 再編輯此檔。
尋找造成錯誤的套件, 以此例來說, 就是 `nmap' 套件

Package: nmap
Status: install ok installed
Priority: extra
Section: net
Installed-Size: 6232

... (以下略)

把這個和 nmap 段落相關的刪除, 再重新執行 sudo apt-get upgrade 即可。

==原本的錯誤==

sudo apt-get upgrade
[sudo] password for yinung:
正在讀取套件清單... 完成
正在重建相依關係         
正在讀取狀態資料... 完成
下列套件將會被升級:
  xxxxx xxxx-doc
升級 2 個,新安裝 0 個,移除 0 個,有 0 個未被升級。
需要下載 0B/32.0MB 的套件檔。
此操作完成之後,會多佔用 17.3MB 的磁碟空間。
是否繼續進行 [Y/n]?Y
(正在讀取資料庫 ...
dpkg: warning: files list file for package `antiword' missing, assuming package has no files currently installed.

dpkg: warning: files list file for package `libiw29' missing, assuming package has no files currently installed.

dpkg: warning: files list file for package `ttf-cwtex-center-cwkai' missing, assuming package has no files currently installed.
(正在讀取資料庫 ... 95%dpkg:無可挽回的致命錯誤,中止操作:

 buffer_read(fd) 失敗:套件 `nmap' 的檔案列表檔: 輸入/輸出錯誤
E: Sub-process /usr/bin/dpkg returned an error code (2)


===解決方法原文===

1. Go into the /var/lib/dpkg directory
2. Make a backup of the "status" file
3. Edit the "status" file
4. Search the package that gave the error
5. Just delete the lines from this package (but let all other lines that concern other packages even if they contains the broken package in their "Replaces" or "Depends" fields)



在 playonlinux 4.2.1 下裝 firefox 56.0.2 (32 位元) 的問題

或許會有人有相同的問題, 紀錄如下:

我在 ubuntu 10.02 裡, 使用預設方式在 playonlinux 4.2.1 下使用 wine 2.18 (2.0.1 好像失敗) 裝 firefox 56.0.2 (32 位元), 第一次啟動很正常, :), 但第二次就沒有畫面了, google 了很久, 終於看到有人提出解決方法

只要在 firefox 網址列, 輸入
about:config

然後找到
browser.tabs.remote.autostart2

把它的值, 從 true 改成 false 即可 (滑鼠按2下)

原文:
The fix involves browsing to about:config and setting browser.tabs.remote.autostart2 to false. They mention setting browser.tabs.remote.autostart to false as well, but mine was already set.

參考
https://bbs.archlinux.org/viewtopic.php?id=223335
https://bugs.winehq.org/show_bug.cgi?id=42388

2017年10月13日

重新啟動音效卡指令 (ubuntu 10.04)

在 ubuntu 10.04 下, 如果突然沒有聲音了, 可重新啟動音效卡指令

sudo /sbin/alsa force-reload

2017年7月12日

用 google app script 在 google 產生 google Form

javascript 語法: https://www.w3schools.com/js/default.asp
google app script: https://developers.google.com/apps-script/guides/sheets/functions
範例來自: http://dsernst.com/2015/07/16/how-to-make-programmatic-google-forms/
從 spreadsheet 抓資料


function getSpreadsheetData(sheetName) {
  // This function gives you an array of objects modeling a worksheet's tabular data, where the first items — column headers — become the property names.
  var arrayOfArrays = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName || 'Sheet1').getDataRange().getValues();
  var headers = arrayOfArrays.shift();
  return arrayOfArrays.map(function (row) {
    return row.reduce(function (memo, value, index) {
      if (value) {
        memo[headers[index]] = value;
      }
      return memo;
    }, {});
  });
}