2018年5月2日 星期三

Make live USB under Linux


sudo dd bs=4M if=/path/to/antergos-x86_64.iso of=/dev/sdX status=progress && sync

Refer from
https://antergos.com/wiki/zh-tw/uncategorized/create-a-working-live-usb/


2016年12月27日 星期二

Python 大雜會



Pivy 可在寫Python在手機上執行
https://newtoypia.blogspot.com/2015/07/kivy.html

2015年12月14日 星期一

列印中斷的物件 如何接續著印

列印中斷的物件 如何接續著印

1. 先找出可以被中斷的那一層, 假設可能停止在第19層 (LAYER 18)


2. 開啟 gcode 檔, 搜尋 LAYER:18.  其Z軸高度為5.7
也可以將上下層也先抄下來
LAYER 17 為5.4
LAYER 19 為6.0











3. 試著移動擠出頭確認高度,
輸入gcode "G1 F5000 Z8.7", 將擠出頭移動到5.7 上方3mm. 再慢慢往下移動到5.7.
避免算錯讓擠出頭撞進物件. 如果高度正確, 應該會很貼合物件但留有一點點擠出空間.











4. 產生LAYER18 以後的gcode
將原來的檔案複製一份出來改. 有五個步驟
a. 移除不要的gcode (LAYER0~LAYER17), 從LAYER18 開始
b. "G28 Z0"  改成  "G28 Z5.7"
c. "G1 Z15.0 F6000" 改成 "G1 Z22.70 F6000"   停在開始列印處上方的15mm處
d. "G1 F200 E3"  改成  "G1 F200 E15"   先空中預擠多一些, 因為沒有平面可以預擠
e. "G92 E0 " 改成   "G92 E3188.91871"   擠出馬達的位置重設成跟LAYER18  一樣











續印的gcode 完成了. LAYER如果抓得準. 應該可以續印的不錯.














2014年10月6日 星期一

How to search a keyword in a folder

$ grep -rl "string" /someone_folder

2013年10月31日 星期四

Provide a sftp account but disable it's SSH access for a team member

[Target]
1. Using user 'sftp-user'
2. Store files on folder '/sftp-folder'
3. Allow a team member to access it
4. Using RSA public key for access control

[Step]
1. Prepare account 'sftp-user' and folder '/sftp-folder'
   Create a user 'sftp-user'
   Create a folder 'sftp-folder' on /
   Change the folder owner to root; 'chown root /sftp-folder'

2. Modify SSHd setting, edit /etc/ssh/sshd_config

  sudo vi /etc/ssh/sshd_config

================================================================
#Subsystem sftp /usr/lib/openssh/sftp-server
Subsystem sftp internal-sftp

Match user sftp_user
  ChrootDirectory /sftp_folder
  AllowTcpForwarding no
  X11Forwarding no
  ForceCommand internal-sftp
=================================================================

3. To disable SSH for sftp-user
Modify /etc/passwd, change account 'sftp-user' shell program to /bin/false from /bin/bash

  sudo vi /etc/passwd

4. Edit permission list
Add RSA public keys to /home/sftp-user/.ssh/authorized_key

5. restart SSHd

  sudo /etc/init.d/ssh restart

[TEST]
You can generate a RSA public key on someone Linux, and provide it to sftp administrator.
After your key added to sftp-user's authorized_key file, you can using sftp to connect 'sftp-user' account

  sftp sftp-user@somehome.com

2013年4月29日 星期一

How to enable AHCI mode when your Windows 7 is installed ready


1. Download AHCI driver

    For example, Using Intel chip-set, need to download
    1) ACHI driver for your OS and 64/32bit
    2) Intel RST utility.

2. Execute 'regedit' and change parameter "Start" to 0 in as follow resgiter

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Msahci

3. Install AHCI driver under safe mode

    1) Reboot your PC, and enter safe mode
    2) Open device manager and IDE controller
    3) Update Controller driver by manual select, to focus to install AHCI driver for your chip-set.
    4) Reboot your PC

4. Install RST utility

    To install Intel RST. If find RST doesn't execute after installed, to check Inter RST on service manager.

2013年1月10日 星期四

How replace old 'master' branch with new 'master' branch

Sometime, the master's commits was arranged with 'rebase' and the master branch has new commits.
How to update commits of new master branch to remote repository's master branch

  $ git push --force origin master

If the arranged branch isn't 'master', need to rename 'master' to other name, like 'old_master',
than rename arranged branch to 'master', and push with --force parameter.

  $ git branch -m master old_master
  $ git branch -m new_master master
  $ git push --force origin master