{"action":"created","issue":{"url":"https://api.github.com/repos/penyin/nothing/issues/1","labels_url":"https://api.github.com/repos/penyin/nothing/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/penyin/nothing/issues/1/comments","events_url":"https://api.github.com/repos/penyin/nothing/issues/1/events","html_url":"https://github.com/penyin/nothing/issues/1","id":99768230,"number":1,"title":"1. 樹莓派安裝 VNC","user":{"login":"penyin","id":515626,"avatar_url":"https://avatars.githubusercontent.com/u/515626?v=3","gravatar_id":"","url":"https://api.github.com/users/penyin","html_url":"https://github.com/penyin","followers_url":"https://api.github.com/users/penyin/followers","following_url":"https://api.github.com/users/penyin/following{/other_user}","gists_url":"https://api.github.com/users/penyin/gists{/gist_id}","starred_url":"https://api.github.com/users/penyin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penyin/subscriptions","organizations_url":"https://api.github.com/users/penyin/orgs","repos_url":"https://api.github.com/users/penyin/repos","events_url":"https://api.github.com/users/penyin/events{/privacy}","received_events_url":"https://api.github.com/users/penyin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-08T04:06:44Z","updated_at":"2015-08-08T09:18:26Z","closed_at":null,"body":"##### 樹莓派安裝時，請先開啟 ssh 連線\r\n\r\n##### 使用  ssh 遠端連線到樹莓派，網路很多種方法，我使用 windows 的 MobaXterm\r\nhttp://mobaxterm.mobatek.net/\r\n\r\n-- 使用 ssh 連線樹莓派後 --\r\n\r\n##### 安裝 tightvncserver\r\n```\r\nsudo apt-get install tightvncserver\r\n```\r\n \r\n##### 加入開機啟動 tightvncserver\r\n```\r\nsudo nano /etc/init.d/tightvncserver\r\n```\r\n\r\n```\r\n#!/bin/sh\r\n### BEGIN INIT INFO\r\n# Provides:          tightvncserver\r\n# Required-Start:    $local_fs\r\n# Required-Stop:     $local_fs\r\n# Default-Start:     2 3 4 5\r\n# Default-Stop:      0 1 6\r\n# Short-Description: Start/stop tightvncserver\r\n### END INIT INFO\r\n \r\n# More details see:\r\n# http://www.penguintutor.com/linux/tightvnc\r\n \r\n### Customize this entry\r\n# Set the USER variable to the name of the user to start tightvncserver under\r\nexport USER='pi'\r\n### End customization required\r\n \r\neval cd ~$USER\r\n \r\ncase \"$1\" in\r\n  start)\r\n    # 启动命令行。此处自定义分辨率、控制台号码或其它参数。\r\n    su $USER -c '/usr/bin/tightvncserver -depth 16 -geometry 800x600 :1'\r\n    echo \"Starting TightVNC server for $USER \"\r\n    ;;\r\n  stop)\r\n    # 终止命令行。此处控制台号码与启动一致。\r\n    su $USER -c '/usr/bin/tightvncserver -kill :1'\r\n    echo \"Tightvncserver stopped\"\r\n    ;;\r\n  *)\r\n    echo \"Usage: /etc/init.d/tightvncserver {start|stop}\"\r\n    exit 1\r\n    ;;\r\nesac\r\nexit 0\r\n```\r\n \r\n##### 改變檔案權限\r\n```\r\nsudo chmod 755 /etc/init.d/tightvncserver\r\n```\r\n \r\n##### 加入開機程序\r\n```\r\nsudo update-rc.d tightvncserver defaults\r\n```\r\n \r\n##### 修改 VNC 連線密碼\r\n```\r\nUsing password file /home/pi/.vnc/passwd\r\nPassword: \r\nVerify:   \r\nWould you like to enter a view-only password (y/n)? n\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/penyin/nothing/issues/comments/128943379","html_url":"https://github.com/penyin/nothing/issues/1#issuecomment-128943379","issue_url":"https://api.github.com/repos/penyin/nothing/issues/1","id":128943379,"user":{"login":"penyin","id":515626,"avatar_url":"https://avatars.githubusercontent.com/u/515626?v=3","gravatar_id":"","url":"https://api.github.com/users/penyin","html_url":"https://github.com/penyin","followers_url":"https://api.github.com/users/penyin/followers","following_url":"https://api.github.com/users/penyin/following{/other_user}","gists_url":"https://api.github.com/users/penyin/gists{/gist_id}","starred_url":"https://api.github.com/users/penyin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/penyin/subscriptions","organizations_url":"https://api.github.com/users/penyin/orgs","repos_url":"https://api.github.com/users/penyin/repos","events_url":"https://api.github.com/users/penyin/events{/privacy}","received_events_url":"https://api.github.com/users/penyin/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T09:18:26Z","updated_at":"2015-08-08T09:18:26Z","body":"#### 利用 vnc 連線過去會遇到建立檔案跟建立目錄會有錯誤解決辦法\r\n```\r\nError: No space left on device\r\n```\r\n\r\n##### 可使用 Terminal 先建立目錄\r\n```\r\nsudo mkdir xxxx\r\n```\r\n\r\n##### 在改變目錄所有權人\r\n```\r\nsudo chown -R pi:pi directory\r\n```"}}