==============================================================
 ╔═╗    ╔╦╗      ╔═╗  ╔╦╗     ╔═╗                   ╔═══════╗
 ║ ║    ╚╩╝  ╔═══╝ ╚══╩╬╝ ╔═══╝ ╚═══╗  ╔════════╗  ╔╝ ╔═══╗ ║
 ║ ╚══════╗  ╚═══╗ ╔═══╝  ║ ╔═════╗ ║  ║ ╔════╗ ║  ║ ╔╝  ╔╝ ║
 ║ ╔══════╝  ╔═╗ ║ ║ ╔═╗  ╚═╝   ╔═╝ ║  ║ ║    ║ ║  ╚═╝  ╔╝ ╔╝
 ║ ╚══════╗  ║ ║ ║ ║ ║ ║     ╔══╝ ╔═╝  ║ ╚════╝ ║     ╔═╝ ╔╝
 ╚════════╝  ╚═╝ ╚═╝ ╚═╝     ╚════╝    ╚════════╝     ╚═══╝
==============================================================


== INDEX ==

## Mac ## * restart menu bar * F8~12 have error (Mission Control) * nfs mount server * multistage ssh * change Google Chrome font * change icons * permit ssh with X window * restart ssh daemon * enable super user * terminal color dark * download Xcode Command Line Tools * private file of Karabiner (KeyRemap4MacBook) * hide Application Dock icon * remove MobileBackups * time sync on Marvericks * change local hostname * input combining charactor * image cropping by terminal * check registered printer IP * right click drag in touch pad * back to page from address bar (Google Chrome) * UNIX_TIME <-> time conversion * install LATEX by Homebrew ## Linux ## * authorized_keys * check the version of RedHat * install sshd by apt get * add sudo user * Lunar Linux virtio setting * set Emacs key bind * hide desktop icons ## Zsh ## * zshall * conditional expressions * Globbing Flags * Glob Qualifiers * Parameter Expansion Flags * error at complementation (Tab key) ## Git ## * add submodule * rm submodule * update submodule * replace submodule * change submodule position * add new repository on GitHub * clone new repository from GitHub * conflict error * do not open editor at merge * install git under home * check tracked files * recover removed file * rebase brew Formula * add new repository to private git server * remove file from all history * download tag from remote repository * change remote repository URL ## Vim ## * install vim with lua under HOME dir (Linux) * install vim with luajit instead of lua (Linux) * install vim with lua by homebrew (Mac) * install vim with luajit instead of lua (Mac) * install vim with python under HOME dir (Linux) * start without X server * modeline ## Tmux ## * install tmux under HOME dir * use clip board (Mac) * press Esc key immediately * show only 1 pane temporary ## Geant4 ## * install geant4 (Mac) * cmake src with ROOT * install VRML (Mac) * cmake error about ROOT * suppress G4ParticleGun messages * set filter for trajectries in macro ## ROOT ## * install ROOT with cocoa * change default setting * install ROOT with cocoa by homebrew * upgrade error on homebrew * change print size * change X range of TGrap * TText TLatex * change TStyle for some part * set file name for output in macro ## Homebrew ## * update error because of git * permission error ## Other ## * set htaccess on HP * rsync error for large size file * Gmail search option * atan2 (C language) * KEKCC batch queue back

## Mac ###############################

* restart menu bar +--------------------------+ | $ killall SystemUIServer | +--------------------------+ * F8~12 have error (Mission Control) +----------------+ | $ killall Dock | +----------------+ * nfs mount server % check uid gid +-----------------------------------------+ | $ dscl . -list /Users uid G <my_name> | | $ dscl . -list /Groups gid G <my_group> | +-----------------------------------------+ % edit /etc/exports +----------------------------------------+ | <src_dir> -mapall=<uid>:<gid> <dst_IP> | +----------------------------------------+ % restart nfs +----------------------------------------------+ | $ sudo kill -s HUP `cat /var/run/mountd.pid` | +----------------------------------------------+ % check exports +----------------+ | $ showmount -e | +----------------+ * multistage ssh login server : login.cc.kek.jp access server : sshcc1.kek.jp edit ~/.ssh/config +-------------------------------------------------------------------+ | Host login.cc.kek.jp | | ProxyCommand ssh -i $HOME/.ssh/kek_a ekawa@sshcc1.kek.jp nc %h %p | +-------------------------------------------------------------------+ +---------------------------------------------+ | $ ssh -i ~/.ssh/kek_l ekawa@login.cc.kek.jp | +---------------------------------------------+ NOTE : both key are in the local machine * change Google Chrome font edit configuration at tool bar for fixed width default : Osaka -> Menlo * change icons % iTunes genre edit /Applications/iTunes.app/Contents/Resources/genres.plist input image file to /Applications/iTunes.app/Contents/Resources/ % Google Japanesea Input replace icons at /Library/Input\ Methods/GoogleJapaneseInput.app/Contents/Resources/ % Symantec replace icon at /Library/Application\ Support/Symantec/  SymUIAgent/PlugIns/NortonQuickMenu.bundle/Contents/Resources/QMmenubaricon.tiff old : /Library/Application\ Support/Symantec/ SymSAQuickMenu/SymQuickMenu.app/Contents/Resources/QuickMenu_16x16.tiff * permit ssh with X window edit /etc/sshd_config +-------------------+ | X11Forwarding yes | +-------------------+ * restart ssh daemon +-----------------------------------------------------------------+ | $ sudo launchctl unload /System/Library/LaunchDaemons/ssh.plist | | $ sudo launchctl load /System/Library/LaunchDaemons/ssh.plist | +-----------------------------------------------------------------+ or +-------------------------+ | $ sudo killall sshd^<-?^| +-------------------------+ * enable super user 1. Apple メニューから「システム環境設定」を選択します。 2. 「表示」メニューから「ユーザとグループ」を選択します。 3. 鍵アイコンをクリックし、管理者アカウントで認証します。 4. 「ログインオプション」をクリックします。 5. 右下の「編集」または「接続」ボタンをクリックします。 6. 「ディレクトリユーティリティを開く」をクリックします。 7. 「ディレクトリユーティリティ」ウインドウの鍵アイコンをクリックします。 8. 管理者アカウント名とパスワードを入力し、「OK」をクリックします。 9. 「編集」メニューから「ルートユーザを有効にする」を選択します。 10. 利用するルートパスワードをパスワードフィールドとその確認用フィールドに入力し、 「OK」をクリックします。 * terminal color dark background : red 18(15) : green 18(15) : blue 18(15)  ->same as colour233 NOTE : depend on machines ? ANSI blue : red 40 : green 80 : blue 180 ANSI red : red 180 : green 40 : blue 40 * download Xcode Command Line Tools check Downloads in Preferences * private file of Karabiner (KeyRemap4MacBook) ~/Library/Application Support/Karabiner/private.xml * hide Application Dock icon edit <App>/Contents/Info.plist add these 2 lines under <dict>  +------------------------+ | <key>LSUIElement</key> | | <true/> | +------------------------+ * remove MobileBackups +-------------------------------------------------------+ | $ sudo tmutil disablelocal && sudo tmutil enablelocal | +-------------------------------------------------------+ * time sync on Marvericks % use developped ntpd +-----------------------------------------------------------------------------------+ | $ brew install https://raw.github.com/kimikato/homebrew-ntp-dev/master/ntp-dev.rb | +-----------------------------------------------------------------------------------+ % change using ntpd +------------------------------------------------------------------------+ | $ sudo mv ntpd ntpd.old && ln -s /usr/local/sbin/ntpd ./ ^at /usr/sbin^| +------------------------------------------------------------------------+ % modify NTP server   to set several servers is better (?) +--------------------------+ | $ sudo vim /etc/ntp.conf | +--------------------------+ +-------------------------------------+ | server server1 minpoll 6 maxpoll 10 | | server server2 minpoll 6 maxpoll 10 | | ... | +-------------------------------------+ % restart ntpd +------------------------------------------+ | $ sudo kill -HUP `cat /var/run/ntpd.pid` | +------------------------------------------+ % check +-----------+ | $ ntpq -p | +-----------+ +-------------------------------------------------------------------------------------+ | remote refid st t when poll reach delay offset jitter | | ============================================================================== | |^OK->^*ntp01.j-parc.jp 192.153.111.134 2 u 64 64 377 1.383 36.748 70.033 | | +ntp02.j-parc.jp 192.153.111.134 2 u 59 64 377 2.551 77.347 52.979 | +-------------------------------------------------------------------------------------+ * change local hostname +------------------------------------------+ | $ sudo scutil --set HostName <host name> | +------------------------------------------+ * input combining charactor input unicode from "文字ビューア"  upper ling : 00000305 * image cropping by terminal +---------------------------------------------------------------+ | $ convert -crop <width>x<height>+<x pos>+<y pos> <orig> <new> | +---------------------------------------------------------------+ * check registered printer IP 1. Apple アイコン[この Mac について] 2. [概要] タブで [システムレポート…] 3. [ハードウェア] ツリーの [プリンタ] を選択 4. 右側のプロパティのうち URI: に記載されているものが IP アドレス * right click drag in touch pad 1. tap two finger (right hand) 2. click pad (1 finger left hand) 3. release two fingr and drag by 1 finger (right hand) * back to page from address bar (Google Chrome) 設定->設定->検索エンジンの管理 +------------------------------+ | ページに戻る j javascript: | +------------------------------+ を追加 アドレスバーでjを入力するとフォーカスが外れる * UNIX_TIME <-> time conversion UNIX_TIME -> time +--------------------------------------------+ | $ date -r <UNIX_TIME> "+%Y/%m/%d %H:%M:%S" | +--------------------------------------------+ time -> UNIX_TIME +--------------------------------------------------------------------+ | $ date -jf '%Y/%m/%d %H:%M:%S' '<YY>/<MM>/<SS> <HH>:<MM>:<SS>' +%s | +--------------------------------------------------------------------+ * install LATEX by Homebrew 1. home brew で basictexをインストール basictexはMac TEXのコンパクト版 +------------------------------+ | $ brew cask install basictex | +------------------------------+ NOTE : brew-caskをまずはインストール +----------------------------------------+ | $ brew install caskroom/cask/brew-cask | +----------------------------------------+ 2. TEXをアップデート +----------------------------------+ | $ sudo tlmgr update --self --all | +----------------------------------+ NOTE : PATHを新しいtlmgrの場所に通す /usr/local/texlive/2015basic/bin/x86_64-darwin 3. 日本語環境とlatexmkを導入 +------------------------------------------------------+ | $ sudo tlmgr install collection-langjapanese latexmk | +------------------------------------------------------+ 4. フォント埋め込み バージョンを確認 +---------------------------------------------------------+ | $ tlmgr dump-tlpdb --remote | grep -C2 "name jfontmaps" | +---------------------------------------------------------+ 最初の方の「name jfontmaps」の2行下が「revision 38527」以降ならOK +-----------------------------------------------------------------------+ | $ cd /usr/local/texlive/2015basic/texmf-dist/scripts/cjk-gs-integrate | | $ sudo perl cjk-gs-integrate.pl --link-texmf | | $ sudo mktexlsr | +-----------------------------------------------------------------------+ NOTE : ghostscriptをhome brewでインストールしておく フォントを埋め込むためのマップファイルを更新 +------------------------------------------------------------------+ | $ sudo updmap-sys --setoption kanjiEmbed hiragino-elcapitan-pron | +------------------------------------------------------------------+ 5. Latexmkの設定ファイル(.latexmkrc)を作成 ~/.latexmkrc +--------------------------------------------------------------------------------+ | #!/usr/bin/env perl | | $latex = 'platex -synctex=1 -halt-on-error'; | | $latex_silent = 'platex -synctex=1 -halt-on-error -interaction=batchmode'; | | $bibtex = 'pbibtex'; | | $dvipdf = 'dvipdfmx %O -o %D %S'; | | $makeindex = 'mendex %O -o %D %S'; | | $max_repeat = 5; | | $pdf_mode = 3; # generates pdf via dvipdfmx | | | | # Prevent latexmk from removing PDF after typeset. | | # This enables Skim to chase the update in PDF automatically. | | $pvc_view_file_via_temporary = 0; | | | | # Use Skim as a previewer | | $pdf_previewer = "open"; | +--------------------------------------------------------------------------------+ 6. スタイルファイルをインストール +-------------------------------------------------------------------------------------------+ | $ sudo tlmgr install --no-persistent-downloads newtx fontaxes boondox txfonts ec helvetic | +-------------------------------------------------------------------------------------------+ latexmkでtexファイルをpdfにすることができる +-------------------+ | $ latexmk ***.tex | +-------------------+