文章目錄
  1. 1. OSX
    1. 1.1. 設定Automator定期備份Workspace、右鍵拷貝
    2. 1.2. CentOS bootable USB
    3. 1.3. 設定apache
    4. 1.4. 使用mac備份iphone
    5. 1.5. iTerm2
    6. 1.6. 設定vim會highlight syntax
    7. 1.7. Software
  2. 2. Heroku
    1. 2.1. deploy
  3. 3. Git
    1. 3.1. 設定.gitignore_global
    2. 3.2. 將現有專案push上gihub.com
    3. 3.3. git diff 比較兩個commit的差異
    4. 3.4. git pull 後, 回復到前版次
    5. 3.5. 修改commit說明文字
  4. 4. Maven
  5. 5. Atom
  6. 6. Sublime
  7. 7. Eclipse
    1. 7.1. eclipse-dark-theme-project-explore-black-text
      1. 7.1.1. solution 1
      2. 7.1.2. solution 2
    2. 7.2. Maven設定
    3. 7.3. icon定義
  8. 8. Chrome
  9. 9. hexo
    1. 9.1. 報錯[Error: Module version mismatch. Expected 14, got 46.]
    2. 9.2. npm install卡在node-gyp rebuild
    3. 9.3. deploy前置設定
    4. 9.4. Reference

OSX

設定Automator定期備份Workspace、右鍵拷貝

CentOS bootable USB

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ diskutil list
/dev/disk0
#: TYPE NAME SIZE IDENTIFIER
0: GUID_partition_scheme *500.1 GB disk0
1: EFI EFI 209.7 MB disk0s1
2: Apple_HFS Macintosh HD 419.0 GB disk0s2
3: Apple_Boot Recovery HD 650.0 MB disk0s3
4: Microsoft Basic Data 80.2 GB disk0s4
/dev/disk1
#: TYPE NAME SIZE IDENTIFIER
0: FDisk_partition_scheme *8.1 GB disk1
1: DOS_FAT_32 NO NAME 8.1 GB disk1s1
$ diskutil unmountDisk /dev/disk1
Unmount of all volumes on disk1 was successful
$ sudo dd if=CentOS-7-x86_64-DVD-1503-01.iso of=/dev/disk1
8419328+0 records in
8419328+0 records out
4310695936 bytes transferred in 11507.233801 secs (374607 bytes/sec)

設定apache

Setting up a local web server on OS

sudo launchctl load -w /System/Library/LaunchDaemons/org.apache.httpd.plist
sudo /usr/sbin/apachectl restart

1
2
3
$ grep DocumentRoot /etc/apache2/httpd.conf
# DocumentRoot: The directory out of which you will serve your
DocumentRoot "/Library/WebServer/Documents"

1
2
3
4
5
6
$ pwd
$ grep ErrorLog /etc/apache2/httpd.conf
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive w
-rw-r--r-- 1 root wheel 903123088 10 25 20:39 access_log
-rw-r--r-- 1 root wheel 3208194 10 25 20:38 error_log

使用mac備份iphone

  1. mac接上iphone後會自行啟動『照片』這個應用程式
  2. 輸入->輸入所有新照片
  3. 相片->選取要輸出的照片影片
  4. 檔案->輸出->輸出…原始未修改檔
  5. 輸出到Synology上的 _待整理

iTerm2

設定vim會highlight syntax

1
2
3
4
5
6
$ vi ~/.vimrc

(add configuration)

filetype plugin indent on
syntax on

Software

  • tldr 可用來查某個command的使用範例

  • CyberDuck

  • MenuMeter

  • HandBrake is a tool for converting video from nearly any format to a selection of modern, widely supported codecs.
  • Keka
    官網
  • ec2
    $ chmod 400 ~/.ssh/dvp.pem
    alias sshec2=’ssh -i ~/.ssh/dvp.pem ec2-user@52.26.138.212’
  • 嘸蝦米輸入法
    直接安裝bin檔
  • homebrew - The missing package manager for OS X
    安裝套件都放在/usr/local/Cellar底下
  • Homebrew Cask extends Homebrew and brings its elegance, simplicity, and speed to OS X applications and large binaries alike. It only takes 1 line in your shell to reach 2835 Casks maintained by 434 contributors.
  • XtraFinder - 補強Finder功能
  • QLMarkdown is a simple QuickLook generator for Markdown files.
  • DiffMerge
  • MPlayerX
  • Sublime
  • PhotoScape X
  • Sublime Text 3 新手上路:必要的安裝、設定與基本使用教學
  • 內建便條紙的用法
  • gTask Pro NT$90買的

Heroku

deploy

  1. Download Heroku Toolbelt
  2. $ heroku login
  3. $ heroku git:clone -a stark-everglades-8527
  4. $ git push heroku master

Git

git help連結

A successful Git branching model
A successful Git branching modelA successful Git branching model

設定.gitignore_global

git config –global core.excludesfile ~/.gitignore_global

1
2
3
4
5
6
7
8
9
10
11
12
13
14
10:39 $ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Untracked files:
(use "git add <file>..." to include in what will be committed)

.idea/
lab-android-studio.iml
pichannelur/pichannelur.iml
pichannelvr/pichannelvr.iml

nothing added to commit but untracked files present (use "git add" to track)
✔ ~/Workspace/lab-android-studio [master|…11]
1
2
3
10:43 $ git config --global -l
fatal: unable to read config file '/Users/Hamn/.gitconfig': No such file or directory
✘-128 ~/Workspace/lab-android-studio [master|…11]
1
2
10:43 $ git config --global core.excludesfile ~/.gitignore_global
✔ ~/Workspace/lab-android-studio [master|✔]
1
2
3
10:44 $ git config --global -l
core.excludesfile=/Users/Hamn/.gitignore_global
✔ ~/Workspace/lab-android-studio [master|✔]
1
2
3
4
5
6
10:44 $ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean
✔ ~/Workspace/lab-android-studio [master|✔]

將現有專案push上gihub.com

  1. 於github.com建立repository
  2. 於專案目錄下:
    1. git init
    2. git add -A
    3. git commit -m “init”
    4. git remote add origin {github.com上repository的HTTPS clone URL}
    5. git push -u origin master

      若是要把remote端的repo覆蓋掉,使用git push origin --mirror

1
2
3
4
5
6
7
8
9
$ git push -u origin master
Counting objects: 421, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (387/387), done.
Writing objects: 100% (421/421), 31.74 MiB | 190.00 KiB/s, done.
Total 421 (delta 42), reused 0 (delta 0)
To git@github.com:hamn07/pichannel.web.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.
  1. git status
    1
    2
    3
    4
    5
    $ git status
    On branch master
    Your branch is up-to-date with 'origin/master'.

    nothing to commit, working directory clean
  1. github.com的repository有檔案,Done.

git diff 比較兩個commit的差異

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
>
>
D:\dvp\workspace\hamn07.github.io [master]> git show --pretty=fuller
commit ad92f1e68a0c2b10f9d72307b7ab4299c475c1d3
Merge: 3c038a1 8865490
Author: hamn07 <hamn07@gmail.com>
AuthorDate: Tue Jul 21 13:58:09 2015 +0800
Commit: hamn07 <hamn07@gmail.com>
CommitDate: Tue Jul 21 13:58:09 2015 +0800

Merge branch 'master' of github.com:hamn07/src.hamn07.github.io
>
>
D:\dvp\workspace\hamn07.github.io [master]> git diff 3c038a1 8865490
diff --git a/_config.yml b/_config.yml
index 626a0bb..a092632 100644
--- a/_config.yml
+++ b/_config.yml
@@ -63,6 +63,7 @@ pagination_dir: page
# Extensions
## Plugins: http://hexo.io/plugins/
## Themes: http://hexo.io/themes/
+#theme: landscape
#theme: phase
theme: tranquilpeak

git pull 後, 回復到前版次

1
2
3
4
5
6
$ git reflog
4afe7c0 HEAD@{0}: pull: Fast-forward
1bcd64b HEAD@{1}: pull: Fast-forward
65ce0d2 HEAD@{2}: clone: from https://github.com/iissnan/hexo-theme-next
$ git reset --hard 65ce0d2
HEAD is now at 65ce0d2 Merge pull request #418 from Acris/master

修改commit說明文字

git commit --amend

git commit --amend -m "說明文字"

Maven

1
2
$ cat ~/.bash_profile | grep maven
export PATH="/Users/tomin.henrylee/Applications/apache-maven-3.3.3/bin:$PATH"
1
2
3
4
5
6
7
$ mvn -v
Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T19:57:37+08:00)
Maven home: /Users/tomin.henrylee/Applications/apache-maven-3.3.3
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre
Default locale: zh_TW, platform encoding: UTF-8
OS name: "mac os x", version: "10.11", arch: "x86_64", family: "mac"
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$ mvn archetype:generate -DgroupId=com.henry.webapp -DartifactId=maven-test -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> maven-archetype-plugin:2.4:generate (default-cli) > generate-sources @ standalone-pom >>>
[INFO]
[INFO] <<< maven-archetype-plugin:2.4:generate (default-cli) < generate-sources @ standalone-pom <<<
[INFO]
[INFO] --- maven-archetype-plugin:2.4:generate (default-cli) @ standalone-pom ---
[INFO] Generating project in Batch mode
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Old (1.x) Archetype: maven-archetype-quickstart:1.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: basedir, Value: /Users/tomin.henrylee/Workspace/temp
[INFO] Parameter: package, Value: com.henry.webapp
[INFO] Parameter: groupId, Value: com.henry.webapp
[INFO] Parameter: artifactId, Value: maven-test
[INFO] Parameter: packageName, Value: com.henry.webapp
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] project created from Old (1.x) Archetype in dir: /Users/tomin.henrylee/Workspace/temp/maven-test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.268 s
[INFO] Finished at: 2015-10-23T14:00:05+08:00
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ tree maven-test/
maven-test/
├── pom.xml
└── src
├── main
│   └── java
│   └── com
│   └── henry
│   └── webapp
│   └── App.java
└── test
└── java
└── com
└── henry
└── webapp
└── AppTest.java

11 directories, 3 files
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ cd maven-test/
$ cat pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.henry.webapp</groupId>
<artifactId>maven-test</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>maven-test</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
$ mvn package
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building maven-test 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ maven-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/tomin.henrylee/Workspace/temp/maven-test/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ maven-test ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ maven-test ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/tomin.henrylee/Workspace/temp/maven-test/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ maven-test ---
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ maven-test ---
[INFO] Surefire report directory: /Users/tomin.henrylee/Workspace/temp/maven-test/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.henry.webapp.AppTest
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.004 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ maven-test ---
[INFO] Building jar: /Users/tomin.henrylee/Workspace/temp/maven-test/target/maven-test-1.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.147 s
[INFO] Finished at: 2015-10-23T14:20:40+08:00
[INFO] Final Memory: 11M/220M
[INFO] ------------------------------------------------------------------------
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
$ tree .
.
├── pom.xml
├── src
│   ├── main
│   │   └── java
│   │   └── com
│   │   └── henry
│   │   └── webapp
│   │   └── App.java
│   └── test
│   └── java
│   └── com
│   └── henry
│   └── webapp
│   └── AppTest.java
└── target
├── classes
│   └── com
│   └── henry
│   └── webapp
│   └── App.class
├── maven-archiver
│   └── pom.properties
├── maven-status
│   └── maven-compiler-plugin
│   ├── compile
│   │   └── default-compile
│   │   ├── createdFiles.lst
│   │   └── inputFiles.lst
│   └── testCompile
│   └── default-testCompile
│   ├── createdFiles.lst
│   └── inputFiles.lst
├── maven-test-1.0-SNAPSHOT.jar
├── surefire-reports
│   ├── TEST-com.henry.webapp.AppTest.xml
│   └── com.henry.webapp.AppTest.txt
└── test-classes
└── com
└── henry
└── webapp
└── AppTest.class

28 directories, 13 files

Maven by Example
How to enable index downloads in Eclipse for Maven search?
Maven – Maven in 5 Minutes
How do I prevent “[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!”

Atom

  • Seti
    -

Sublime

  • 修改編輯器字型

Preferences/Settings - User

Eclipse

  • CDT
  • Arduino plugin nightly-osx
  • Log Viewer
  • SQL Development Tool
  • Eclipse Color Theme
  • Eclipse Moonrise UI Theme

  • ModelGoon UML4Java
  • Gradle IDE package 3.6.x

eclipse-dark-theme-project-explore-black-text

solution 1

  1. export original preference setting

  2. import fixed-preference setting

solution 2


How to change the background color for changed files in eclipse project explorer?

Maven設定

icon定義

Eclipse JDT icon

Chrome

Insomnia
postman
better google tasks

hexo

報錯[Error: Module version mismatch. Expected 14, got 46.]

1
2
3
4
5
6
7
8
9
10
11
12
13
14
✔ ~/Workspace/src.hamn07.github.io [master|✔]
13:08 $ hexo --version
[Error: Module version mismatch. Expected 14, got 46.]
{ [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
hexo: 3.1.1
os: Darwin 15.0.0 darwin x64
http_parser: 2.3
node: 0.12.7
v8: 3.28.71.19
uv: 1.6.1
zlib: 1.2.8
modules: 14
openssl: 1.0.1p

Workaround

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
13:08 $ npm install hexo --no-optional
hexo@3.1.1 node_modules/hexo
├── hexo-front-matter@0.2.2
├── pretty-hrtime@1.0.1
├── abbrev@1.0.7
├── archy@1.0.0
├── titlecase@1.0.2
├── text-table@0.2.0
├── tildify@1.1.2 (os-homedir@1.0.1)
├── strip-indent@1.0.1 (get-stdin@4.0.1)
├── hexo-i18n@0.2.1 (sprintf-js@1.0.3)
├── chalk@1.1.1 (escape-string-regexp@1.0.3, supports-color@2.0.0, ansi-styles@2.1.0, has-ansi@2.0.0, strip-ansi@3.0.0)
├── minimatch@2.0.10 (brace-expansion@1.1.1)
├── bunyan@1.5.1
├── through2@1.1.1 (xtend@4.0.0, readable-stream@1.1.13)
├── swig-extras@0.0.1 (markdown@0.5.0)
├── bluebird@2.10.2
├── js-yaml@3.4.3 (esprima@2.6.0, argparse@1.0.2)
├── cheerio@0.19.0 (entities@1.1.1, dom-serializer@0.1.0, css-select@1.0.0, htmlparser2@3.8.3)
├── warehouse@1.0.3 (graceful-fs@4.1.2, cuid@1.2.5, JSONStream@1.0.6)
├── nunjucks@1.3.4 (optimist@0.6.1, chokidar@0.12.6)
├── hexo-cli@0.1.8 (minimist@1.2.0)
├── hexo-fs@0.1.4 (escape-string-regexp@1.0.3, graceful-fs@4.1.2, chokidar@1.2.0)
├── hexo-util@0.1.7 (ent@2.2.0, highlight.js@8.8.0)
├── moment-timezone@0.3.1
├── lodash@3.10.1
├── moment@2.10.6
└── swig@1.4.2 (optimist@0.6.1, uglify-js@2.4.24)

13:09 $ hexo server &
[1] 3911
✔ ~/Workspace/src.hamn07.github.io [master|✔]
13:09 $ INFO Hexo is running at http://0.0.0.0:4000/. Press Ctrl+C to stop.

13:14 $ ps
PID TTY TIME CMD
596 ttys000 0:01.23 -bash
3911 ttys000 0:24.76 hexo

13:14 $ kill 3911
[1]+ Terminated: 15 hexo server

npm install卡在node-gyp rebuild

Workaround:
1.安裝nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.28.0/install.sh | bash

2.更新npm

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
08:58 $ nvm list
-> system
node -> stable (-> N/A) (default)
iojs -> N/A (default)
✔ ~
08:58 $ nvm install stable
######################################################################## 100.0%
WARNING: checksums are currently disabled for node.js v4.0 and later
Now using node v4.1.2 (npm v2.14.4)
✔ ~
09:00 $ nvm ls
-> v4.1.2
system
node -> stable (-> v4.1.2) (default)
stable -> 4.1 (-> v4.1.2) (default)
iojs -> N/A (default)

deploy前置設定

npm install hexo-toc --save
npm install hexo-deployer-git --save

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$ hexo d
INFO Deploying: git
INFO Clearing .deploy folder...
INFO Copying files from public folder...
On branch master
nothing to commit, working directory clean
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
FATAL Something wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

at ChildProcess.<anonymous> (/Users/Hamn/Workspace/src.hamn07.github.io/node_modules/hexo-deployer-git/node_modules/hexo-util/lib/spawn.js:42:17)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

Workaround: add SSH keys to GitHub.com

Reference

lukang介紹Hexo系列文章

文章目錄
  1. 1. OSX
    1. 1.1. 設定Automator定期備份Workspace、右鍵拷貝
    2. 1.2. CentOS bootable USB
    3. 1.3. 設定apache
    4. 1.4. 使用mac備份iphone
    5. 1.5. iTerm2
    6. 1.6. 設定vim會highlight syntax
    7. 1.7. Software
  2. 2. Heroku
    1. 2.1. deploy
  3. 3. Git
    1. 3.1. 設定.gitignore_global
    2. 3.2. 將現有專案push上gihub.com
    3. 3.3. git diff 比較兩個commit的差異
    4. 3.4. git pull 後, 回復到前版次
    5. 3.5. 修改commit說明文字
  4. 4. Maven
  5. 5. Atom
  6. 6. Sublime
  7. 7. Eclipse
    1. 7.1. eclipse-dark-theme-project-explore-black-text
      1. 7.1.1. solution 1
      2. 7.1.2. solution 2
    2. 7.2. Maven設定
    3. 7.3. icon定義
  8. 8. Chrome
  9. 9. hexo
    1. 9.1. 報錯[Error: Module version mismatch. Expected 14, got 46.]
    2. 9.2. npm install卡在node-gyp rebuild
    3. 9.3. deploy前置設定
    4. 9.4. Reference