This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/bash -x | |
# This script will be executed by root user and stored at | |
# /var/lib/cloud/instance/user-data.txt when invoking ec2. | |
# | |
# You can see the log from AWS Management Console in the following way. | |
# EC2: Actions > Monitor and troubleshoot > Get system log | |
################################################################################ | |
# variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
eval $(egrep ^Host ~/.ssh/config | awk '{ print $2 }' | fzf | xargs -I{} echo "ssh {}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Terminal" | |
do script "ssh SERVER_NAME" | |
do script "cd deploy-directory" in front window | |
do script "cap prod deploy" in front window | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "Terminal" | |
do script "ssh SERVER_NAME" | |
do script "cd /tmp" in front window | |
do script "date" in front window | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# the next line restarts using wish \ | |
exec wish "$0" "$@" & | |
button .b0 -text "github" -command "exec open https://github.com/" | |
button .b1 -text "bitbucket" -command "exec open https://bitbucket.org/" | |
button .b2 -text "login - serverA" -command "exec serverA.scpt" | |
button .b3 -text "iterm" -command "exec open -a /Applications/iTerm.app" | |
pack .b0 .b1 .b2 .b3 -fill x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
paste <(grep ^Host config) <(grep HostName config) <(grep 'User ' config) | awk '{ printf("alias %s=\"ssh -A %s@%s\"\n", $2, $6, $4); }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prompt - black | |
PS1='\[\033[40;1;32m\]\u\[\033[2;32m\]@\[\033[0m\]\[\033[40;32m\]\h \[\033[1;36m\]\w \[\033[0m\]\[\033[40;2;37m\]\d \t\[\033[0m\]\n\\$ ' | |
# Prompt - white | |
PS1='\[\033[47;0;32m\]\u\[\033[0;32m\]@\[\033[0m\]\[\033[47;0;32m\]\h \[\033[0;36m\]\w \[\033[0m\]\[\033[47;0;37m\]\d \t\[\033[0m\]\n\\$ ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; lexical-let ってなに? | |
(let ((count 0)) | |
(defun get-count () | |
(setq count (+ count 1)) | |
count) | |
; (let ((count 10)) | |
(lexical-let ((count 10)) | |
(print (get-count)) | |
(print (get-count)) | |
(print (get-count)) |