LoginSignup
1
2

More than 3 years have passed since last update.

mac

Last updated at Posted at 2014-07-20

commands

xargs

  • -I: set argument position
  • copy files from S3 bucket that meet specific conditions
aws s3 ls s3://<bucket name>/<path> | grep <condition> | awk '{print $NF}' | xargs -n 1 -I {} aws s3 cp s3://<bucket name>/<path>/{} .

grep

  • exclude specific folder search
grep -r 'hogehoge' . --exclude-dir=node_modules --exclude-dir=log --exclude-dir=vendor --exclude-dir=.git

mktemp

make temporary file name (unique)

➜  ~ mktemp
/var/folders/tr/tn2bnhyj1dv8my_ddvm7mhv40000gn/T/tmp.pLdthvEz

openssl

generate new private key and certificate.

[21:25:52 - 14-09-07] /Users/toripiyo/tmp % openssl req -new -x509 -days 365 -sha1 -newkey rsa:2048 -nodes -keyout server.key -out server.crt -subj '/O=toripiyo/OU=tori/CN=localhost' -config  /usr/local/etc/openssl/openssl.cnf
Generating a 2048 bit RSA private key
.......+++
...........................................................+++
unable to write 'random state'
writing new private key to 'server.key'
-----

dtruss

[20:41:10 - 14-07-21] /Users/toripiyo % sudo dtruss boot2docker up

read(0x6, "error: Could not find a registered machine named 'boot2docker-vm'\nVBoxManage: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox$
 callee nsISupports\nVBoxManage: error: Context: \"FindMachine(Bstr(VMNameOrU", 0x5F4)           = 331 0
read(0x4, "\0", 0x200)           = 0 0
select(0x0, 0x0, 0x0, 0x0, 0xB0080E28)           = 0 0
select(0x0, 0x0, 0x0, 0x0, 0xB0080E28)           = 0 0
select(0x0, 0x0, 0x0, 0x0, 0xB0080E28)           = 0 0
select(0x0, 0x0, 0x0, 0x0, 0xB0080E28)           = 0 0
select(0x0, 0x0, 0x0, 0x0, 0xB0080E28)           = 0 0

du

check more than 2500MB directories.

du -m -x -d 5 . | awk '$1 >= 2500 {print }'
4166    ./Documents/musicmap/workspace
4209    ./Documents/musicmap
4001    ./Documents/Virtual Machines.localized
8260    ./Documents
2855    ./Library/Application Support/MobileSync/Backup/2a87a5443b28176b6706c10df18d2afa3b80da3a
4411    ./Library/Application Support/MobileSync/Backup
4411    ./Library/Application Support/MobileSync
5494    ./Library/Application Support
3112    ./Library/Developer
2604    ./Library/Mail/V2
2604    ./Library/Mail
12427    ./Library
4263    ./Music/iTunes/iTunes Media/Mobile Applications
5083    ./Music/iTunes/iTunes Media/Podcasts/Tech News Today (Video-HD)
6167    ./Music/iTunes/iTunes Media/Podcasts
11305    ./Music/iTunes/iTunes Media
11403    ./Music/iTunes
12018    ./Music
2910    ./Pictures/iPhoto Library/Masters
3165    ./Pictures/iPhoto Library
3193    ./Pictures
47902    .
     -d depth
             Display an entry for all files and directories depth directories deep.
     -s      Display an entry for each specified file.  (Equivalent to -d 0)
     -x      File system mount points are not traversed.

find

[23:57:04-14-07-20] /Users/toripiyo % find . -maxdepth 2 -mmin -5
./.forever
./.forever/config.json
./.forever/hUEL.log
./.forever/OgCq.log
./.forever/pids
./.forever/sock
./.lesshst
./Library/Cookies
./Library/Preferences
[20:41:10 - 14-07-21] /Users/toripiyo % find . -mtime -2 -type f | grep -i docker
./.boot2docker/boot2docker.iso
./.ssh/id_boot2docker
./.ssh/id_boot2docker.pub
./boo2docker.log
./Documents/docker

col

  • output man page's description to standard output
man ls | col | head

LS(1)             BSD General Commands Manual            LS(1)

NAME
     ls -- list directory contents

SYNOPSIS
     ls [-ABCFGHLOPRSTUW@abcdefghiklmnopqrstuwx1] [file ...]

DESCRIPTION

softwareupdate

system software update tool
https://support.apple.com/ja-jp/HT200113

terminal

receive the notification only from long time command

automation by javascript

JavaScript for OS X Automation by Example
http://developer.telerik.com/featured/javascript-os-x-automation-example/

application

xcode

  • uninstall old version Xcode application
sudo rm -rf /Applications/Xcode\ 7.3.1.app

firefox

change update channel

edit the following file from beta to release.

/Applications/Firefox.app/Contents/MacOS/defaults/pref/channel-prefs.js

numbers

cannot activete cell

check "Arrange -> Lock" is disabled.

change cell color based on condition.

kaspersky

uninstall kaspersky

homebrew

brew command

brew install

install package

brew install phantomjs
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/phantomjs-1.9.7.mavericks.bottle
######################################################################## 100.0%
==> Pouring phantomjs-1.9.7.mavericks.bottle.1.tar.gz
?  /usr/local/Cellar/phantomjs/1.9.7: 104 files, 34M

brew ls

list the installed files for formulae

brew ls phantomjs
/usr/local/Cellar/phantomjs/1.9.7/bin/phantomjs
/usr/local/Cellar/phantomjs/1.9.7/share/phantomjs/ (100 files)

brewdler

requirements

homebrew, brew tap, homebrew-cask

installation

brew tap Homebrew/brewdler

usage

dump

You can create a Brewfile from all the existing Homebrew packages you have installed with:

brew brewdle dump
$ cat Brewfile | head
tap 'caskroom/cask'
tap 'homebrew/binary'
tap 'homebrew/brewdler'
tap 'homebrew/versions'
brew 'atk'
brew 'autoconf'
brew 'automake'
brew 'bdw-gc'
brew 'boot2docker'
brew 'cairo'

brew cask

cask app installation result

hipchat

[21:58:32 - 14-11-04] /Users/toripiyo % brew cask install hipchat
==> Downloading https://www.hipchat.com/downloads/latest/mac
######################################################################## 100.0%
==> Symlinking App 'HipChat.app' to '/Users/toripiyo/Applications/HipChat.app'
==> Generic artifacting Artifact 'HipChat.app' to '/Users/toripiyo/Applications/HipChat.app'
?  hipchat staged at '/opt/homebrew-cask/Caskroom/hipchat/latest' (725 files, 28M)

cask error

[21:54:18 - 14-11-04] /Users/toripiyo % brew cask install hipchat
Warning: Unexpected method 'license' called on Hipchat.
Warning:
Warning:   If you are working on Hipchat, this may point to a typo. Otherwise
Warning:   it probably means this Cask is using a new feature. If that feature
Warning:   has been released, running `brew update; brew upgrade brew-cask`
Warning:   should fix it. Otherwise you should wait to use Hipchat until the
Warning:   new feature is released.
Warning: Unexpected method 'app' called on Hipchat.
Warning:
Warning:   If you are working on Hipchat, this may point to a typo. Otherwise
Warning:   it probably means this Cask is using a new feature. If that feature
Warning:   has been released, running `brew update; brew upgrade brew-cask`
Warning:   should fix it. Otherwise you should wait to use Hipchat until the
Warning:   new feature is released.
Warning: Unexpected method 'postflight' called on Hipchat.
Warning:
Warning:   If you are working on Hipchat, this may point to a typo. Otherwise
Warning:   it probably means this Cask is using a new feature. If that feature
Warning:   has been released, running `brew update; brew upgrade brew-cask`
Warning:   should fix it. Otherwise you should wait to use Hipchat until the
Warning:   new feature is released.
Warning: Unexpected method 'zap' called on Hipchat.
Warning:
Warning:   If you are working on Hipchat, this may point to a typo. Otherwise
Warning:   it probably means this Cask is using a new feature. If that feature
Warning:   has been released, running `brew update; brew upgrade brew-cask`
Warning:   should fix it. Otherwise you should wait to use Hipchat until the
Warning:   new feature is released.
Error: no implicit conversion of Symbol into String
Please report this bug:
    https://github.com/caskroom/homebrew-cask/issues
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:389:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:389:in `new'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:389:in `join'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask.rb:137:in `destination_path'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask.rb:141:in `installed?'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/installer.rb:27:in `install'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli/install.rb:10:in `block in run'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli/install.rb:6:in `each'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli/install.rb:6:in `run'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli.rb:57:in `run_command'
/usr/local/Cellar/brew-cask/0.35.0/rubylib/cask/cli.rb:72:in `process'
/usr/local/bin/brew-cask.rb:6:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Library/brew.rb:59:in `require?'
/usr/local/Library/brew.rb:142:in `<main>'
brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

is required.
https://github.com/caskroom/homebrew-cask/issues/6711

shortcut key

screen capture

Shif-Command-3

Take a picture of the whole screen

Shif-Command-4

Take a picture of part of the screen

Shift-Command-4 and press Space bar

Take a picture of a window or the menu bar

process

kernel_task

mds

mds stands for “metadata server” and the mds process is part of Spotlight
http://osxdaily.com/2010/08/05/mds-mac/

navx

NAVX process is the command line scanner used by SEP for Macintosh
http://www.symantec.com/business/support/index?page=content&id=TECH140574

os upgrade

yosemite

Faster Mac OS X 10.10 Yosemite Upgrades for Developers
https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/

Copy and paste the following code into a terminal. Press enter. Log out and back in. Enjoy your privacy
https://fix-macosx.com

mac performance improvement

don't place many icons on desktop

Many desktop icons make drawing speed slow.
Macの動作が遅くなる九つの理由と対処法

tips

change shell

show hidden file on finder

# change configuration value
P21262% defaults write com.apple.finder AppleShowAllFiles TRUE
# restart finder
P21262% killall Finder

middleware

phpenv

install php5.6

brew install openssl
brew install libxml2
PHP_BUILD_CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl) --with-libxml-dir=$(brew --prefix libxml2)" PHP_BUILD_EXTRA_MAKE_ARGUMENTS=-j4 phpenv install 5.6.21
1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2