$ brew install sl
$ sl
以上。
;; load environment variables -------------------------------
(let ((envs '("PATH" "C_INCLUDE_PATH" "CPLUS_INCLUDE_PATH" "TEXINPUTS" "BSTINPUTS" "BIBINPUTS")))
(exec-path-from-shell-copy-envs envs))
これで.zshrcの方だけで管理しておくことができます。git config --global user.name "Your Name" git config --global user.email "your_email@example.com"そうすると、「~/.gitconfig」に以上の内容が書き込まれます。
cd programそしたらば、次はそのフォルダをGitの対象にするために以下のコマンドを入力します。
git initこれで、「program」の中に「.git」というフォルダができます。
git add .ドット(.)があることに注意してください。
git commit -m "First commit."このcommitまでやって始めて一つのバージョンができあがります。
git add text.txt git commit -m "text.txt is modified."とします。
git add -AこれでOKです。
git commit -aこれでgit add -A してgit commitしたことと同じになります。
# Emacs temp files *~ [#]*[#] .\#*といった具合に正規表現(正式にはglobパターン)が使えます。
ssh-keygen -t rsa -C "your_email@example.com"
git remote add origin https://github.com/user-name/program.gitBitbucketなら以下です。
git remote add origin ssh://git@bitbucket.org/user-name/program.git以上のコマンドはさっき残しておけと書いたページに書いてあるのでコピペでいけます。
git push -u origin masterこうすると転送が始まってサイト上にアップロードされるというわけです。
git pull origin masterって打てばどちらのファイルも維持されたまま併合(マージ)されます。
git pushとやれば、その日の変更履歴がサイト上にアップロードされるというわけです。
git clone https://github.com/user-name/program.gitでできます。
git clone https://user-name@bitbucket.org/user-name/program.gitこの中に.gitフォルダも既に含まれているはずなので、そのPCのSSHキーの登録が済んでいればgit remoteの設定なんかは要らずに、
git pushこれだけでそのPC内の変更がサイト上に反映されるはずです。
git pullこれだけでサイト上の最新版に更新できるはずです。
$crontab -e ;;特に設定していない人はvimが起動するはずです。 ;;cronが起動します */15 * * * * /usr/bin/purge ;;上を追加して上書き保存 ;;15分おきにpurgeします
00 10-23/3 * * * * /usr/bin/purge ;;毎日10~23の間3時間おきにpurgeする ;;私は23時以降、Macを触ることはありません。
10 3-6 * * 5,6,7 /usr/bin/purge ;;毎週金、土、日のAM3〜6時10分にpurge
;; 自作のpurgeする関数 (defun purge () (interactive) (message "purging...") (shell-command (format "purge")) (message "Finished.")) (global-set-key "\C-c\C-p" 'purge)C-c C-pでパージ出来ます。
# 引数1個めと2個めは入力ファイル、出力ファイル
function cc(){
arg=("$@")
command="gcc -O3 -g -Wall ${arg[1]} -o ${arg[2]} -lmylib"
if [ $# -gt 2 ]; then
for i in `seq 3 $#`
do
command="${command} ${arg[$i]}"
done
fi
echo $command
eval $command
}
ここでは-lmylibは必ず使うという前提でやってます。
;; term+
(add-to-list 'load-path "~/emacslib/termplus")
(require 'term+)
(require 'xterm-256color)
(require 'term+mux)
;; Find available shell
(defun skt:shell ()
(or (executable-find "zsh") ;; bashユーザは一行下と入れ替え
(executable-find "bash")
(error "No shell program was found in your PATH...")))
;; Set shell-name
(setq shell-file-name (skt:shell))
(setenv "SHELL" shell-file-name)
(setq explicit-shell-file-name shell-file-name)
;; Setup sufficient moji-codes for Mac
(setq system-uses-terminfo nil)
(prefer-coding-system 'utf-8)
(require 'ucs-normalize)
(setq file-name-coding-system 'utf-8-hfs)
(setq locale-coding-system 'utf-8-hfs)
;; Color settings for term
(setq term-default-bg-color "Black")
(autoload 'ansi-color-for-comint-mode-on "ansi-color"
"Set `ansi-color-for-comint-mode' to t." t)
;; Binding key
(global-unset-key "\C-t")
(global-set-key "\C-t" '(lambda ()
(interactive)
(ansi-term shell-file-name)))